how to use uart for getting 32bytes data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

here  is my code i am trying to get 32 bytes by uart when it is sent from other mcu    .
this data is used for further process.
my cy conroller will wait for this 32 bytes data train and whenever it come interrupt is  triggered and it will be stored and it will again wait for another 32 bytes data..





void main(void)
{  
 
 
M8C_EnableGInt ;
UART_1_Start(UART_PARITY_NONE);
SPIM_1_Start(SPIM_1_SPIM_MODE_0 | SPIM_1_SPIM_MSB_FIRST);


start:
UART_1_Start(UART_PARITY_NONE);
UART_1_CPutString("\r\nSTART\r\n");
a=0;x=0;
LED_3_Switch(0x01);
UART_1_IntCntl(UART_1_ENABLE_RX_INT);

while(!x);


goto start;
/*

*/
 }

void UART_1_RX_ISR_C(void)
{UART_1_CPutString("\r\n*I*\r\n");
 LED_4_Switch(0x00);
    a=0;
    rpt:    
    if(UART_1_bReadRxStatus() & UART_1_RX_COMPLETE )
    {
            cUARTData1=UART_1_cReadChar();
             a++;
             LED_4_Switch(0x01);
            }
            if...

















0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You have got probably 30°C more than we have got here outdoors, so sometimes some more action is required to stay from freezing-in 😉

   

Do not get impatient when it takes an hour to get answered, this is a developer's forum and not a help-desk.

   

 

   

Bob

View solution in original post

0 Likes
9 Replies