Thanks to the members on here my project has been working well for over a year.
But now I need to enhance it and move to using a ring buffer to receive the incomming data and
some sort of interrupt driven routine as i need more time for code execution and can't afford to wait
for the data.
So I need to work directly with the USART hardware and use darell's interrupts.
I have been reading up on here but i'm pretty confused.
So if i explain what is happening then perhaps members can chip in with some more advice.
My application (16F88 chip running at 8mhz) has to receive data on a 9600, 8,E,1 in 12 byte packets on the USART RX Line,manipulate the data if reqd and then squirt if back out of the USART TX port on a different Line in same format.
I have no control over the incomming data and the packets have about 15ms between them.
The bytes in the packets are back to back no gaps.
I have been receiving the packets using hserin and then squrting them back out via hserout, but this
only leaves a couple of ms before next packet is arriving.No time to do anything especially when
i am trying to use the debug command on another pin to send some data to an LCD.
I can't really afford to drop packets so any advice appreciated.
I understand the USART has a two byte RX/TX buffer. Can it RX & TX at the same time?
Any simple examples of a ring buffer doing USART RX and TX as described?
Bookmarks