1 2 Previous Next 20 Replies Latest reply on Dec 5, 2012 6:23 AM by userc_40924




       today i tried to read a 12 byte data with an UART component of Psoc3, for this i kept the settings of UART in RX mode as 


      9600 Bits per second (kept with reference to my RFID reader, which is the source for 12 byte data).


      Data bits:8, 


      Parity type:None,


      Stop bits:1


      Flow control: None,


      Clock Selection :Internal clock,


      RX Address configuration: 


                      Adress mode: None,


      Advanced features:


                     Break signal bits: None,


                     Enable 2 out of 3 voting per bit, and disabled CRC outputs.


      RX Buffer sizes:12 bytes,


       Oversampling rate: 8X


      and i have chosen an isr_1 component...


      The basic problem what i am facing is, i have written an ISR in such a way that whenever my RFID reader (whose TX-OUT pin connected as RX pin of UART) detects the data, the control will transfer to ISR from main program and remains in ISR till it completes the reading of 12 bytes of data......


      when it completes the reading of 12 bytes of data..the control is expected to return to main program..........till now everything is fine.....


      but, when the control comes back to main program, it is expected to remain in the main program  till  the next interrupt occurs..... but, eventhough the control is properly coming back to main program, it is immediatly swithing over to ISR and remains there....


      if i disable the ISR interupt, when my ISR routine is executing....after completion of ISR execution control coming back to main program and remains there...but it is not accepting the further interrupts...(as I disabled it).


      If i re-enable the interrupt in my main program, the control is not remaining in main program, it is moving to ISR and stuck at one point as commented in the below code......




      --------------------/* This is the part of main program which i am having problem*/--------------------------------------








         // isr_1_Enable();
















      -----------------------/* This is my ISR */-----------------------------------------------------------------------------------------------








          /*  Place your Interrupt code here. */


          /* `#START isr_1_Interrupt` */


      /* Check the UART status */


       /* Check the UART status */








      /*---- This is where my control stuck when i uncomment    // isr_1_Enable();     in main program. ----*/






             ch = UART_1_GetChar();


       //      /* If byte received */


        if(ch > 0)












      /* Finally 'text' contains my received data, so that i can use it for further analysis */




      /* `#END` */




          /* PSoC3 ES1, ES2 RTC ISR PATCH  */ 




              #if((CYDEV_CHIP_REVISION_USED <= CYDEV_CHIP_REVISION_3A_ES2) && (isr_1__ES2_PATCH ))      












      Here i am beleiving that, once my RFID reader receives the 12 byte data, interrupt become enabled and the control moves in to ISR...whenever, it completes the execution of ISR it moves back to main program....but still the interrupt (which became active due to previous read of RFID data) is in active state, therefore it is immediately moving to ISR without staing in the main program....because of not having 12 byte data second time it goes....it remains stucked at that poit....


      now, can any one help me how to make my code, to remain the control in the main program itself (when it comes back from ISR) untill the next interrupt comes..




      NOTE: Here iam attaching a ZIP file...you can go through it.

        1 2 Previous Next