PIC/Microcontroller External Timer Questions

Thread Starter

solpic

Joined Jul 23, 2009
25
Hello everyone,

I have some questions about microcontroller timers, specifically the PIC16F8 series (I don't know if the answers to these apply to all microcontrollers).

I heard that the PIC 16F8 series do not have internal timers, is this true?

If a PIC microcontroller is specified as 20mHZ, I thought that meant the instruction cycle speed of the PIC, but if it does not have an internal timer, how could that be the case?

If a PIC mcu is specified as 20mHZ, would it work if I attached a 25mHZ crystal, or even higher?

Thanks
 

mr boss

Joined Jun 3, 2009
11
Hi

About the 16F8x internal timers. Most new 16F pics have internal timer modules. Even the 16F84 have a TMR0, but while I readed through your post, it sounded more like you were talking about the internal oscillator. As far as I know, all the 16F8x have internal oscillators.

The crystal frequency is divided by 4. So for a 20Mhz crystal the working frequency will be 5Mhz. That means that each instruction will take 200nS to complete. ( There are some instructions that takes more than one cycle. )

I don't know what will happen when a higher rated crystal is used than that of which the mcu can handle. I guess its like a car. If you ref it outside its limit, the engine fails.
 
Last edited:

AlexR

Joined Jan 16, 2008
732
It looks as if you are talking about oscillators rather than timers.
There is no blanket 16F8 series so it might help if you state which particular chip you had in mind. However there is the 16F87X series which don't have an self-contained internal oscillator (but can use an RC network off the osc pin to run an RC oscillator) and the 16F88X series that do have a self-contained internal oscillator that can run at various frequencies up to 8MHz.

If a PIC mcu is specified as 20mHZ, would it work if I attached a 25mHZ crystal, or even higher?
A 25MHz crystal might work, then again it might not, it depends on how good your particular chip is. In all probability it would work at 25MHz but not much above that.
 

Vaughanabe13

Joined May 4, 2009
102
There is no reason you should run an external oscillator with a higher frequency than your chip's rating. If the problem is you need a chip that will support 25MHz crystals, the solution is you need to research the Microchip PIC line and find a new chip that can do that.
 

rjenkins

Joined Nov 6, 2005
1,013
You do appear to be getting confused between Timer and Clock.

The Clock signal or frequency is used to sequence the processing of program instructions by the central processor (CPU).

PICs are Microcontrollers; as well as a CPU they have memory and peripheral devices all built in.

Timers are one of many possible peripherals. These are nothing to do with running programs instructions, they are used to set time intervals or measure times for events, leaving the CPU free to do other things until the timer expires.
 
Top