Hello again guys....
I am reading data from the serial port and display them to an lcd module.
What is the proper way of reading everything from the serial port buffer?
I have searched the forum and only thing i could find was a topic from flowcode 3 where BenJ had updated the ecxample of rs232 to use an interrrupt.
To be honest i could not find that implemented in flowcode 3 or 5 examples.
So i know i am missing a lot of characters compared to the ones i should receive.
How am i supposed to do the reading from the serial port?
Thank you for your time!
RS232 Correct way of reading data from usart
Moderator: Benj
-
- Posts: 32
- Joined: Thu Nov 15, 2012 7:21 am
- Has thanked: 7 times
- Been thanked: 7 times
- Contact:
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: RS232 Correct way of reading data from usart
If you use RXINT, every time receive any character in the buffer interrupt will trigger and you can read that character. PIC can easily be involved in doing other stuffs. That's is much reliable than just wait and read if PIC is doing something else in the loop as well. I can post example code if you want for RXINT. BTW, which PIC you are using..bcz there are some problem in RXINT in couple of PIC and Ben posted a fix for that but I don't think you have noticed that.
-
- Posts: 32
- Joined: Thu Nov 15, 2012 7:21 am
- Has thanked: 7 times
- Been thanked: 7 times
- Contact:
Re: RS232 Correct way of reading data from usart
Hey Enamul,
I am using 16F877.
Yes an example would be very good i think.
Actually i want when i receive from serial the
"Would you like to activate duplex? [yes/no] :"
to light a led.
But i always am able to read some of it...
I am using 16F877.
Yes an example would be very good i think.
Actually i want when i receive from serial the
"Would you like to activate duplex? [yes/no] :"
to light a led.
But i always am able to read some of it...