ESP8266 Developer Zone The Official ESP8266 Forum 2018-02-01T08:19:20+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=9062 2018-02-01T08:19:20+08:00 2018-02-01T08:19:20+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19241#p19241 <![CDATA[Re: NONOS - Anyone have any sample code of receiving UART data]]>
Her Majesty wrote:
This document may help you https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf.


Ah that works!
Thanks. Give's me a good read.

Statistics: Posted by AgentSmithers — Thu Feb 01, 2018 8:19 am


]]>
2018-01-31T14:03:47+08:00 2018-01-31T14:03:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19232#p19232 <![CDATA[Re: NONOS - Anyone have any sample code of receiving UART data]]> https://www.espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf.

Statistics: Posted by Her Mary — Wed Jan 31, 2018 2:03 pm


]]>
2018-01-30T14:13:53+08:00 2018-01-30T14:13:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19221#p19221 <![CDATA[Re: NONOS - Anyone have any sample code of receiving UART data]]>
WRITE_PERI_REG(UART_CONF1(uart_no), ((0x01 & UART_RXFIFO_FULL_THRHD) << UART_RXFIFO_FULL_THRHD_S) | ((0x01 & UART_RX_FLOW_THRHD) << UART_RX_FLOW_THRHD_S) | UART_RX_FLOW_EN | (0x02 & UART_RX_TOUT_THRHD) << UART_RX_TOUT_THRHD_S | UART_RX_TOUT_EN);

Anyone have a link to the document for these flags? I don't see it in the Programming guide from Expressif.
Anyone know the line that adjust the parity on UART0?

EDIT:
I think i found the answer.
//WRITE_PERI_REG(UART_CONF0(uart_no), CALC_UARTMODE(UartDev.data_bits, UartDev.parity, UartDev.stop_bits));
WRITE_PERI_REG(UART_CONF0(uart_no), CALC_UARTMODE(UartDev.data_bits, NONE_BITS, UartDev.stop_bits));

So to see the current option set I assume I use GET_PERI_REG, as it stands using UartDev.data_bits set to the current value its set to with no changes correct?

Statistics: Posted by AgentSmithers — Tue Jan 30, 2018 2:13 pm


]]>
2018-01-30T13:53:24+08:00 2018-01-30T13:53:24+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19220#p19220 <![CDATA[Re: NONOS - Anyone have any sample code of receiving UART data]]>
I wrote this, However if I can write the 16 bytes before the WDT everything works great. As soon as I write one byte without the other 15 I get a WDT. Anyone know why? Like I need to clear the interrupt or something?

Code:

LOCAL void uart0_rx_intr_handler(void *para)
{
   char RcvChar[4];
    RcvMsgBuff *pRxBuff = (RcvMsgBuff *)para;

   if (UART_RXFIFO_FULL_INT_ST != (READ_PERI_REG(UART_INT_ST(UART0)) & UART_RXFIFO_FULL_INT_ST)) {
      return;
   }

   WRITE_PERI_REG(UART_INT_CLR(UART0), UART_RXFIFO_FULL_INT_CLR);

   while (READ_PERI_REG(UART_STATUS(UART0)) & (UART_RXFIFO_CNT << UART_RXFIFO_CNT_S))
   {
      ETS_UART_INTR_DISABLE();
      RcvChar[0] = READ_PERI_REG(UART_FIFO(UART0)) & 0xFF;      
      /* you can add your handle code below.*/
      gpio_output_set(0, (1 << 2), 0, 0);
      uart0_tx_buffer(RcvChar, 1);
       // Clear pending FIFO interrupts
      WRITE_PERI_REG(UART_INT_CLR(UART0), UART_RXFIFO_TOUT_INT_CLR | UART_RXFIFO_FULL_INT_ST);
      ETS_UART_INTR_ENABLE();
   }
}

Statistics: Posted by AgentSmithers — Tue Jan 30, 2018 1:53 pm


]]>
2018-01-26T00:25:41+08:00 2018-01-26T00:25:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19182#p19182 <![CDATA[Re: NONOS - Anyone have any sample code of receiving UART data]]>
Her Majesty wrote:
You should note that the code below will change your os_printf to output from UART1. Maybe your application mistakenly called it.

Code:

    // install uart1 putc callback
    os_install_putc1((void *)uart1_write_char);//print output at UART1



Thanks!
I don't recall seeing this line but I'll take a look. Much appreciate. Thank you for your prompt response.

Statistics: Posted by AgentSmithers — Fri Jan 26, 2018 12:25 am


]]>
2018-01-25T17:36:19+08:00 2018-01-25T17:36:19+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19178#p19178 <![CDATA[Re: NONOS - Anyone have any sample code of receiving UART data]]>

Code:

    // install uart1 putc callback
    os_install_putc1((void *)uart1_write_char);//print output at UART1

Statistics: Posted by Her Mary — Thu Jan 25, 2018 5:36 pm


]]>
2018-01-24T15:26:30+08:00 2018-01-24T15:26:30+08:00 https://bbs.espressif.com:443/viewtopic.php?t=9062&p=19169#p19169 <![CDATA[NONOS - Anyone have any sample code of receiving UART data]]> Also os_printf also appears to stop printing once I run uart_config. Any way to keep that functionality while using UART?
Thanks everyone!

Statistics: Posted by AgentSmithers — Wed Jan 24, 2018 3:26 pm


]]>