> Mike, > > As others have said, there is noting wrong with your concept as long as you > understand how it works. I did this once with a simple music program. A > timer was setup to interrupt the main loop. In the isr, the flag was > cleared and a jump to the main code was executed. It went on from there to > play the next note. The isr set the duration of the note. Yeah, the stack > continually wrapped - so what? This prevented me from needing to test end > conditions in the sound generating code. The code was extremely simple as > was the intended result. If it works for you, don't hesitate to do it. > > Good luck! > Tom This reminds me of a trick I once did on an 8008 (yep, the predecessor to the 8080!) to build a DDS synth. On this chip, when an interrupt occurred the processor would assert an interrupt-acknowledge signal and then execute whatever 1-byte opcode was found on the bus. Normally external hardware would jam in a 'RST' instruction, which was a one-byte call to one of 8 predefined locations. For this project, I jammed in a return instruction instead. This way, the synth could run without having to check for any exit conditions. This made a significant difference in the performance. Bob Ammerman RAm Systems (btw: this was in 1975 or 1976) -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads