On Mon, 20 Jul 1998 09:04:53 +0100 "Rigby-Jones, Michael [PAI01:4837:EXCH]" writes: >Thanks to all who replied to my plea for help. > >No-one seemed to have a convincing answer as to why the code in AN512 >configured the timer 0 as a counter and then polled the TMR0 >regsister. Convincing answer: The AN was developed for a PIC16C5X. These PICs do not have the timer pin connected to the PORTA register. The only way to determine the state of that pin is to examine its effect on the timer. The 14-bit PICs have the pin connected to both the timer and to the PORTA register. The input signal passes through the same Schmitt-trigger buffer no matter which way you read it. > >I decided just to poll RA4 as a normal input, and (this bit of) my >code is >now working fine. The schmitt trigger is still used so I can't see >any >reason not to use this method, and it means timer 0 is free for other >purposes (as long as you don't want to use external clock) The reason to not use it is that with PIC16C5X's you can't. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]