sameh4
Posts: 40
Joined: Wed Nov 29, 2017 6:58 pm

Setting AUX_MU_LCR_REG for mini UART to 8 bit mode

Fri Dec 08, 2017 1:44 am

I have seen several examples where they set AUX_MU_LCR_REG to the integer number 3.

The peripherals manual has the following about that register:
The AUX_MU_LCR_REG register controls the line data format and gives access to the baudrate register

5:1
Reserved, write zero, read as don’t care
Some of these bits have functions in a 16550
compatible UART but are ignored here

0 data size If clear the UART works in 7-bit mode
If set the UART works in 8-bit mode
So why not just set this register to the integer 1?

dwelch67
Posts: 930
Joined: Sat May 26, 2012 5:32 pm

Re: Setting AUX_MU_LCR_REG for mini UART to 8 bit mode

Fri Dec 08, 2017 9:42 pm

If you are reading what I think you are reading is because the manual was wrong, took me a couple of hours as I didnt have a scope at the time.

the pinned topic for baremetal has resources, in there there should be an errata thing on an elinux wiki page, this among many other bugs in the broadcom document are listed.

or you can just try it with a scope and see what happens.

sameh4
Posts: 40
Joined: Wed Nov 29, 2017 6:58 pm

Re: Setting AUX_MU_LCR_REG for mini UART to 8 bit mode

Fri Dec 08, 2017 11:20 pm

@Dave

I was reading the Broadcom Peripherals manual. I think it is time to start to try out many of these things. I followed your lead and I am trying to put together some tutorials that are Pi Zero and Pi3 specific. My thinking is that I don't truly understand it unless I can explain it.

For right not it's just some code for me to try things out in a way I can understand.

There's no explanation yet in these tutorials. Hopefully coming soon.

https://github.com/RazazRobotics/XiaoPi ... hello-uart

LdB
Posts: 755
Joined: Wed Dec 07, 2016 2:29 pm

Re: Setting AUX_MU_LCR_REG for mini UART to 8 bit mode

Sat Dec 09, 2017 9:35 am

The UART is an emulation of the old 16550 so if that did have two bits it would set 5 and 6 bit mode

11 = 8 bit
10 = 7 bit
01 = 6 bit
00 = 5 bit

That is what it does on a 16550
http://www.ti.com/lit/ds/symlink/pc16550d.pdf

Page 17 reference 8.6.2

Return to “Bare metal, Assembly language”

Who is online

Users browsing this forum: No registered users and 7 guests