News:

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

Main Menu

Positron PWM 2 channels problem

Started by xvovanx, Jan 30, 2024, 07:37 PM

Previous topic - Next topic

xvovanx

Hello!
Why do two PWM channels work perfectly on the old version of Proton 3.5.6.5, but only one PWM channel works on Proton newer versions 3.6.x.x and Positron? What's the Positron problem I don't understand?

trastikata

Hello,

add those declares and see if it works:

Declare HPWM1_Pin PORTC.2
Declare HPWM2_Pin PORTC.1



xvovanx


top204

#3
For about 10 years, most PIC microcontrollers have PPS (Peripheral Pin Select), so the user can choose which pins do what for a particular peripheral (with some restrictions), so the Declares are required so the compiler can auto manage the PPS for a particular peripheral used by a command and load particular SFRs with the port and pin chosen, and if the microcontroller does not have PPS, it needs the declares to tell it what pins are used because microchip keep moving them around on devices, so a default pin is no use anymore. The HPWM command is one of those commands that use the CCP or PWM peripherals, so PPS comes into play with them if the device has it on-board.