| View previous topic :: View next topic |
| Author |
Message |
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
|
Posted: Tue Oct 14, 2008 4:36 am |
|
|
I was wrong again,
T1_External does not take the osc1 and osc2 input, but T1OSO and T1OSI...
now the big problem is that i don't have any pins but one left on my pic.
So I was thinking to use Timer2 instead.
I can do a DIV_BY_16 with Timer 2.
But it is only 8 bit, so I have to think of something else...
or someone has an idea?
Best Regards |
|
 |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Tue Oct 14, 2008 1:57 pm |
|
|
Why can't you use Timer 1 with DIV_BY_8? _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
 |
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
|
Posted: Wed Oct 15, 2008 1:33 am |
|
|
because it runs too fast, i have my program running on 20Mhz,
but some parts of it are too slow for high rpm of the disc.
So I wanted to double the clock speed, and thus I have to double the prescaler from 8 to 16 |
|
 |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Wed Oct 15, 2008 5:13 am |
|
|
Can't you make adjustments in your program to accommodate the faster clock? Would you have a problem with overflow at lower speeds? If so, perhaps that can be handled by software extensions to the Timer. _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
 |
Ttelmah Guest
|
|
Posted: Wed Oct 15, 2008 7:59 am |
|
|
| Blob wrote: | I was wrong again,
T1_External does not take the osc1 and osc2 input, but T1OSO and T1OSI...
now the big problem is that i don't have any pins but one left on my pic.
So I was thinking to use Timer2 instead.
I can do a DIV_BY_16 with Timer 2.
But it is only 8 bit, so I have to think of something else...
or someone has an idea?
Best Regards |
I'm sorry, but 'of course' it takes it's own OSC pins. This is why you would need an oscillator that is capable of driving two pins....
If you have no spare pins, then I'm afraid you will have to look at doing the extra division yourself. As another poster has said, handle the timer overflow, so you get an 'extended' timer, usig 17bits, not 16, and just divide the result by two.
Best Wishes |
|
 |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Oct 15, 2008 8:23 am |
|
|
The usual PIC crystal oscillator circuit is capable of driving several pins. I have had one master PIC with the crystal, and its crystal drive pin also driving the crystal input pins of 3 or 4 other PICs so they are all clocked together. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
 |
|