OK, I tried the above but didn't work.
Trial 1:
- using the default setting of 4 mhz, the LED's flashed at rate 'X'
Trial 2:
- using the osccon = %01110000 (8 mhz)
- The LED's flashed at a rate of '2X'
Trial 3:
- Using the_hs_osc- the LED flashing rate went back to 'X'
Define OSC 20
It doesn't seem that the 20 Mhz is working??? Should it not flash at '5X' rate?
Here is what the top end of the code looks like now:
[HTML]
'*************************************
'Configuration Bits
_hs_osc
define osc 20
'osccon = %01001000 ' Osc set to 1 MHz
'osccon = %01100000 ' Osc set to 4 MHz
'osccon = %01110000 ' Osc set to 8 MHz
trisio = %00011000 '
' GPIO.5 output
' GPIO.4 input
' GPIO.3 input
' GPIO.2 output
' GPIO.1 output
' GPIO.0 output
wpu = %00010000
' GPIO.5 Weak pullup disabled
' GPIO.4 Weak pullup enabled
' GPIO.3 Weak pullup disabled
' GPIO.2 Weak pullup disabled
' GPIO.1 Weak pullup disabled
' GPIO.0 Weak pullup disabled
CMCON0 = 7 ' Analog comparators off
ANSEL = 0 ' Analog select set to digital, pg 69 data
ADCON0 = 0 ' A/D turned OFF, pg 68 of data
'***************************************
'Define Variables
pausetime var word
Out0 var gpio.0
Out1 var gpio.1
Out2 var gpio.2
B0 var byte
'***************************************
'Set Variables
pausetime = 100
B0 = 0
low 0
low 1
low 2
[/HTML]





Bookmarks