Its a PC cooling fan so I was expecting it to be sort of high. How do I set up one of the hardware timers as a counter? I've never done anything with them before.
Its a PC cooling fan so I was expecting it to be sort of high. How do I set up one of the hardware timers as a counter? I've never done anything with them before.
1. What chip are you using?
2. Read the datasheet. It will have a section on each Timer/Counter available on your particular PIC. It tells you exactly what values to write to each register to set up the timer as a counter and how to read/write the current value of the counter. You will also be able to set up one of the I/O pins as a trigger for the counter and select rising/falling edge for triggering. Read up on the prescaler, you may need to set that up too.
Im using an 18F252. Im looking through the datasheet and I found that Timer0 uses the T0CON register and on the pin diagram it says that T0CKI is pin 6 (PortA.4). How to the timers work? I've never done anything with them before and I'm not even sure what they do.
Bookmarks