Do not use DEFINEs for the hardware ports, work the registers directly. Then use SERIN2/SEROUT2 as normal.
Do not use DEFINEs for the hardware ports, work the registers directly. Then use SERIN2/SEROUT2 as normal.
Dave
Always wear safety glasses while programming.
Thats ok, if i only chande BR, but what with parity?
From section 20.2 of the data sheet
The EUSART transmits and receives the LSb first. The
EUSART’s transmitter and receiver are functionally
independent but use the same data format and baud
rate. The Baud Rate Generator produces a clock, either
x16 or x64 of the bit shift rate, depending on the BRGH
and BRG16 bits (TXSTAx<2> and BAUDCONx<3>).
Parity is not supported by the hardware but can be
implemented in software and stored as the 9th data bit.
Dave
Always wear safety glasses while programming.
Yes I know that...
But I think you didn't understand me...
Let me try to explain again...
Let say that I use define ser2 9 bit, define parity even, and use that for 1. port. For 2. port to use HSERIN,
But then if user want to enable parity on 3. port there is problem...
If I use HSERIN2 I must put DEFINE HSER_BITS 9 that option should be enabled from PC.
So I can't just put If useparity=1 then define hser 9bits etc...
I was thinking if there is define ser2 9 bit, and use mode for 8 bit that it should send 8 bit, but it send 9 bit...
Look in the PBP manual to see how to use the second hardware port.I was thinking if there is define ser2 9 bit, and use mode for 8 bit that it should send 8 bit, but it send 9 bit...
Dave
Always wear safety glasses while programming.
Thank you.
Think I'll have something...
Bookmarks