Well I am still having problems, so I have been doing some testing.
Using this exact code:
Code:
CMCON = 7 ' Disables the Comparitor Pins
ADCON1 = 15 ' Disables the A/D Converter Pins
TRISF = $F0 ' Define Port F(0-3) as LED Outputs
Define OSC 20 ' Sets Oscillator Speed at 20Mhz
Define BUTTON_PAUSE 100 ' Sets Button Debounce time to 100 ms
Define I2C_SLOW 1 ' Sets I2C Speed to 100KHz
Main_Loop:
PortF.0 = 0
PortF.0 = 1
PortF.1 = 0
PortF.1 = 1
PortF.2 = 0
PortF.2 = 1
PortF.3 = 0
PortF.3 = 1
Goto Main_Loop
The Clock is dead on at 20MHz as measured on an oscilloscope.
Each pin takes about 200nS to go low then return high... Which seems on par with the 18F8722 data sheet stating that it take 4 clock cycles to exicute a command.
I actually measured the old device clock. It is running at 1MHz. Given that the fasted the 18F8722 can run each command, I basically can run 5 commands for each of the old devices clock cycles. Buy looking at my original code a few posts back it looks like I can do what I want to unless the compilier is creating bloated assembly code...
Bookmarks