Hi,
I think that RCREG can only "hold" 2 bytes.
If you don't retrieve your data before that 3rd byte comes along, you get an overrun or something. It probably just kicks the first byte it received "off the end".
![]()
Hi,
I think that RCREG can only "hold" 2 bytes.
If you don't retrieve your data before that 3rd byte comes along, you get an overrun or something. It probably just kicks the first byte it received "off the end".
![]()
---> picnaut
YUP! RCREG is a 2 byte buffer. This help to miss character.
You don't need to read always 2 bytes ... well yes and no. Just make a check if the RCREG is now empty will suffice.
and you just need to send 1 bytes at the time as TXREG is a single 1 byte register.
HTH
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Here is a couple attached demo programs that might help,written for the 16F877.Modify for you needs.One uses the on interrupt command and the other the interrupt flag.
Thank You all!
I was frustrated and a little weary but your suggestions were
timely and very helpful. My serial communications are working now.
Reading RCIF & RCREG appear much faster than HSERIN.
Thanks,
Mark
It's like many built-in function.
HSERIN/HSEROUT
HPWM
ADCIN
are some in the list. When you need for speed, the best way is still acess the internal register. It also produce tighter code. Built-in function are great when you don't want to break your nuts with data handling and ... and ... and.. well you know what i mean![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks