This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sitara AM3359 CIR problem

the Ir_led_tx is connected to pin name uart0_rtsn , this pin on mode 1 becomes uart4_txd , so i have done the pin mux , added the uart4_txd in mux33xx.c file etc etc..

Now when I boot the board , and stop it at u-boot prompt  , the Ir_led is high (  its emitting something to which i have no idea ) . I have checked the u-boot code they have enabled the UART 0 , but only Rx and Tx , and the pin which i use is UART0_RTSN . if they have not enabled it in u-boot , how come the LED is emitting .

So in board-am335xevm.c file I configure the pin as uart4_txd in mode1 and in mode 7 it is gpio1_9, if i'm configuring it as gpio then I'm able to set value using gpio_set_value() function , which can turn on and off the LED , but I want the same function in UART4_Tx mode.

I configured it in UART4_TXd and as an output pin , I have tried all possible combinations like  ( let's take it for now that by default the pin is high  that's why the LED is glowing) 

1.AM33XX_PIN_OUTPUT
2.AM33XX_PIN_INPUT_PULLDOWN ( after configuring it as INput )

etc defined in mux.h header file .

 what can be the possible problem for the uart to show this kind of behaviour. , why does not it turns off when I enable it as OUTPUT pin .



  • Hi Zubraj,
     
    UART0_RTSn reset release state, as stated in AM355X Datasheet Table 2-7 is H : High-impedance with an active pullup resistor. If you want it to be low at reset release time you have to add an external pulldown resistor. Value should be such, that it can overcome the default pullup (e.g. 1-2kOhm).
     
    Best Regards
    Biser

  • ok on reset if it is high , how can  i make it low from the software side.  When i use it as a gpio i' m able to control the low or high state  by using gpio_set_value(), I mean i can make the pin low , but when i configure it as UART it fails to make it low  , even if i try to make it low. i don't know why .

    1. How can i make the default UART pin high low in UART mode

    2. Whether setting the direction ( input or output ) of the pin affects the state of the pin .( high or low )

  • 1. By writing the BREAK_EN bit in the LCR register to 1 you can drive the TX line low.
    2. If the pin is configured in UART mode direction can not be set. TX is output always.

    .

  • So for writing onto the UART4_txd/ sending IR data ,  i need to first configure the MDR1 register for setting the UART in CIR mode , now once I'm done with that i will make it low by writng  '1' onto the BRK_EN bit onto LCR register . After this I need to send the data in 36 Khz so i have written the data onto CFPS register (  this was not defined  , i have defined it in serial_reg.h , hope it is okay ) , and setting the T period by writing onto DLL / DLH registers , after this I have to write onto fifo REGISTERS , TX   now,

    1>there's a generic driver for omap-serial.c ( generic serial port )

    http://pastebin.com/AcXB9RxY 

    2> the header file where evrything is defined

    http://pastebin.com/gBcdzEh1

    so for writing onto UART I'm using a function like  

    serial_out(up, UART_TX, up->port.x_char)

     where UART_TX needs to be the transmit buffer , since i didn't see any fifo.thr buffer 

    1> How can i write something onto the UART buffer, cause in the omap-serial.c i didn't find any single function using FIFO.THR registers for writing data onto UART as specified in the document.

    2>can any register  be added in the serial_reg.h file, since CFPS register was not defined , i had to define it i guess i don't have to use any address  referneces for writin this register in serial_reg file

    3> Am I going wrong anywhere ? is my flow for implementing this driver  ok

  • the header file

    http://pastebin.com/gBcdzEh1