PDA

View Full Version : New clock speeds?



cgriffin
27th October 2004, 23:42
Does 3.0 support additional clock speeds? I'm particularly interested in the lower range, such as 1 & 2MHz, 32KHz, etc, that the PICs with the built in oscillators have.

Thanks!
Cliff

Tim
28th October 2004, 00:29
Yes Proton has got more Xtal Freq's but the lowest is 3.58MHz, If you need t run at low freq just take it into account when you require a time based command. i.e. Delayms time/4 will give you the right delay at 1mhz


CRYSTAL Frequency Declare

DECLARE XTAL 4 , 8 , 10 , 12 , 16 , 20, or 24. For 12-bit core devices.
DECLARE XTAL 3 , 4 , 8 , 10 , 12 , 14 , 16 , 20, or 24. For 14-bit core devices.
DECLARE XTAL 3 , 4 , 8 , 10 , 12 , 14 , 16 , 20 , 24 , 25 ,32 , 33 , or 40. For 16-bit core devices.

Inform the compiler as to what frequency crystal is being used. Some commands are very dependant on the oscillator frequency, RSIn, RSOut, DelayMS, and DelayUS being just a few. In order for the compiler to adjust the correct timing for these commands, it must know what frequency crystal is being used. If an XTAL frequency of 3 or 14 is chosen, then the resulting code is produced for 3.58MHz and 14.32MHz respectively. If the DECLARE is not used in the program, then the default frequency is 4MHz.