After a long hiatus from PICs, I picked up a project recently that I am using a 12C509(A) for the first time. The project is simple - when powered on check a jumper - if jumper high send 4 characters through a bit bang serial port (9600,8,n,1), if jumper low send 2 characters through the bit bang serial port (9600,8,n,1). Then wait for the first returned character and verify if it is what was expected. All that works. As a visual indicator, I have a LED that flashes several times on power up, flashes once when sending data, and if the returned data is good it flashes several more times and the 12C509 goes to sleep. If the returned character is not valid, it turns on for a short period of time and goes out, and again the PIC goes to sleep. The problem I am having is that the flashing occurs at two different rates. The fast rate is 50ms per on/off cycle and the slow rate happens so in often I have not been able to clock it, but it is about 1s per on/off cycle. I am running an external 4.00 MHz oscillator. Here is the code for the loop general_delay_out mov delay_cntr,0ffh :loop_1 nop mov delay_inner, 0a0h :loop_2 djnz delay_inner, :loop_2 djnz delay_cntr, :loop_1 ret Thanks, David David V. Fansler s/v Annabelle dfansler@dv-fansler.com www.dv-fansler.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist