V2.3 Page 7 of 15 February 2007
PORT B
:
PIN_B0 0x30, PIN_B1 0x31, PIN_B2 0x32, PIN_B3 0x33,
PIN_B4 0x34, PIN_B5 0x35, PIN_B6 0x36, PIN_B7 0x37
PORT C
:
PIN_C0 0x38, PIN_C1 0x39, PIN_C2 0x3A, PIN_C3 0x3B,
PIN_C4 0x3C, PIN_C5 0x3D, PIN_C6 0x3E, PIN_C7 0x3F
PORT D
:
PIN_D0 0x40, PIN_D1 0x41, PIN_D2 0x42, PIN_D3 0x43,
PIN_D4 0x44, PIN_D5 0x45, PIN_D6 0x46, PIN_D7 0x47
PORT E
:
PIN_E0 0x48, PIN_E1 0x49, PIN_E2 0x4A, PIN_E3 0x4B,
PIN_E4 0x4C, PIN_E5 0x4D, PIN_E6 0x4E, PIN_E7 0x4F
The source code for the Token I/O firmware (developed for the CCS C compiler) is available as a
free download upon purchase and receipt of the hardware. Example Visual C++ source code (for
Windows 98/2000/XP) for communicating with the DLP-245PB-G via the Token I/O firmware is
also available for download. The windows source code also contains the port pin definitions
listed above.
V2.3 Page 8 of 15 February 2007
TOKEN I/O COMMAND SET
0xA5 – Line In – Reads the state of a single port pin
Parameters: Port – Select from available port pins (PIN_A3, PIN_B0, etc)
Returns: 1 Byte: State of the port pin (0 or 1)
Function: This function will read the state of a single port pin. If the data direction for the
pin selected was set to output, the direction is first set to input.
Example: 0x2, 0xA5, 0x2B, 0x8C - Reads the current state of port pin PIN_A3.
0xA6 – Line Out - Sets a single port pin high or low
Parameters: Port – Select from available port pins (PIN_A3, PIN_B3, etc)
State – 0 or 1
Returns: Undefined
Function: This function will change the output state of a single port pin. If the data direction
for the pin selected was set to input, the direction is first set to output.
Example: 0x3, 0xA6, 0x2B, 0x1, 0x8F – Sets port pin PIN_A3 high.
0xA7 – Return Board ID
Parameters: None
Returns: 5 bytes: “245PB”
Function: This function will return the ID of the board currently opened.
Example: 0x1, 0xA7, A6 – Reads the board ID.
0xA8 – Setup A/D
Parameters: Port Configuration – Selects analog port configuration. (See command 0xA8 in
the example firmware for options.)
A/D Conversion Clock – Select the source for the A/D conversion clock. (See
command 0xA8 in the example firmware for options.)
Returns: Undefined
Function: This function will select the source for the A/D conversion clock. (Refer to the
datasheet for the 16F877A for a detailed explanation of the conversion clock.)
Example: 0x3, 0xA8, 0x0, 0x7, 0xAC – Sets all available A/D inputs on the DLP-245PB-G
to analog mode (0x0) and selects the internal A/D clock (0x7).
V2.3 Page 9 of 15 February 2007
0xA9 – A/D Conversion
Parameters: Analog Port Number – Selects the analog port for the A/D conversion.
Returns: 2 Bytes: The 10-bit voltage data; LSB first.
Function: This function will set the channel for the A/D conversion, pause 10uS, perform
the A/D conversion, and then return 2 bytes to the host (LSB first). Command
0xA8 must have been previously called to configure the desired analog channel
as an A/D input.
Example: 0x2, 0xA9, 0x2, 0xA9 – Selects analog channel 2 (AN2), performs the A/D
conversion, and returns 2 bytes of data.
0xAA – EEPROM Read
Parameters: Address – Selects the zero-based address of the location in the 16F877A’s
internal EEPROM for reading.
Returns: 1 Byte: The byte of data read from the EEPROM.
Function: This function will read the selected location in the 16F877A’s internal EEPROM.
Example: 0x2, 0xAA, 0x2, 0xAA – Reads EEPROM Address 2, and returns a single byte of
data.
0xAB – EEPROM Write
Parameters: Address – Selects the zero-based address of the location in the 16F877A’s
internal EEPROM for writing.
Data Data to be written to the EEPROM.
Returns: Undefined.
Function: This function will write the selected location in the 16F877A’s internal EEPROM.
Example: 0x3, 0xAA, 0x2, 0xFE, 0x55 – Writes a value of 0xFE to EEPROM Address 2.

DLP-245PB-G

Mfr. #:
Manufacturer:
DLP Design
Description:
MODULE USB-MCU FT245RL W/16F877A
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet