7 Replies Latest reply on Aug 22, 2016 9:19 PM by prasanth.velliyangiri

    UartRxTx

    prasanth.velliyangiri

      Hi...

      I am using this UART Setup and UART Messages Over Webpage  code in wiced sdk 2.4.0 , i want to receive hex-values  through uart and display the hex-value or equivalent decimal value in a webpage , when i tried to display i am not getting actual data.

      also i tried this  to display data on console-Teraterm

      {

      unsigned char test_data[16] = {0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9};

      wiced_uart_transmit_bytes( WICED_UART_1, test_data, sizeof(test_data));

      }

      same issue...Please help me...Thank you...

      Incorect_hex_data.png

        • 1. Re: UartRxTx
          dmiya

          Which UART1 or UART2 are you using?

          I think these all three need to be configured properly.

          - pin connection,

          - UART selection on source code,

          - and also UART setting on Tera Term.

          1 of 1 people found this helpful
          • 2. Re: UartRxTx
            prasanth.velliyangiri

            Thank you for your reply

            I am using Discover wifi sn8200 ,Wiced sdk 2.4.0

            other then hex data UART Setup and UART Messages Over Webpage  this UART code is working fine.

            My application is    Main_Application.png

             

            Working_Application.png

            1 of 1 people found this helpful
            • 3. Re: UartRxTx
              dmiya

              Below is my understanding. Is that correct?

              If yes, please check 4) first. If both 1) and 4) work, 3) should work.

              uart.png

              • 4. Re: UartRxTx
                prasanth.velliyangiri

                Hi

                Thank you for your reply.

                Actually 4-th condition is working but data is not proper..the webpage in the top is the data i am getting ...

                What i am missing ??

                • 5. Re: UartRxTx
                  prasanth.velliyangiri

                  Hi ,

                  In my Discover Wifi  sn8200 wifi board i have only one UART , and i have connected this to BLE master . Now BLE master sending data to UART of Discover sn8200 board . my web page shows nothing . how can i check whether my master data is properly received  in sn8200 ...

                   

                  my code will be like this...UART Setup and UART Messages Over Webpage

                   

                  while (wiced_uart_receive_bytes( WICED_UART_1, UartRxData, 20, 1000) == WICED_SUCCESS)

                      {

                      wiced_rtos_lock_mutex(&msg_fwd_mutex);

                      for (idx = 0 ; idx < sizeof(UartRxData); idx++)

                      {

                      SensorData[idx] = UartRxData[idx];

                      }

                   

                      wiced_uart_transmit_bytes( WICED_UART_1, SensorData,sizeof(ensorData));

                   

                    strcpy(rx_msgs[rx_end_index], (const char* )SensorData);

                    rx_end_index = (rx_end_index + 1) % HISTORY_LEN;

                    wiced_rtos_unlock_mutex(&msg_fwd_mutex);

                  }

                  Please help me to solve this

                  • 6. Re: UartRxTx
                    dmiya

                    Hi,
                    Sorry for my late response.
                    Let me ask a few things below.
                    1) Are you sending 20Bytes of data from BLE Master?
                    wiced_uart_receive_bytes() returns after UART received 20Bytes.
                    2) Are you sending ASCII data from BLE Master?
                    Data stored into rx_msgs[] should be ASCII characters.
                    If not, please convert it before saving.
                    3) Are you sending NUL character at the end of data?
                    The 20Byte data should be terminated by NUL (\0) charactor.

                    • 7. Re: UartRxTx
                      prasanth.velliyangiri

                      Thank you for your response, i will try as you suggest