In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Marcus, You are right. The pause values should be DIVIDED by 1.19 50MHz would probably be overkill. If it works at 4MHz all the less power you will need. The way I got 1.19 was that I used SX-Sim and it told me that the interrupt uses 8 clocks. So the interrupt is called every 50 clocks, so it uses 8 of every 50 clocks. So the main program get 42 of every 50 clocks. 50/42 = 1.19 If you want to be really accurate you would have a counter in the interrupt routine, then you could determine the exact number of 40KHz pulses you wanted the signal to be on/off. You would probably need a faster clock to do that. Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=116040#m116208 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)