Software UART - receiving character string

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Software UART - receiving character string

826 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by michal89 on Thu Aug 02 08:12:27 MST 2012
Hello!
How to receive character string using software UART? I have written this:
char char_array[]="abcdeghjk";
for ( i = 0; i < 9; i++ )
                 {
        while(!(char_array = swu_rx_chr()));
                  }
But the array is filled with only the first character for example when I send 123456789 all the array fills with 1. Where is my mistake?
I am using code from AN10955 application note.
0 Kudos
Reply
1 Reply

764 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhatter on Thu Aug 02 16:37:51 MST 2012
The comment on the function you're calling says this:

/******************************************************************************
** Function name:swu_rx_chr
**
** Descriptions:
**
** This routine reads a single character from the software UART rx FIFO.
** If no new data is available, it returns the last one read;
** The framing error indicator is updated, too.
**
** parameters:None
** Returned value:char
**
******************************************************************************/

Take a better look at the test_lpc_swu.c to see how it works.
0 Kudos
Reply