PDA

View Full Version : 16F88 Serial Out



rwskinner
- 27th February 2006, 17:24
Previously, I was using Portb.1 and Portb.2 for my RS232 Serin and Serout commands. To to be able to use a boot loader in the future, I had to change them to use the USART TX and RX pins.

I continue to use the normal SerIn and SerOut routines like before, but I started picking up a few errors here and there (4 - 10 errors per 1000 messages), which previously I did not encounter prior to changing the pin assignment.

I do not require interrupts for my serial routines, so can I still use the standard USART ports like I am for SerIn and SerOut?

I'm just curious to why it was error free before, and now I see errors, although they aren't a tremendous amount, still concerned.

Richard

DynamoBen
- 27th February 2006, 22:06
Not sure about the errors but yes you can basically use HSERIN and HSEROUT instead of what you're doing now.

You will need to setup the baud rate and what not at the top of the program but from there it's pretty easy.

I do this type of thing often.

rwskinner
- 28th February 2006, 03:21
When setting up / using the HSerIn / HSerOut, can the baud rates be changed on the fly?

Currently, I support 4 different rates, by looking at some jumpers during the start of the program.

Looks like the Defines for the USART set this up at compile time. I'm sure there is a way to override it?

DynamoBen
- 28th February 2006, 03:42
I haven't every done that, so I'm not sure.

Dave
- 28th February 2006, 11:53
rwskinner, Yes they can, just set the SPBRG register with the appropriate calculated baud rate and all is well.

Dave Purola,
N8NTA

rwskinner
- 28th February 2006, 19:28
Thanks Dave