Dave
Always wear safety glasses while programming.
If you need to run at 4Mhz on the internal OSC, put this in your code.
I have a development board that runs at 40Mhz on a 10Mhz XTAL + PLL, but sometimes I need to slow things down to 4Mhz and run on the internal oscillator to see how they will run on "little" parts. This code does the trick.Code:ASM movlw 0x62 ; %0110 0010 = 4 Mhz, internal osc block movwf OSCCON movlw 0x80 ; %1000 0000 = PLL disabled movwf OSCTUNE ENDASM
Charles Linquist
I was thinking of a routine that could detect the clock speed the pic is running at
so that then the pic program could adjust serial speed, etc accordingly.
Make a delay loop in picbasic and count the number of ticks a hardware timer
makes during the delay loop.. and then the hardware timer value will be
different for different clock speeds.
Art, What would you use as a reference in that situation?
Dave Purola,
N8NTA
Bookmarks