With 16 MHz the best error Percentage you'll get will be -0.79% witch is usually fair enough.
This assume you're aware that you MUST use the 16 bit baudrate generator for that.
Now to set it in C... it's your problem
In PicBasic Pro
Code:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_SPBRG 34 ' 115200 Baud @ 16MHz, -0.79%
SPBRGH = 0
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
My PicMultiCalc should help you a little bit
http://www.mister-e.org/pages/utilitiespag.html
Last edited by mister_e; - 30th September 2007 at 08:44.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks