Hi Ryan,
That 38.1Hz tells me that your interrupt rate is 76.2(939)Hz, which is exactly what you get when you have 16bit timer free-running at 5MHz. (20Mhz / 4 / 2^16).I fixed ADCON1 (= 7) and TRISB to output on B.3 and now I have a pulse! The only problem is that it seems to be 38.1Hz
On the 16F648 TMR0 is 8 bits wide with an 8bit prescaler shared with the WDT....
On the 18F2320 TMR0 is configurable to be either 8 bit OR 16 bit wide with its own dedicated 8 bit prescaler.
Going by your description alone and not seeing the actual code my guess is you've got the timer configured in 16 bit mode. That'll work too but the code needs to be changed to use the full 16 bit timer instead of the 8bit timer AND 8bit prescaler of the 16F648.
Yes exactly. In the original code where we had a 8 bit timer, "restarting" the timer at value of 94 each interrupt (which isn't REALLY what happens but it's easier to understand) will cause it to overflow in 162 ticks (256-94) instead 256 ticks. With a a 16bit timer running at 5MHz, "restarting" the timer at 94 to in the ISR will only change the interrupt rate by approximately 0.11Hz which is probably why you think you don't see it change.Not knowing what "TMR0 = TMR0 + 94" for me is doing exactly (maybe preloading timer 0 so it overflows earlier or something?) and it has a nice integer there to play with, I changed it to various things, but no difference in the 38.1Hz.
/Henrik.
Bookmarks