Academic Program

Timer Peripheral

Timer Peripheral

Step 7 - Timer0 needs to be set up. Click on the TMR0 label under Project Resources to make the Timer0 setup appear.

tmr0.png
 
  1. Check the Enable Timer box and select the 1:256 prescaler selection from the drop-down menu.
  2. Click on Clock Source and select (FOSC/4). This will select the instruction clock as the clock input to the Timer0.
  3. Type '250' into the Period box and it will change to the exact value of 249.856 ms. This is the closest the setup can get to a 250 ms delay. This will set the Timer0 to overflow every 250 ms (249.856 ms approximately).

The window should look like the one below after the proper setup:

timer0.png