Thank you for the offer. I've taken a look at the PIC16F1615 and it has a
10bit PWM.
PIC12F1572 has a 16bit PWM which can be used in too many modes (standard,
set on match, center-align). Actually I need the standard PWM just to feed
clock for the CWG (complementary waveform generator) and that I partially
understand it (see the code posted in the other message).
However I would be interested to see your libraries, I always I'm curious
to learn new things, perhaps including them in jallib package would be a
good idea.

Vasile


On Sun, Dec 15, 2024 at 12:28 PM Rob Hamerling <[email protected]>
wrote:

>
> Hi Vasili,
>
> Not about clockout, but there is an open Jallib issue (#208) with respect
> to PWM libraries. It may contain information that could be of help to
> you.   A few years ago I made some 'private' libraries, to be able to use
> PWM with 16f161x, 16f184xx, 16f188xx, 18f27k40. I don't know if these are
> usable for the 12F1572. If you are interested I could send these to you.
>
> Regards, Rob_H!
>
>
>
> On 15-12-2024 08:33, vsurducan wrote:
>
> Solved in a weird mode. The following code is sending OSC/4 on clkout pin
> if A4 is ON inside a loop.
> Without a loop, A4 is permanently low.
>
> 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
> alias  clkout       is pin_A4      -- alias for clkout pin
>
> forever loop
>    clkout = ON
> end loop
>
>
> On Sun, Dec 15, 2024 at 9:02 AM vsurducan <[email protected]> wrote:
>
>> 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%2Bj4qtqos%3DsRusP0SVrcELXKuOOgCgETpza6cW_v4vWj4%3DwmA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jallib/CAM%2Bj4qtqos%3DsRusP0SVrcELXKuOOgCgETpza6cW_v4vWj4%3DwmA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> *Rob H*amerling, Vianen, NL
>
> --
> 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/7fe5970a-07e7-4941-8208-c58b9061e401%40gmail.com
> <https://groups.google.com/d/msgid/jallib/7fe5970a-07e7-4941-8208-c58b9061e401%40gmail.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 visit 
https://groups.google.com/d/msgid/jallib/CAM%2Bj4qtE8ZXbMGRU2G1-36WdyRaOx8WbPL7dch-xMgF%3D-CiWhA%40mail.gmail.com.

Reply via email to