- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello all,
i have a big probleme with the Rx Buffer size in UART0, it can hold only 8 characters, i want to increase it untill 255 how can do it please? (i'm using Eclipse C++ downloaded from Intel website)
ISR interrupt works fine but 8 charachters is not enough...i tried with ring buffer but the the interrupt will be called every time the buffer (8 charachters) will be full.
If i just could increase this Buffer from 8 to 255 characters
Thank you very much in advance
Best regards
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Yacine85,
If I'm not mistaken, the Rx buffer size cannot be modified. I'd suggest you to use a second buffer created through software of the length you need and copy the value received in the Rx buffer to this one. This way, once you receive a new byte, the ISR will be executed. In the ISR, you have to add the new byte that was received in the Rx buffer to the software buffer in the next position, so you don't lose the previous data. Then, the buffer you read is the one you created, not the Rx buffer.
Hope this approach helps you.
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello Diego,
Thank you for your reply.
I'll appreciate, if you could suggest me for a subject or something.
I tried with ring buffer, i did not got it.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Yacine85,
I think it's not difficult what Diego suggested:
a) Have your own array of 255 characters, with your own character counter (initially 0, of course)
b) Each time the ISR is called, you transfer
ISR interrupt works fine but 8 charachters is not enough...i tried with ring buffer but the the interrupt will be called every time the buffer (8 charachters) will be full.
the 8 character/s that fill/s the input buffer to your own buffer, increasing your buffer character counter. Once you get the 256 characters, your buffer is full and you should process as you want/need to.
HTH,
Fernando.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you Fernando, i'll try it and will post my solution here for other members
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Yacine85,
You could also restart your counter to 0 once you reach the final position in your buffer in order to keep writing the incoming data from the Rx buffer. This is optional of course, but since you mentioned you tried setting a ring buffer, I though you would like to implement the buffer this way.
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You could also restart your counter to 0 once you reach the final position in your buffer in order to keep writing the incoming data from the Rx buffer. This is optional of course, but since you mentioned you tried setting a ring buffer, I though you would like to implement the buffer this way.
Hmm... for a ring buffer it is not necessarily enough to restart the counter, unless it is not a problem to lose data... Usually a ring buffer requires two pointers/indexes to avoid losing data...
Fernando.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page