Today, I re-read previous suggestions and stopped to ponder this one: Wed, 13 Jul 2016 10:19:50 -0700, AK <00@case.edu>: For square wave generation I would use the PWM unit with 50% duty cycle= for lower frequencies, and the numerically controlled oscillator peripheral (NCO) for higher frequencies. You could even use a CLC to switch betwe= en them seamlessly. You don't want to waste time farting around with bit banging and instruction-bound delays. It takes a bit of reading and tes= ting to use one, but then the updates to frequency are fast and simple, and = you can spend processor cycles calculating the next update, servicing other routines, etc. Joe suggested sampling and storing the actual sweeps generated by Audacity,= timing 112 pulses in blocks. Sergey kindly put forth his C code involving = log(f), but it would probably take me longer to figure out how to convert t= hat to ASM than to use another approach. Denny offered several approaches,= the simplest seeming to be the use of look-up tables without the need for = interrupts (which is similar to Joe's suggesting of storing actual waveform= values). And then we have the above suggestion of using a combination of = PWM and NCO with CLC to switch between them. But why use the PWM module si= nce the NCO module can accommodate the entire frequency range of the sweep?= What is the advantage to using both PWM & NCO together? That would seem = to add to program complexity, especially when you factor the CLC setup requ= ired to switch between the two. More on the CLC here: http://ww1.microchip.com/downloads/en/DeviceDoc/41631B.pdf For now, I have an ASM program running on actual hardware that uses the NCO= and CWG to feed my H-BRIDGE and 8-ohm speaker with a duo-tone sequence of = 625Hz for 600ms followed by 825Hz for 600ms, repeating. You can see the co= mplete Assembly code for that here: https://cl.ly/1M3I3Y2L1421 It does not contain a sweep though. I wrote that code merely to verify my = NCO and CWG initialization routine works flawlessly. I verified the CWG out= put pins on a scope and also confirmed it by listening to the speaker. The = frequencies quite accurate, and my 1.5us of dead band is also correct as we= ll.=20 Honestly, creating the sweeps are the hardest part. Fixed tones are easy to= implement as you can see from my code. But since there are different ways= to implement sweeps on a 16MHz 16F1508 (from Joe's suggested sample-and-st= ore to using PWM+NCO), I am now mulling the absolute simplest approach that= still sounds acceptable to the ears. Once again, thank you for your kind help and input. James --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .