Tim McDonough asks: > I have another 16C54 question as well. Since the '54 doesn't have > an interrupt for the RTCC what's the usual procedure for running > a given section of code periodically, say every 100mS or so? Can > you run a tight loop waiting for the RTCC to roll over from some > calculated value or will this methos "miss" the rollover if you simply > test for it to be equal to zero? If you run the RTCC without the prescaler, you have to be tricky to sync up to it. It takes four instruction cycles (= 4 RTCC counts) to test the RTCC and loop, so what you do is read the RTCC, mask the low two bits, and use them for a computed delay to get in phase. Then you can test for zero and loop. The following code is a simplified excerpt from my PONG game. I haven't tested it after the simplification, but it might not work exactly as shown. The comments show the RTCC value as instructions are executed for four different entry conditions. As you can see, by the time the label tw1 is reached, the low two bits of the RTCC are always 00. movf rtcc,w ; f0 f1 f2 f3 andlw 03h ; f1 f2 f3 f4 addwf pcl ; f2 f3 f4 f5 nop ; f4 nop ; f5 f5 nop ; f6 f6 f6 nop ; f7 f7 f7 f7 tw1: movf rtcc,w ; f8 f8 f8 f8 btfss status,zf goto tw1 This obviously works especially well if you want to sync up the RTCC every 256 instruction cycles. If you need some other number, the simplest thing to do is to add a constant to the RTCC after syncing up. If you do so you have to consider that the RTCC doesn't increment for two (if memory serves) cycles after it is written, so add ((256 - desired_count) - 2). Cheers, Eric