PDA

View Full Version : Hserin baudrate select



RFsolution
- 11th January 2009, 17:15
Hi

I would like to select between 2 Hserout baudrate's at start up
by checking an input pin
It is not possible to use "Define Hserbaud xxxx" twice or in an if/then loop

Is it possible to select different baudrates after power-up ?

Thanks

Darrel Taylor
- 11th January 2009, 22:07
Hi Walter,

You can't change DEFINEs in mid-stream.

But you can change the SPBRG register anytime you want.
Although it's best to turn the module off before doing so.
<br>

RFsolution
- 12th January 2009, 18:53
Thanks Darrel

I found a nice value calculator from Mister E
How can i stop and start the module ?

mackrackit
- 12th January 2009, 19:50
See the last two post in this thread
http://www.picbasic.co.uk/forum/showthread.php?t=10265

Darrel Taylor
- 12th January 2009, 19:55
With RCSTA.

RCSTA = 0
SPBRG = NewBaudRate
RCSTA = $90