I need to produce a 2MHz square wave on an output pin of a PIC16F876 running at 16MHz. I have written a program that seems to do the job (my PC scope shows the 2MHz square wave on PB0, but just in case I'm missing something here, I thought I would ask. My program takes advantage of the fact that, within any given memory page, the PC counter wraps around from the end of the page (PCL = 0xFF) to the beginning of the page (PCL = 0x00) if PCLATH is not incremented. Essentially, it's a "brute-force approach to the problem: page 1 is completely filled with 2048 "incf PORTB, F" instructons and a small setup routine in page 0 jumps to page 1. The output of RB0 appears to be a free-running 2MHz square wave on my scope, but I just want to be sure I'm not overlooking a small timing delay when the PC wraps around in page1. Any comments or suggestions are welcome! Thanks... Ron _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist