News:

Let's find out together what makes a PIC Tick!

Main Menu

having problem to set INTOSC for the 16F1825

Started by Yves, May 21, 2023, 06:38 AM

Previous topic - Next topic

Yves

Hello all,
I'm having problem to get my on board to set INTOSC tor the 16F1825 to run at 16Mhz. Below my simple flash test.
Where am I going wrong?
Yves
 
'        Manipulating internal oscillator spedd
Device = 16F1825
Declare Xtal = 16
OSCCON = %1111010   ' setting at 16Mhz
OSCTUNE = $00        'No change

Declare Optimiser_Level = 0
Declare All_Digital = True
Declare Dead_Code_Remove = 1
Symbol LED = PORTA.2 : Output  PORTC.5
'================= Checking LED flash speed ================================
While
    High LED
    DelayMS 1000
    Low LED
Wend
'=============================================================================

'=================== fuses ==================================================   
    Config1 FOSC_INTOSC, WDTE_OFF, MCLRE_OFF, CP_OFF, CPD_OFF, BOREN_OFF
    Config2 PLLEN_OFF, LVP_OFF, WRT_OFF, STVREN_OFF
'=============================================================================
Yves

Frizie

Hi Yves.

You have forgotten a delayms 1000 under 'Low LED'
Ohm sweet Ohm | www.picbasic.nl

Yves

Yves

See_Mos

You are not the only one Yves.

I just lost almost 3 days because of various silly mistakes.

Just one example is for the 12F675 Set_OSCALL is the correct command, 'Set OSCALL' compiles without errors but of course the PIC does not run at the correct speed.

I blame old age and poor memory