Crap, and I had checked my work too. Getting old...
Steve's utility gave this (real cool, can check calculations instantly, saves me from typing that into an Excel sheet):
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 10 ' 115200 Bauds
I'm not a fan of all-encompassing hex values like that, I like to know what is happening. Is there a significant difference in performance if I set the bits manually like this?
DEFINE HSER_SPBRG 10 ' 115200 Bauds
RCSTA.7 = 1 ' SPEN Serial port enable
RCSTA.4 = 1 ' CREN Continuous receive enable
TXSTA.5 = 1 ' TXEN Transmit enable
TXSTA.4 = 0 ' SYNC Asynchronous communication
TXSTA.2 = 1 ' BRGH High speed baud rate
I like comments, it helps make up for a miserable memory. I can toggle stuff ON and OFF easily that way. I usually ignore default values, but I make exceptions for important and relevant settings like SYNC in the example above.
Robert
![]()
Bookmarks