3 Replies Latest reply on Aug 8, 2017 1:46 PM by e.pratt_1639216

    Simple SCB UART RX Interrupt

    ted_1467596

      I have a project running on a CYBLE-222014-01 module with SCB_1 set up for use as UART and I'm sending serial data via an FTDI USB chip to my PC using TeraTerm as the terminal.  I've been sending all kinds of data out to the PC with no issues but I wanted to have my PRoC module read and react to serial data coming to it from the PC terminal.

         

      I selected the Internal Interrupt radio button under advanced and then saw there was a file called SCB_1_SCB_IRQ.c with a section marked

         

          /*  Place your Interrupt code here. */
          /* `#START SCB_1_SCB_IRQ_Interrupt` */

         

      So I added my code of

         

              SCB_1_IRQtriggered = 1;

         

      to set my own flag and then picked up that flag in the main.c loop and, if it's set I wanted to send out the character just received...

         

             if (SCB_1_IRQtriggered == 1) {
                  tempTed = SCB_1_UartGetByte();
                  SCB_1_UartPutChar(tempTed);
                  SCB_1_UartPutCRLF(0x20);
                  SCB_1_IRQtriggered = 0;
              }
       

         

      But, my code runs until I press a key in TeraTerm to send to the PRoC module and then the program locks/gets stuck in a doom loop - I think it's getting stuck in the IRQ Interrupt - I'm unable to run in debug mode due to the lack of pins.

         

      Maybe I need to clear the interrupt that caused the IRQ but I can't find a function that does that.

         

      One oddity is that, in the SCB Advanced tab, I selected the box for the interrupt source "RX FIFO not empty" but every time I come back to the dialog box after I make that selection, the box is unchecked???

         

      Any advice on how to approach this task is much appreciated.

         

      Ted