I'm having a bit of trouble converting the EZCLOCK1 code to a 18F2620.
http://www.picbasic.co.uk/forum/showthread.php?t=2129
Looking at the 18F2620 datasheet that would be changed to T0CON = %11000111 for prescale 256 and 8 bit timer enabled? INTCON=0 should stay the same.Code:OPTION_REG=%00000111 'weak pullups on, TMRO prescale = 256 INTCON=0 'interrupts off
Now here is what starts to confuse me. I'm not sure about TMR0 and the overflow flag is now called TMR0IF.Code:TMR0=0 'Reset TMRO INTCON.2= 0 'Clear TMRO overflow flag
At this point how is the timer being enabled? The code works fine with a few minor changes on a 16F876A but this my first encounter with the 18F series. Any comments?Code:Main: ClockLoop: IF INTCON.2=0 THEN ClockLoop ' Wait for TMRO overflow INTCON.2=0 'Clear TMRO overflow flag
Adam





Bookmarks