Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why does EUSART in PIC have 9 bits when ASCII needs no more than 8?

Status
Not open for further replies.

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
593
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,681
I am reading the datasheet of a PIC18F with a EUSART. It has an optional 9th bit that be used in receiver and transmitter.

ASCII characters fit in 7 bits and a byte is 8 bits. Why then would someone want to transmit 9 bits? It this was 16 bits it would make sense but 9 bits makes no sense at all.

The hardware does not have any ability to calculate parity bit and place it at bit 9, that has to be done by the firmware. If this was an automated optional parity bit that would have made sense.

The datasheet does say that the 9th bit in the SFR TXSTAx and SFR RCSTAx "can be an address/data bit or a parity bit and must be calculated by user firmware".

While the parity bit that can be manually implemented makes sense, the data bit part does not since usually data is aligned to byte boundaries and since serial communication does not use address, I am not even sure what it means when it says "address bit"
 

Hi,

* some protocols use the 9th bit for address/data select.
* some protocols use the 9th bit as partity bit. (or to manipulate the parity bit)
???

Google finds a lot of "9 bit uart protcol" information.


Klaus
 

For Example Modbus have option of 9 bits data
 
  • Like
Reactions: Alloy

    Alloy

    Points: 2
    Helpful Answer Positive Rating
Thanks for the answers, I have previously used the serial port for communication between PIC and PC. That is why I assumed that only ASCII characters are communicated (printf remember?). Anyway, I understand that there are other things that the humble serial port is used for as well.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top