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.

Sending higher nibble via UART

Mtech1

Junior Member level 1
Joined
Mar 18, 2023
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
164
I'd like to understand the concepts. How can we send the higher nibble in a byte via UART when it's configured for 4N1 with a baud rate of 9600?

For example: When we shift the byte 10100010 right by 4 bits (>> 4), we indeed get 00001010. However, this result is still one byte. In UART communication with 4N1 configuration, each data frame consists of one start bit, four data bits, no parity bit, and one stop bit. So, the 00001010 we obtained is still one complete byte within this configuration.
 
I'm not sure I understand this question. Presumably your controller has an 8-bit bus but you only have four bits connected to the UART. Assuming you can configure the UART with only four bits, all you have to do is align the bits in your 8-bit byte with whichever bits are connected to the UART and send them. If you have to send the other four bits, shift them as you already suggested and repeat.

The framing and parity bits are in addition to the data bits. For example an 8N1 configuration is actually ten bits, start bit - 8 data bits - stop bit. So 4N1 would be six bits long when the framing bits are added.

Brian.
 
Hi,

Never heard of 4N1.
While theoretically possible ... it surely is not standard, and thus most UART do not support this.
(I don't know a signle UART that supports 4N1)

I also don't understand why 4N1 should result in a full byte. It stiil is just 4 data bits plus 2 control bits.
Now it depends on the UART's microcontroller interface ... but this is independent of UART setup.

Klaus
 
I did mistake I should ask

"How can we transfer only five bits via UART in a program when UART supports a range of five to nine bits between the start and stop bits"
 
If the pattern xN1 is not available on the built in UART peripheral, and if it is stricly required, e.g to improve speed (?), consider doing your own Softserial. Anyway, why not just using a regular one and neglet the remainer bits on the receiver side ?
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top