SPBRG = 25 is 2400 baud @4MHZ, not 16MHz.
If you need 2400 baud @16Mhz you should try those settings
@9600 baudsCode:DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0 DEFINE HSER_SPBRG 103 ' 2400 Baud @ 16MHz, 0.17% DEFINE HSER_CLROERR 1 ' Clear overflow automatically
etc etc etc.Code:DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0 DEFINE HSER_SPBRG 25 ' 9600 Baud @ 16MHz, 0.16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Try my PICMultiCalc for that.
Download it from there
http://www.picbasic.co.uk/forum/atta...7&d=1225550328




Bookmarks