Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
On SCI I can send only char data or int(integer) data?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
On SCI I can send only char data or int(integer) data?
Hello,
Sorry for the wrong numbers ( I was looking at TRM for different MCU ).
Detailed SCI Block Diagram is shown in Figure 30-1 - page 1719
Transmit Data Buffer Register (SCITD) is described in Section 30.7.12.3 - page 1753
For example if you have 16 bit data to send you should split it into 2 bytes of uint8.
Hello,
You can use something like this:
void send32BitData(sciBASE_t *sci, uint32_t ui32_data)
{
uint8_t ui8_data;
volatile int i = 0;
for( i = 4 ; i > 0 ; i-- )
{
ui8_data = (ui32_data >> 24) & 0xFF ;
while ((sci->FLR & SCI_TX_INT) == 0) { /* wait */ };
sci->TD = ui8_data;
ui32_data = ui32_data << 8 ;
}
}
Hello,
As I said in one of the posts above, you should pass uint8 to sciSend. There is no HALCoGen send32BitData function. This function is custom and splits 32 bit data into 4 uint8 data. If you want to send integer number represent by it's digits ASCII codes than you can use the following function:
I have to send for example 2196, which is on 12 bits. But this value arrives in DCAN records as char data type, because the functions canTransmit and sciSend, accept char data ((uint32 canTransmit(canBASE_t *node, uint32 messageBox, const uint8 * data)). How to convert the data to be send from one microcontroller to another through the pins of CAN.
Hello,
As I mentioned above:
"There is no HALCoGen send32BitData function. This function is custom and splits 32 bit data into 4 uint8 data. If you want to send integer number represent by it's digits ASCII codes than you can use the following function:......"
You have to add this code by yourself!