Hi, I am trying to program a CC3200 to read power measurements from the MSP430I2040 EVM.
I tried to communicate through the serial port (RS232) to the MSP430I2040 EVM that is loaded with the Out Of Box demo.
I have modified the CC3200 UART demo to send and recieve data through UARTA1 and display any results to my PC through UARTA0.
So far I am not receiving anything back from the MSP430I2040. My main thought is that I am not sending a command frame correctly and possibly calculating the checksum incorrectly. It would help to see an example of a command frame. Is it okay to send the frame one byte at a time as shown in my code? when receiving is it necessary to set up an interrupt on the receive so that i don't miss it? Thanks
Here is my code.
//************************************************************************
// Command Frame
//************************************************************************
unsigned char ChecksumCMD = 0;
ChecksumCMD = (0x68+0x99+0x99+0x99+0x99+0x99+0x99+0x68+0x23+0x02+0x52+0x00);
UARTCharPut(UARTA1_BASE, 0x68); //F_Start
UARTCharPut(UARTA1_BASE, 0x99); //Address
UARTCharPut(UARTA1_BASE, 0x99);
UARTCharPut(UARTA1_BASE, 0x99);
UARTCharPut(UARTA1_BASE, 0x99);
UARTCharPut(UARTA1_BASE, 0x99);
UARTCharPut(UARTA1_BASE, 0x99);
UARTCharPut(UARTA1_BASE, 0x68); //F_Start
UARTCharPut(UARTA1_BASE, 0x23); //C_cod
UARTCharPut(UARTA1_BASE, 0x02); //Length
UARTCharPut(UARTA1_BASE, 0x52); //CMDH
UARTCharPut(UARTA1_BASE, 0x00); //CMDL
UARTCharPut(UARTA1_BASE, ChecksumCMD); //Checksum
UARTCharPut(UARTA1_BASE, 0x16); //End
//************************************************************************
// Recieve from Power Meter
//************************************************************************
unsigned char recieveddata[34];
unsigned char recievedchar;
int i;
for (i = 0; i < 33; ++i)
{
recievedchar = UARTCharGet(UARTA1_BASE);
recieveddata[i] = recievedchar;
}
for (i = 0; i < 33; ++i)
{
UARTCharPut(UARTA0_BASE,recieveddata[i]);
}