If I send multiple character strings then everything is ok up to a point. When the number of characters is greater than a certain point the program then only ever echoes the last character it correctly accepted even if I send a completely different character, even at a slow rate.
Code: Select all
if(uart2_Data_Ready()){
//get character
ASCII_char=uart2_Read_Char();
//echo data
uart2_write_char(ASCII_char);
//display recieved characters
WriteChar(10,10,ASCII_char,0xff,0x00);
}
WriteChar is my own function that sends the character to an SPI display.
example data sequence data:
13/10/2009 16:37:37.29 [TX] - A
13/10/2009 16:37:37.29 [RX] - A
13/10/2009 16:37:38.29 [TX] - A
13/10/2009 16:37:38.29 [RX] - A
13/10/2009 16:37:39.31 [TX] - A
13/10/2009 16:37:39.31 [RX] - A
13/10/2009 16:38:00.25 [TX] - qwer
13/10/2009 16:38:00.25 [RX] - qwer
13/10/2009 16:38:01.26 [TX] - qwer
13/10/2009 16:38:01.26 [RX] - qwer
13/10/2009 16:38:02.28 [TX] - qwer
13/10/2009 16:38:02.28 [RX] - qwer
13/10/2009 16:38:42.82 [TX] - yuiop
13/10/2009 16:38:42.85 [RX] - yuiop
13/10/2009 16:38:43.82 [TX] - yuiop
13/10/2009 16:38:43.82 [RX] - yuiop
13/10/2009 16:38:44.84 [TX] - yuiop
13/10/2009 16:38:44.84 [RX] - yuiop
13/10/2009 16:39:12.75 [TX] - 1234567890
13/10/2009 16:39:12.75 [RX] - 1234567777
13/10/2009 16:39:12.85 [TX] - 1234567890
13/10/2009 16:39:12.85 [RX] - 7777777777
13/10/2009 16:39:12.96 [TX] - 1234567890
13/10/2009 16:39:12.96 [RX] - 7777777777
13/10/2009 16:40:14.15 [TX] - qwer
13/10/2009 16:40:14.15 [RX] - 7777
13/10/2009 16:40:15.15 [TX] - qwer
13/10/2009 16:40:15.15 [RX] - 7777
13/10/2009 16:40:16.17 [TX] - qwer
13/10/2009 16:40:16.17 [RX] - 7777
from when the 7's first start to repeat whatever is sent to the system is displayed as 7 and echoed as 7.
Could this be a problem with the 4 byte buffer on the dspic33FJ256GP710 processor?
Is there a work around?