What I was trying to say in the other thread was ...
If you want 9 total bits (8 data + 1 parity) then the USART must be set for 9-bit operations.
That is done by setting TX9 (TXSTA.6) and RX9 (RCSTA.6) bits.
With your current settings, that would be ...
DEFINE HSER_RCSTA 0D0h
DEFINE HSER_TXSTA 64h
However, PBP will do that for you, if you let it.
But when you use these defines ...then you have specified what TXSTA and RCSTA values should be, and that overrides anything PBP will do.Code:DEFINE HSER_RCSTA 90H DEFINE HSER_TXSTA 24H 'HIGH SPEED MODE BAUD RATE GENERATOR
And 9-bit will not be enabled.
If you don't define TXSTA and RCSTA, then PBP will do it for you, and all you have to tell it is the baud rate, total bits and parity.
In your case ...hth,Code:DEFINE OSC 48 ; set oscilator speed to 48mHz DEFINE HSER_BAUD 38400 DEFINE HSER_BITS 9 DEFINE HSER_EVEN 1 DEFINE HSER_CLROERR 1 ; Clear overflow automatically




Bookmarks