-2 (0xFFFFFFFE) - FPA_INVALID_NO
The FPA adapter (FlafhPro430 - USB-MSP430-FPA only) can provide UART communication via
BSL-Tx and BSL-Rx pins (#12 and #14). Message to be send should be located in the data buffer
using instruction F_Put_Byte_to_Buffer( addr, data). Received result via UART is located in the
buffer and can be taken from it using instruction data = F_Get_Byte_from_Buffer( addr).
Note: Make sure that the Vcc (external or from FPA) is not OFF, because the UART
communication uses the BSL-Tx/Rx inteffaces and the high level of the data I/O is following
the Vcc level. If the Vcc is OFF then the high level will be 0V and of course no data can be
transmitted and received to/from external device.
Following data should be placed in the data buffer before the UART instruction is used using
instruction F_Put_Byte_to_Buffer( addr, data)
Tx message size - at buffer address location 0x0000 (value from 1 to 56)
Rx message size - at buffer address location 0x0001 (value from 0 to 56)
Tx message data - starting at buffer address location 0x0010 (1-st byte)
Tx message data - next address 0x0011 (2-st byte)
...................................................................................................................................
Tx message data - last address 0x0047 (56-th byte)
Received message from via UART are placed in the buffer at location and can be read using
instruction data = F_Get_Byte_from_Buffer( addr).
Rx message data - starting at buffer address location 0x0010 (1-st byte)
Rx message data - next address 0x0011 (2-st byte)
...................................................................................................................................
Rx message data - last address 0x0047 (56-th byte)
Receiving message must be send from the device to FPA no later then the specified timeout (30 ms)
counted from the time when the last byte of the Tx message has been sent.
Example:
int TxRx_via_UART( int speed, int Tx_size, int Rx_size, BYTE *TxData, BYTE *RxData)
{
int k, response;
if(( Tx_size < 1 ) || ( Tx_size > UART_BUFFER_SIZE)) return(FALSE);
if(( Rx_size < 0 ) || ( Rx_size > UART_BUFFER_SIZE)) return(FALSE);
113