2 Replies Latest reply on Aug 11, 2016 2:26 PM by Jorge.ar

    Using UART to interface a GSM module

    Jorge.ar

      Hello!

       

      I'm starting to work with D2000 uC and I want to connect UART_A to a GSM module and send AT commands. I've done this with other uCs (Cortex-M0, AVR). I read everything I've found about UARTS in d2000 uC and I have some questions. I'm used to write my own tx/rx interrupts and work with a FIFO for tx and another for RX. I'm looking for the correct way to code my app using QMSI.

       

      For example, the "hello world" with a gsm module is to send AT and receive OK.

       

      The transmit part is easy: qm_uart_write_buffer(QM_UART_0, (uint8_t *)"AT\n\r",sizeof("AT\n\r"));

      After that command, the module takes some time to answer and send the OK string.

       

      1- the OK string will be available on the RX buffer or should I request a non-blocking IRQ RX transfer? I used to send and wait for a time-out, then analyze the RX buffer for the OK string. 

      2- if yes, how can I read the RX buffer directly ?

      3- if no, I need to setup a xfer, but in the xfer I need to specify the data lenght, but I don't always know the length of the data that I will receive.

       

      thank you,

       

      Jorge.