4 Replies Latest reply on Jul 6, 2018 12:35 PM by scott_2272156

    Trouble with Interrupt only running first time through main routine

    scott_2272156

      I have not used a lot of interrupts in my limited C experience with PSoC.  I am am basically wanting to set a pin high before I send data out my UART.  I am getting it done with the code attached, but only the first time through routine. I have tried clearing interrupt but i do not seem to see this option in the API, or don't understand it properly.

       

      I will include a copy of my workspace'

       

      #include "project.h"

       

       

      CY_ISR( UART_done_Handeler)

      {

      Load_Write(0); // deactivate load pin when data completed

      }

      int main(void)

      {

       

       

          CyGlobalIntEnable; /* Enable global interrupts. */

       

       

      UART_done_Int_StartEx(UART_done_Handeler);

       

          UART_Start();

       

       

       

          for(;;)

          {

       

      Load_Write(1); // activate load pin prior to sending data

          UART_UartPutString("O"); // send data over UART @ 2000 bps

       

      Red_LED_Write(0); // turn RED LED on (active low)

      CyDelay(500); // delay 500mS

      Red_LED_Write(1); // turn off RED LED

      CyDelay(500); // delay 500mS

       

          }

      }