Hi,
The challenge was prompted by the recent thread about dividing an input frequency.
.
I'm not sure how or why you'd want to "divide an input frequency" (using a PICaxe) and whether it would be from a (TTL) Clock source or a resonator/crystal, but an inspection of the data sheet suggests that it "should" be possible:
As already discussed, you can't use the normal external clock, but you should be able to use
Timer 1: The Data Sheet (edited) says:
5.2.1 EXTERNAL CLOCK SOURCES
An external clock source can be used as the device system clock by performing ....the following actions:
• Write the SCS<1:0> bits in the OSCCON register to switch the system clock source to:
- Timer1 oscillator during run-time
Sadly, the Timer 1 input is also Leg2, so you'll still need to jump through the hoops suggested by hippy in #14, e.g. Start with Leg2 held low; Issue a DISCONNECT; "Enable" the external oscillator using a hardware "trick"; Wait for the Timer1 Oscillator Ready (T1OSCR) bit of the OSCSTAT register to be set; Switch the system clock to use Timer1.
Timer 1 can itself be used in (at least) three different modes:
1. Internal oscillator,
2. External (TTL) Clock Source (Leg2);
3. Internal Oscillator with External (32 kHz) crystal (Legs 2 and 3).
Note that the external clock input is a Schmitt Trigger (ST) input so might need a decent TTL amplitude.
The Oscillator is described as "optimised" for 32 kHz, but you might be able to push in a higher frequency clock. The Pin Description table (page 10) says: OSC1 XTAL — Crystal/Resonator (LP, XT, HS modes), but I guess that applies only when used for the master system oscillator not for Timer 1.
Cheers, Alan..