PDA

View Full Version : 16F877A serin problem with baud rate 19200



leemin
- 31st July 2005, 05:20
Hi every1,
dis is my 1 time posted my problem. i encounter a problem when using de comman serin. my program working fine with baud rate 9600,8,N,1 but i do not know how 2 change de baud rate to 19200. any1 can help me out. thank you very much

mister_e
- 31st July 2005, 10:45
As far as i'm aware of, SERIN will never work @19200 bauds :(

You must use HSERIN with the internal USART

@4mhz


DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 12 ' 19200 Bauds
DEFINE HSER_CLOERR 1

@8MHZ


DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 25 ' 19200 Bauds
DEFINE HSER_CLOERR 1

@20MHZ


DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 64 ' 19200 Bauds
DEFINE HSER_CLOERR 1


But there's an alternative that could work, see DEBUG in the PBP manual