Controlling UART RI Pin from u-boot

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Controlling UART RI Pin from u-boot

1,647 次查看
allenkll
Contributor III

Hello,

  I have a iMX512 processor booting with u-boot.  I get to the prompt and it seems okay.  From here I added a command to u-boot so that I can toggle UART1s Ring Indicator Pin.  However I am unable to see the pin change state on a scope.

In my command function I:

- Disable Uart 1 (via UCR1 bit 0)

- Set IOMUXC_SW_MUX_CTL_PAD_KEY_COL4 to ALT1 ( 0x01 )

- Set IOMUXC_SW_PAD_CTL_PAD_KEY_COL4 to open drain (0x01ED) (1k pullup on output)

- Re-enable Uart1

- read RI state (via UCR3, bit 9)

- write a new RI state

I also print out the values of the registers before I modify them (except while the UART is disabled).

The UCR3 register indicates that the write was successful, as the new value is correct but the pin doesn't change state.

I know the peripheral is engaged and working and the clocking to it is correct because that's the terminal I use for u-boot.

Am I missing something? Do I need to get the IO mux controller to latch in the changes somehow?

thanks,

-Allen

标签 (1)
标记 (3)
0 项奖励
回复
3 回复数

1,223 次查看
juangutierrez
NXP Employee
NXP Employee

Hi Allen

The Reference manual mentions that the RI output pin can be controlled by the bit 8 (not 9) at UCR3 but ONLY in DCE mode. Otherwise (In DTE mode) this setting/clearing this bit in UCR3 will enable/disable the status bit DCDDELT (USR2 (6)).

Maybe when writing to this pin the uart mode is DTE, so the output is not reflected.

Can you check what is the mode DCE/DTE you are working on?

Also you can check bit 9 at USR2 (RII):

Ring Indicator Input. This bit is used in DTE mode to reflect the status if the Ring Indicator input (RI). The Ring

Indicator input is used to indicate that a ring has occurred. In DCE mode this bit is always zero.

0 Ring Detected

1 No Ring Detected

1,223 次查看
allenkll
Contributor III

Thanks for the input.  This was not the cause, as DCE/DTE was set correctly. Also I was toggling bits 8 and 9 as I was also trying to get DCD working.  But I had not got to setting up the register for DCD yet.

I have it working now, and from what I can tell the only change I made was to change KEY_COL5 to work as DCD (ALT1), which I needed anyway, and suddenly RI and DCD started working correctly.

This may have not been the solution as I tried many things to get this to work, but to the best of my knowledge this change is the one I made before it started working.  I don't see why or how this is the case, but there it is.  Maybe there is some hidden logic that is in the chip that says, "well don't bother with RI if DCD is not setup ... its ridiculous that anyone would try to use RI without DCD..."

Thanks,

-Allen

0 项奖励
回复

1,223 次查看
juangutierrez
NXP Employee
NXP Employee

Yes it is kind of weird that is working after muxing in DCD pin, but is good to know that is working for you know

0 项奖励
回复