After looking through the pbppic18.lib file I noticed that the problem was with the line HSER_TXSTA 24h. It should be HSER_TXSTA 20h.
After looking through the pbppic18.lib file I noticed that the problem was with the line HSER_TXSTA 24h. It should be HSER_TXSTA 20h.
mmm yes no toaster hamburger after all. I bet you use HSER_BAUD instead of HSER_SPBRG right?
IF SO it's probably caused by the internal calculation of the SPBRG value.
Wich BaudRate you wanted to use??? Did you look in the datasheet for the SPBRG value with the TXSTA you did???
I'm just curious about that one.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Just to satisfy your curiosity Mr E
Code:DEFINE HSER_BAUD 9600 DEFINE HSER_CLROERR 1 DEFINE HSER_RCSTA 90h DEFINE HSER_TXSTA 20h
HEHE i was right... I post a SPBRH Calc on this forum to help to figure out.
BTW here's a short explanation. Using the Calc @9600 baud with 40MHZ with TXSTA = $24 give a SPBRG of 255 with error % 1.725. If you decrease this value the error % increase, so increasing SPBRG will reduce the error %... as SPBRG is a Byte register, you can't or you'll be OUT OF RANGE
This is where it's coming fromWarning[202] c:\pbp\pbppic18.lib 7695: Argument out of range. Least significant bits used.
NOW using SPBRG=20 @40MHZ 9600 bauds gives a SPBRG=64 and error % 0.16
I'm Satisfied now![]()
Last edited by mister_e; - 14th September 2005 at 17:10.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Can you post a link to this Calc. This could come in handy in the future.
here's the link for the download... on this forum
http://www.picbasic.co.uk/forum/atta...tachmentid=316
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks