Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ctboard:peripherals:dipsw [2016/02/25 10:45] feurctboard:peripherals:dipsw [2026/06/25 14:53] (current) – [Programming Example] scbj
Line 1: Line 1:
 ====== DIPSW ====== ====== DIPSW ======
  
-On the CT Board are 32 DIP switches mounted. They are arranged in 4 groups of 8 DIP switches. \\+The CT Board features 32 DIP switches. They are arranged in 4 groups of 8 DIP switches. \\
 If a DIP switch is in the position "high" (see [[#diagram]] below) it provides a logical **"1"**. \\ \\ If a DIP switch is in the position "high" (see [[#diagram]] below) it provides a logical **"1"**. \\ \\
  
-> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} Please make sure the CT Board is in the correct mode. +> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} {{ctboard:ctboard_mode_4.svg?48px }} Please make sure the CT Board is in the correct mode. 
-> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3** +> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4**  
 +\\ 
 + 
 +===== Registers ===== 
 + 
 +The registers are read only. 
 + 
 +\\ {{ctboard_dipsw_reg.svg}} \\ \\ 
 + 
 +===== Diagram ===== 
 + 
 +\\ {{:ctboard:peripherals:ctboard_dipsw.svg?700em}} \\ \\
  
 ===== Programming Example ===== ===== Programming Example =====
  
-The code snippet bellow shows how to use the DIPSW.+The code snippets below show how to use the DIPSW.
  
 <code c> <code c>
Line 20: Line 31:
 \\ \\
  
-===== Registers ===== +<code text> 
- +.equ ADDR_DIPSW,     0x60000200 
-The Registers are read only+                 
- +        ldr     r0,  =ADDR_DIPSW 
-\\ {{ctboard_dipsw_reg.svg}} \\ \\ +        ldrb    r1,  [r0, #0]          // Read byte from S7..0
- +        ldrh    r1,  [r0, #2]          // Read half word from S31..16. 
-===== Diagram ===== +        ldr     r1,  [r0, #0]          // Read all DIPSW at once into a word. 
- +</code> 
-\\ {{:ctboard:peripherals:ctboard_dipsw.svg?700em}} \\ \\+\\
  • ctboard/peripherals/dipsw.1456397107.txt.gz
  • Last modified: 2016/02/25 10:45
  • by feur