I solved, thank you. My PICkit didn't change the MCLR line to HZ after programming but kept it low. It's the first time I saw this behaviour after a million programming cycles or so...:)
On Sat, Feb 13, 2021 at 3:23 PM Rob CJ <[email protected]> wrote: > Hi Vsurducan, > > I did a test on a PIC18F25k50 using the following sample program and it > worked without problems. I did not need to disconnect my Pickit3 to have a > blinkind LED. So not sure which problem you are having. > > ----- > > include 18f25k50 -- target PICmicro > -- > -- This program uses the internal oscillator at 4 MHz. > pragma target clock 4_000_000 -- oscillator frequency > -- > pragma target OSC INTOSC_NOCLKOUT -- internal oscillator > pragma target PLLEN DISABLED -- PLL off > pragma target CPUDIV P1 -- Fosc divisor > pragma target WDT DISABLED -- watchdog > pragma target XINST DISABLED -- do not use extended > instructionset > pragma target DEBUG DISABLED -- no debugging > pragma target BROWNOUT DISABLED -- no brownout reset > pragma target FCMEN DISABLED -- no clock monitoring > pragma target IESO DISABLED -- no int/ext osc > switching > pragma target LVP ENABLED -- low voltage programming > pragma target MCLR EXTERNAL -- external reset > -- > -- The configuration bit settings above are only a selection, sufficient > -- for this program. Other programs may need more or different settings. > -- > OSCCON_SCS = 0 -- select primary oscillator > OSCCON_IRCF = 0b101 -- 4 MHz > -- > enable_digital_io() -- make all pins digital I/O > -- > -- A low current (2 mA) led with 2.2K series resistor is recommended > -- since the chosen pin may not be able to drive an ordinary 20mA led. > -- > alias led is pin_A0 -- alias for pin with LED > -- > pin_A0_direction = OUTPUT > -- > forever loop > led = ON > _usec_delay(100_000) > led = OFF > _usec_delay(400_000) > end loop > > ----- > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <[email protected]> namens vsurducan > <[email protected]> > *Verzonden:* zaterdag 13 februari 2021 10:38 > *Aan:* [email protected] <[email protected]> > *Onderwerp:* [jallib] Re: INTOSC problem > > Ok, solved the issue, perhaps this should be written in the blink files: > On PIC18F25K50 (and probably others) if you keep the programmer connected > on the ICSP and the LVP is ENABLED, > the LED connected on pinA0 will not blink until you disconnect the > programmer from the ICSP port. > The reason why this happen is described in the datasheet: "While in > Low-Voltage ICSP™ mode, > MCLR is always enabled, regardless of the MCLRE bit" > meaning that with the programmer connected permanently to the > microcontroller, the microcontroller will be continuously in reset, > the effect will be no blink of the LED and the wrong conclusion can be > that the oscillator was not configured correctly. > thank you > > On Sat, Feb 13, 2021 at 10:28 AM vsurducan <[email protected]> wrote: > > Hi all, > Perhaps you can see where the problem is below, the 18F25K50 doesn't want > to run with an internal oscillator and PLL. Thanks! > > include 18f25k50 -- target PICmicro > -- > -- This program assumes that no resonator or crystal > -- is connected to pins OSC1 and OSC2. > pragma target clock 48_000_000 -- oscillator frequency > -- > pragma target OSC INTOSC_NOCLKOUT -- internal oscillator > pragma target PLLSEL PLL3X -- 3x16MHz = 48MHz > pragma target PLLEN ENABLED -- PLL on > pragma target CPUDIV P1 -- CPU uses system clock > 48MHz > pragma target LS48MHz P8 -- USB 48MHz/8 = 6MHz > pragma target WDT DISABLED -- watchdog > pragma target XINST DISABLED -- do not use extended > instruction set > pragma target DEBUG DISABLED -- no debugging > pragma target BROWNOUT DISABLED -- no brownout reset > pragma target FCMEN DISABLED -- no clock monitoring > pragma target IESO DISABLED -- no int/ext osc > switching > pragma target LVP ENABLED -- low voltage programming > pragma target MCLR EXTERNAL -- external reset > -- > -- The configuration bit settings above are only a selection, sufficient > -- for this program. Other programs may need more or different settings. > -- > OSCCON_IRCF = 0b111 -- select INTOSC to 16MHz > OSCCON_SCS = 0b00 -- select primary clock defined by > CONFIG1H <FOSC3:0> > OSCCON2_PLLEN = TRUE -- use PLL > -- > enable_digital_io() -- make all pins digital I/O > -- > -- A low current (2 mA) led with 2.2K series resistor is recommended > -- since the chosen pin may not be able to drive an ordinary 20mA led. > -- > alias led is pin_A0 -- alias for pin with LED > -- > pin_A0_direction = OUTPUT > -- > forever loop > led = ON > _usec_delay(100_000) > led = OFF > _usec_delay(400_000) > end loop > -- > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/CAM%2Bj4qv4wTqPAdxVCz94kX_w9Se_fMUhtHuJ4hNZjqbmn8MuSA%40mail.gmail.com > <https://groups.google.com/d/msgid/jallib/CAM%2Bj4qv4wTqPAdxVCz94kX_w9Se_fMUhtHuJ4hNZjqbmn8MuSA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/AM0PR07MB6241C8F35565487B1B3C841DE68A9%40AM0PR07MB6241.eurprd07.prod.outlook.com > <https://groups.google.com/d/msgid/jallib/AM0PR07MB6241C8F35565487B1B3C841DE68A9%40AM0PR07MB6241.eurprd07.prod.outlook.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/CAM%2Bj4qte7L4Ryx6TXpb%3DW6nDipgLcFwDkiHzwNr54rhxzhU6cA%40mail.gmail.com.
