Hardware EUSART 08M2 Polarity

bpowell

Senior Member
Hello All,

Is it possible to change the output polarity of the hardware EUSART? (hserout)

I don't see how it's possible via the datasheet of the PIC, but I'm new to reading these datasheets, so I may be missing something obvious...

I'm know I could set up serial-out on any pin using a software-based serial port...but I wanted to know if it was possible to utilize the serial hardware but with an "idle low" polarity.

Thanks!
 

lbenson

Senior Member
Are you talking about something different from what you get with bits 1 and 2 of the mode byte in hsersetup? (Oops--"not M2 parts".)
 

nick12ab

Senior Member
Inverting the polarity is not possible on the PICAXE-08M2.
Code:
hsersetup 416,%00100
                    ^

Error: Invert hserin pin (bit2 = 1) not supported by this chip!
So you're stuck with 'idle high' polarity and you have to use an external inverter, unless you can use serout instead.
 

bpowell

Senior Member
Are you talking about something different from what you get with bits 1 and 2 of the mode byte in hsersetup? (Oops--"not M2 parts".)
I don't see the "Not M2 Parts" limitation in the manual (except for the automatic background receive).

However, I don't see how the 08M2 chip itself can reverse the transmit polarity.
 

bpowell

Senior Member
Inverting the polarity is not possible on the PICAXE-08M2.
Code:
hsersetup 416,%00100
                    ^

Error: Invert hserin pin (bit2 = 1) not supported by this chip!

Thanks Nick; that's what I thought...but wanted to make sure I wasn't missing something obvious.
 

hippy

Ex-Staff (retired)
Error: Invert hserin pin (bit2 = 1) not supported by this chip!
Note that bit 2 and the associated error applies to 'hserin' pin not the 'hserout' pin. Bit 1 controls output polarity when that's available.

Unfortunately the PICmicro range does not have uniform handling of EUSART polarity; on some chips there are no polarity inversions, on some only TX can be inverted, on others both RX and TX can be inverted. The 08M2 only allows the TX to be inverted, which seems to be what bpowell wants in the opening post.

Manual 2 seemed to be pretty clear on what polarity options are available and what High-Speed Serial options are not supported on the M2 but the PICmicro datasheet section on polarity inversion isn't always immediately obvious; it is controlled by bit SCKP in the BAUDCON register on the 08M2.
 

bpowell

Senior Member
Thanks Hippy! I'm digging my way (slowly) through the data sheets...it's not always easy! To top it off, I was a revision behind which further threw me off...I'm getting it all figured out.

Thanks again for your help!
 
Top