Embedded Target for Texas Instruments C6000 DSPs    
C6711 DSK DIP Switch

Simulate or read the user-defined DIP switches on the C6711 DSK

Library

c6711dsklib in Embedded Target for TI C6000 DSP

Description

Added to your model, this block behaves differently in simulation than in code generation and targeting.

Simulation--the options USER_SW1, USER_SW2, and USER_SW3 generate output to simulate the settings of the user-defined dual inline pin (DIP) switches on your C6711 DSK. Each option turns the associated DIP switch on when you select it. The switches are independent of one another.

By defining the switches to represent actions on your target, DIP switches let you modify the operation of your process by reconfiguring the switch settings.

Use the Data type to specify whether the DIP switch options output an integer or a logical string of bits to represent the status of the switches. The table that follows presents all the option setting combinations with the result of your Data type selection.

Table 6-7: Option Settings to Simulate the User DIP Switches on the C6711 DSK
USER_SW1 (LSB)
USER_SW2
USER_SW3 (MSB)
Boolean Output
Integer Output
Cleared
Cleared
Cleared
000
0
Selected
Cleared
Cleared
001
1
Cleared
Selected
Cleared
010
2
Selected
Selected
Cleared
011
3
Cleared
Cleared
Selected
100
4
Selected
Cleared
Selected
101
5
Cleared
Selected
Selected
110
6
Selected
Selected
Selected
111
7

Selecting the Integer data type results in the switch settings generating integers in the range from 0 to 7 (uint8), corresponding to converting the string of individual switch settings to a decimal value. In the Boolean data type, the output string presents the separate switch setting for each switch, with the USER_SW1 status represented by the least significant bit (LSB) and the status of USER_SW3 represented by the most significant bit (MSB).

Code generation and targeting--the code generated by the block reads the physical switch settings of the user switches on the board and reports them as shown in Table 6-8. Your process uses the result in the same way whether in simulation or in code generation. In code generation and when running your application, the block code ignores the settings for USER_SW1, USER_SW2, and USER_SW3 in favor of reading the hardware switch settings. When the block reads the DIP switches, it reports the results as either a Boolean string or an integer value as Table 6-8, Output Values From The User DIP Switches on the C6711 DSK shows

Table 6-8: Output Values From The User DIP Switches on the C6711 DSK
USER_SW1 (LSB)
USER_SW2
USER_SW3 (MSB)
Boolean Output
Integer Output
Off
Off
Off
000
0
On
Off
Off
001
1
Off
On
Off
010
2
On
On
Off
011
3
Off
Off
On
100
4
On
Off
On
101
5
Off
On
On
110
6
On
On
On
111
7

Dialog Box

USER_SW1
Simulate the status of the user-defined DIP switch on the board.
USER_SW2
Simulate the status of the user-defined DIP switch on the board.
USER_SW3
Simulate the status of the user-defined DIP switch on the board.
Data type
Determines how the block reports the status of the user-defined DIP switches. Boolean is the default, indicating that the output is a logical string of three bits.
Each bit represents the status of one DIP switch; the LSB is switch USER_SW1 and the MSB is switch USER_SW3. The other data type, Integer, converts the logical string to an equivalent unsigned 8-bit (uint8) decimal value. For example, if the logical string is 101, the decimal conversion yields 5.
Sample time
Specifies the time between samples of the signal. The default is 1 second between samples, for a sample rate of one sample per second (1/Sample time).

  C6711 DSK DAC C6711 DSK LED