How to change baud rate with HSEROUT?
I'm using HSEROUT to send data to Hyperterminal from a 12F1822 running at 16 mhz. It works fine with these parameters from the PBP3 Manual:
'Define hserout parameters
define hser_txsta 20h
define hser_baud 2400
define hser_spbrg 25
define hser_spbrgh 0
If I overwrite 2400 baud to anything else,e.g.,4800 or 9600, the circuit continues to transmit at 2400 baud. Why is this? Is 2400 a fixed baud rate for HSEROUT?
Re: How to change baud rate with HSEROUT?
Dick,
First, the defines need to be uppercase.
define HSER_BAUD 4800.
Otherwise PBP will use the default value of 2400.
You also have conflicting defines.
define hser_baud 2400
define hser_spbrg 25
Those both specify the baud rate.
Choose one or the other.
I would recommend getting mister-e's PicMultiCalc. http://www.picbasic.co.uk/forum/cont....-PICMultiCalc
Let it do the hard work for you.
Re: How to change baud rate with HSEROUT?
Darrel,
Thanks,.... looks like I had MCSX's Editor Options highlighter set for "lower case" by mistake .... fixed now.
HSEROUT now working at 9600 baud with these defines:
'Define hserout parameters
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
Dick