Hello, I am clearly not understanding how something works, and would be grateful for any help.
I am decoding infrared remote control codes using the input capture mode of TIMER1 on an ATmega328P (UNO). This works successfully. Then I decided to buffer the codes received, so that should the MCU be busy, the codes be collected by the isr will still be available for when the MCU is ready. To test this, I have been using these three "busy" words : busy1 10 0 ?do $ffff 0 ?do noop loop loop ; : busy2 5000 0 ?do 1ms loop ; : busy3 5000 0 ?do pause 1ms loop ; With busy1, IR codes transmitted whilst the busy word is executing are correctly captured, decoded and buffered. With busy2 and busy3 they are not. Turning on a LED when the isr detects the start pulse, and turning it off when a complete code (or a repeat) has been received shows for the isr calls busy1 - entry and exit and valid code (always, it seems) busy2, busy3 - enters, but often seems to get stuck, the LED is not turned off (and the code buffered invalid) I am puzzled as to why it works with busy1, but not with busy2 and busy3. All clues gratefully received. Tristan ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel