8160-dioheader: Difference between revisions

From embeddedTS Manuals
(Added direct invocation. removed "&" from tsctl server invocation-it is no longer needed. Added @ for host, although it is optional for IP addresses. Don't need to manually look up pins. Need to use SetAsync if you aren't going to call Commit afterwards.)
No edit summary
 
Line 7: Line 7:
# Do not do this if the tsctl server is already running.
# Do not do this if the tsctl server is already running.
# Toggle the DIO high and low directly as follows:
# Toggle the DIO high and low directly as follows:
tsctl DIO SetAsync DIO_1 high
tsctl DIO SetAsync 8160_DIO_1 high
tsctl DIO SetAsync DIO_1 low
tsctl DIO SetAsync 8160_DIO_1 low


# If you want to share the tsctl functionality
# If you want to share the tsctl functionality
Line 17: Line 17:
# Once the server is started it will daemonize and you can access it over TCP/IP.
# Once the server is started it will daemonize and you can access it over TCP/IP.
# Toggle the DIO high and low via the tsctl client:
# Toggle the DIO high and low via the tsctl client:
tsctl @127.0.0.1 DIO SetAsync DIO_1 high
tsctl @127.0.0.1 DIO SetAsync 8160_DIO_1 high
tsctl @127.0.0.1 DIO SetAsync DIO_1 low
tsctl @127.0.0.1 DIO SetAsync 8160_DIO_1 low


# Note that the '@' is optional if the host name is an IP address of form X.X.X.X
# Note that the '@' is optional if the host name is an IP address of form X.X.X.X
# For consistency we recommend always including the '@'
# For consistency we recommend always including the '@'


# Note in the above example, the values DIO_1, high and low are automatically  
# Note in the above example, the values 8160_DIO_1, high and low are automatically  
# looked up to produce integer values. You can also do this manually, as show below:
# looked up to produce integer values. You can also do this manually, as show below:


# Lookup the logical DIO mapping of the dio header pin 1
# Lookup the logical DIO mapping of the dio header pin 1
eval `tsctl 127.0.0.1 System MapLookup DIO_1`
eval `tsctl 127.0.0.1 System MapLookup 8160_DIO_1`
# If you run this outside of the eval it will return:
# If you run this outside of the eval it will return:
# DIO_1=130
# System_MapLookup_0=XXX
# where XXX is the actual logical DIO number.
# If you look up "high" it will return 1, while "low" will return 0
# If you look up "high" it will return 1, while "low" will return 0
# note that lookups are case-insensitive
# note that lookups are case-insensitive


# Toggle the DIO high and low:
# Toggle the DIO high and low:
tsctl @127.0.0.1 DIO SetAsync $DIO_1 high
tsctl @127.0.0.1 DIO SetAsync $System_MapLookup_0 high
tsctl @127.0.0.1 DIO SetAsync $DIO_1 low
tsctl @127.0.0.1 DIO SetAsync $System_MapLookup_0 low


</source>
</source>
Line 52: Line 53:
|-
|-
| 1
| 1
| DIO_1
| 8160_DIO_1
| Pulled high by R124
| Pulled high by R124
|-
|-
Line 60: Line 61:
|-
|-
| 3
| 3
| DIO_3
| 8160_DIO_3
| Pulled high by R123
| Pulled high by R123
|-
|-
Line 68: Line 69:
|-
|-
| 5
| 5
| DIO_5
| 8160_DIO_5
| Pulled high by R122
| Pulled high by R122
|-
|-
Line 76: Line 77:
|-
|-
| 7
| 7
| DIO_7
| 8160_DIO_7
| pulled high by R121
| pulled high by R121
|-
|-
Line 84: Line 85:
|-
|-
| 9
| 9
| DIO_9
| 8160_DIO_9
| Pulled high by R120
| Pulled high by R120
|-
|-
Line 92: Line 93:
|-
|-
| 11
| 11
| DIO_11
| 8160_DIO_11
| Pulled high by R119
| Pulled high by R119
|-
|-
Line 100: Line 101:
|-
|-
| 13
| 13
| DIO_13
| 8160_DIO_13
| Pulled high by R118
| Pulled high by R118
|-
|-
Line 108: Line 109:
|-
|-
| 15
| 15
| DIO_15
| 8160_DIO_15
| Pulled high by R117
| Pulled high by R117
|-
|-

Latest revision as of 11:17, 9 August 2013

The DIO is manipulated through tsctl, or through manipulation of the registers directly.

Using tsctl will be the easiest way to communicate with the IO. This example will show the simplest way to toggle the IO, but see the tsctl page for more advanced usage.

# The easiest approach is to invoke tsctl directly.
# Do not do this if the tsctl server is already running.
# Toggle the DIO high and low directly as follows:
tsctl DIO SetAsync 8160_DIO_1 high
tsctl DIO SetAsync 8160_DIO_1 low

# If you want to share the tsctl functionality
# among multiple processes or access it via TCP/IP,
# you will need to run the tsctl server and access it as a client:
tsctl --server

# Once the server is started it will daemonize and you can access it over TCP/IP.
# Toggle the DIO high and low via the tsctl client:
tsctl @127.0.0.1 DIO SetAsync 8160_DIO_1 high
tsctl @127.0.0.1 DIO SetAsync 8160_DIO_1 low

# Note that the '@' is optional if the host name is an IP address of form X.X.X.X
# For consistency we recommend always including the '@'

# Note in the above example, the values 8160_DIO_1, high and low are automatically 
# looked up to produce integer values. You can also do this manually, as show below:

# Lookup the logical DIO mapping of the dio header pin 1
eval `tsctl 127.0.0.1 System MapLookup 8160_DIO_1`
# If you run this outside of the eval it will return:
# System_MapLookup_0=XXX
# where XXX is the actual logical DIO number. 
# If you look up "high" it will return 1, while "low" will return 0
# note that lookups are case-insensitive

# Toggle the DIO high and low:
tsctl @127.0.0.1 DIO SetAsync $System_MapLookup_0 high
tsctl @127.0.0.1 DIO SetAsync $System_MapLookup_0 low
Pinout Header
Pin Name Notes
1 8160_DIO_1 Pulled high by R124
2 Ground
3 8160_DIO_3 Pulled high by R123
4 I2C_CLK
5 8160_DIO_5 Pulled high by R122
6 SPI_CS#
7 8160_DIO_7 pulled high by R121
8 I2C_DAT
9 8160_DIO_9 Pulled high by R120
10 SPI_MISO
11 8160_DIO_11 Pulled high by R119
12 SPI_MOSI
13 8160_DIO_13 Pulled high by R118
14 SPI_CLK
15 8160_DIO_15 Pulled high by R117
16 CPU_3.3V Do not draw more than 12mA
16 15
14 13
12 11
10 9
8 7
6 5
4 3
2 1
WARNING: DIO are not 5V tolerant. Only SPI_MOSI on this header is 5V tolerant.