2 Replies Latest reply on May 16, 2013 12:47 AM by userc_2167

    Receive byte from UART







      I try to communicate 943362WCD4 with other devices through UART.



      Ive seen uart.c application  wiced_uart_receive_bytes(...) function is used for receiving data via UART. Its used in a while loop. Does WICED have a structure that generates interrupt if data received by UART ?



      Or should I use wiced_uart_receive_bytes(...) as a thread in a while loop ? If you have another suggestion, please inform me.



      Best Regards,




        • 1. Re: Receive byte from UART
          Please look at the Apps/snip/uart application.


          This provides an example of how to interface with the UART
          • 2. Re: Receive byte from UART
            I had investigated uart app before i opened this thread. It seems OK, I can use the same structure for UART communication. But we are trying to integrate BCM943362 to our devices and our devices already have a communication structure. In this structure interrupt makes our process easier.



            All my concern is that if there is a structure generates interrupt according to received data via UART.



            Thanks for support.
            • 3. Re: Receive byte from UART
              wiced_uart_receive_bytes() does not poll. if you set up the UART using ring buffer just like how its done in snip/uart.c, the API waits on a semaphore until the specified number of bytes have been received; otherwise, a timeout occurs. The DMA is responsible for pushing/ pulling data in/out of the UART registers.



              If you dont want your main application thread to block on wiced_uart_receive_bytes(), you can create a daemon with small stack size to wait on wiced_uart_receive_bytes(). Once the specified number of bytes have been received, you can notify your application thread using a semaphore or a queue message.