-->
Page 1 of 3

UART Register manipulation

PostPosted: Tue Nov 10, 2015 1:20 pm
by Rick
hello, is there a way to directly manipulate the pin level of TXD of UART?

Re: UART Register manipulation

PostPosted: Tue Nov 10, 2015 7:24 pm
by martinayotte
Could you explain exactly what is your goal ?
Because if, for example, you wish to send a "break" on the TX line, yes, you can switch momentarily the alternate function of this pin to GPIO mode, then setting the GPIO to LOW, and after awhile to HIGH and switch back the alternate to UART.

Re: UART Register manipulation

PostPosted: Fri Nov 13, 2015 12:00 pm
by Rick
Yes, I'm trying to implement a DMX transmitter. DMX Protocol states that 22 bits of LOW and 4 of HIGH have to be sent before channel information. I hadn't thought of using the multiplexing function for this. Thank you very much! :D

Re: UART Register manipulation

PostPosted: Fri Nov 13, 2015 12:07 pm
by martinayotte
Yes, that is what I though !
Simply look at this page wiki/doku.php?id=esp8266_gpio_pin_allocations for the pins alternate functions, and use the PIN_FUNC_SELECT() macros to temporarily switch the pin to plain GPIO.