« Close

Datasheets and User Guides

App Notes

Software & Driver

 

5.2.16 - AsynchConfig

Requires U3 hardware version 1.21+. Configures the U3 UART for asynchronous communication. On hardware version 1.30 the TX (transmit) and RX (receive) lines appear on FIO/EIO after any timers and counters, so with no timers/counters enabled, and pin offset set to 4, TX=FIO4 and RX=FIO5. On hardware version 1.21, the UART uses SDA for TX and SCL for RX. Communication is in the common 8/n/1 format. Similar to RS232, except that the logic is normal CMOS/TTL. Connection to an RS232 device will require a converter chip such as the MAX233, which inverts the logic and shifts the voltage levels.

Table 5.2.16-1. AsynchConfig Command Response

Command:    
Byte    
0 Checksum8  
1 0xF8  
2 0×02  
3 0×14  
4 Checksum16 (LSB)  
5 Checksum16 (MSB)  
6 0×00  
7 AsynchOptions  
    Bit 7: Update
    Bit 6: UARTEnable
    Bit 5: Reserved
8 BaudFactor LSB (1.30 only) 
9 BaudFactor MSB  
     
     
Response:    
Byte    
0 Checksum8  
1 0xF8  
2 0×02  
3 0×14  
4 Checksum16 (LSB)  
5 Checksum16 (MSB)  
6 Errorcode  
7 AsynchOptions  
8 BaudFactor LSB (1.30 only) 
9 BaudFactor MSB  
  • AsynchOptions:
    Bit 7: Update If true, the new parameters are written (otherwise just a read is done).
    Bit 6: UARTEnable If true, the UART module is enabled. Note that no data can be transfered until pins have been assigned to the UART module using the ConfigIO function.
  • BaudFactor16 (BaudFactor8): This 16-bit value sets the baud rate according the following formula: BaudFactor16 = 216 – 48000000/(2 x Desired Baud). For example, a BaudFactor16 = 63036 provides a baud rate of 9600 bps. (With hardware revision 1.21, the value is only 8-bit and the formula is BaudFactor8 = 28 – TimerClockBase/(Desired Baud) ).