Ok, pragma target clkouten is programming the configuration word as it should. Reading hex with a programmer it looks ok. However on the RA4 pin there is no clock/4.
On Sat, Dec 14, 2024 at 1:15 PM vsurducan <[email protected]> wrote: > Hi Rob, > I'm trying to understand the PWM in PIC12F1572, for which the pwm library > can not be used. > > I need to see the system clock. > The problem is that I can not make it visible on clockout pin. The > following code should do it? > > include 12f1572 -- target PICmicro > -- > ;pragma target clock 32_000_000 -- oscillator frequency > pragma target clock 8_000_000 -- oscillator frequency > -- > pragma target OSC INTOSC_NOCLKOUT -- internal oscillator > pragma target PLLEN DISABLED -- PLL off > pragma target CLKOUTEN ENABLED -- clock output enabled > pragma target WDT DISABLED -- watchdog > pragma target BROWNOUT DISABLED -- no brownout reset > pragma target LVP ENABLED -- low voltage programming > pragma target MCLR EXTERNAL -- external reset > -- > > OSCCON_SCS = 0 -- select primary oscillator > OSCCON_IRCF = 0b1110 -- 8 MHz > ;OSCCON_SPLLEN = ENABLED -- software PLL on 8x4=32MHz > OSCCON_SPLLEN = DISABLED - 8Mhz OSC > -- > enable_digital_io() -- make all pins digital I/O > pin_A4_direction = output ; output osc/4 > -- 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 visit https://groups.google.com/d/msgid/jallib/CAM%2Bj4qtP6ODnLqR8daTRx%3DaVw-oEQcFyUVBOdg_EeagEahLdwg%40mail.gmail.com.
