go_away

Author Topic: FIFO Tx Buffer, Lost Chars  (Read 1922 times)

0 Members and 1 Guest are viewing this topic.

Offline frank26080115Topic starter

  • Supreme Robot
  • *****
  • Posts: 322
  • Helpful? 2
FIFO Tx Buffer, Lost Chars
« on: February 23, 2008, 08:09:12 PM »
Here's the story, I've created my own FIFO buffer for Tx-ing data with UART, this makes sending a long string super efficent and fast.

But when I try sending out "Test12345\n\r", hyperterminal only shows "Tes134\n"

01234567890123456789012345678901234567890123456789
gives
012467913468913568013578023579

lets look for a pattern:


Code: [Select]
01234567890123456789012345678901234567890123456789
012 4 67 9 1 34 6 89 1 3 56 8 01 3 5 78 0 23 5 7 9

weird huh?, doesn't seem to be a pattern, but the \n is still detected, but not the \r
also it's the exact same missing characters every time.

I've checked my code over and over again, no idea why it's happening. baud rate is correct, 115200 baud. the buffer size is 100. shouldn't be overflowing, there is nothing else going on the microcontroller. i added a delay in between transmission but it didn't help. all global variables are declared volatile too and it didn't help. AVRstudio's simulator is usesless since it doesn't trigger interrupts

why the hell isn't it working? attached is all the code.


ok i forgot to enable interrupts... but now i have another weird problem
it's sending the first char, but the next few bytes are sent as binary 0... then it goes back to normal but still missing characters


Fixed, lesson learned: use SIG_USART_TRANS instead of SIG_USART_DATA. works like a charm now
« Last Edit: February 23, 2008, 08:36:38 PM by frank26080115 »

 


Get Your Ad Here