News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

PWM signal on PIC16F15376

Started by AA_GIL, Aug 04, 2023, 11:07 AM

Previous topic - Next topic

AA_GIL

Hi there,

New here and looking forward to be part of the community. I'm looking to get a simple code up and running to generate a PWM signal on RC1(31) or RC2(32) pins of PIC16F15376. Can someone start me off from a simple code?

Much appreciated,
AA

GDeSantis


charliecoutas

Welcome to the forum. You're not AA_Gil the restaurant critic are you?

Charlie

AA_GIL

Quote from: charliecoutas on Aug 04, 2023, 04:50 PMWelcome to the forum. You're not AA_Gil the restaurant critic are you?

Charlie

Thanks, nope that's not me, he is in a better place and not bothered with coding, I hope!

top204

I have removed the PIC15386 PWM library from the forum, because I have just set up a device and it is not working as it should have.

I'll check it out and see what Microchip have changed on the device that I did not notice in the datasheet.

top204

I did a bit more research on the PIC16F15376 device and found out a few alterations in the device that are not on most other enhanced 14-bit core devices, so I foolishy skipped over the section in the datasheet. It has to do with Timer2, which is what the CCP and PWM peripherals use. It does not follow the same rules as most other devices, so I have altered the code listing and posted it in the PWM section of the forum:

Positron8 - HPWM Library for PIC18F16F376 device

I tested the demo program on the Curiosity Nano board that uses the PIC16F15376 device, and the waveforms are generated from the pins selected and set up with PPS (Peripheral Pin Select).