Hello to all survivors of too many redirects....
I finally got PIC18F45K80 running, and settings are correct - run multiple PAUSE statements and measured times with scope. But I'm not impressed with performance at all.
The simple code
SOME:
HIGH PORTB.1
LOW PORTB.1
GOTO SOME:
On the 16F series, outputs frequency that of 1/4 of OSC speed- say osc is 8mhz, output will be 2mhz and so on (and contrary some recomendations, replacing HIGH/LOW with LATB=X or TRISB=X does not improve the speed).
Now I have 18F45K80 running at 64mhz.
But output frequency is about 2.5mhz, but it should be at least 16mhz.Code:#config CONFIG RETEN = OFF CONFIG INTOSCSEL = HIGH CONFIG SOSCSEL = DIG CONFIG XINST = ON ;Enabled CONFIG FOSC = INTIO1 CONFIG PLLCFG = OFF CONFIG FCMEN = OFF ;Disabled CONFIG PWRTEN = OFF ;Disabled CONFIG BOREN = OFF ;Disabled in hardware, SBOREN disabled CONFIG WDTEN = OFF ;WDT disabled in hardware; SWDTEN bit disabled CONFIG CANMX = PORTB CONFIG MCLRE = OFF #endconfig OSCTUNE.6 = 1 ; Enable 4x PLL OSCCON = %01110000 ANCON1=0 'DISABLE ADC D3-D2-D1-D0- ancon0=0 TRISC=%00000000 'set PORTC as output all TRISD=%00000000 'set PORTD as output all TRISB=%00000000 'set PORTB as output all TRISA=%00000000 'set PORTA 2 as input, others as output TRISE=%0000000 'set PORTE as output all define OSC 64 GKO: HIGH PORTc.7 'PAUSEus 1 LOW PORTc.7 'PAUSEus 1 GOTO GKO





Bookmarks