3 Replies Latest reply on Sep 14, 2013 8:26 PM by userc_40792

    question on using capture interrupt to read count on Timer16 (CY3210)


      Hi --


      I'm working towards building a "reaction timer" application using the CY3210 eval kit w the 29466 device.


      As an precursor to the goal project, I've built a project to simply read the count on a Timer16 when an external pb switch is depressed and display that count on the LCD.  At this point - that's all I want to do.  Once I've got that working, then I know that I understand the capture interrupt capability of the device.


      The pb switch is connected between two resistors -- one of which goes to VCC, the other to ground. When the switch is not depressed (open), the output from this circuit- which is connected to P0_1 is 0V, when depressed the output is 5V.  P0_1 goes to the analog_column_mux to the input of a COMPA in the analog section.  The comparator_0 bus is then used as the capture input on the Timer16 module. 


      There's a "spin loop" in the project which is supposed to stop when the pb switch is pressed.  The Timer_Interrupt ISR is supposed to read the count and set a flag to stop the spin loop.  The count is to be displayed when the spin loop terminates.


      That's it "in theory".  In practice, however, when I push the switch, NOTHING HAPPENS.  The spin loop keeps merrily counting and the interrupt is (apparently) never generated.  


      I've attached the project in hopes that someone can find my error.