PIC18F1320 HPWM on 2 pins

Hello Folks,

iīm trying to get my favorite PIC18F1320 to give out two different HPWM duty cycles with the same frequencies . The Duty cyles differ wildly and are not correspondent. I read the data sheet and couldnīt figure out which pin relates to which HPWM Channel. I searched through the forum
and was more confused than before.

I ran one single HPWM channel successful on a PIC16F88 but two on a PIC18F1320 seem way more complicated.

Re: PIC18F1320 HPWM on 2 pins

The PIC18F1320 only has one CCP Module, CCP1. Whereas the Data Sheet claims 1, 2, or 4 outputs, they are all Half- Full-Bridge complimentary outputs of the CCP1 Frequency & Duty Cycle. To achieve your goals, you need a processor with at least 2 CCP Functions. I'm not sure if your project requires an 18F part, but there are several 16F parts with 14/20 pins that incorporate 2+ CCP Modules. Here are some:

Re: PIC18F1320 HPWM on 2 pins

Hello Mpgmike,

you are right. I did a HPWM single channel with a 16F88 and it worked great. So I guess its waaaay easier to use two
PICs than to scramble everything in just one.
In my experience the use of multiple IF...THEN slows my 40 MHz PIC down to pure uselessness...
I got the 18F1320 to measure speed and calculate fuel pump speed so I will go for a second PIC to measure temperature and control water pump speed. And show that on an LCD of course. Iīll have to get into hserout , baud rate and such strange things.

Re: PIC18F1320 HPWM on 2 pins

Hello Guys,
need alittlehelp because iīm totally stuck.
Trying to send one byte from a PIC16F876A to a PIC16F88 and display it.
Tried Debug,Serin and donīt get it working.
Everything works in the proram exept the serout - serin communication.Tried with pullup resistor, baud rates from 1200 to 9600, negative and true.....tried to get samples from this forum, tried samples out of several PIC programming books, I donīt get it.Hello World2serin.txtADCINBargraphserout.txtHello World2serin.txt

Re: PIC18F1320 HPWM on 2 pins

Hello folks,
please help because Iīm totally stuck.
Try to send one byte from a 16F88 to a 16F876A and display it on LCD using DEBUG.
16F88 measures voltage on one pin and send the variable adval to 16F876A.
Problem is: the LCD at the 16F876A shows only 4 different charcters: 48 up to 51 or if I change from DEC3 to DEC1 0 to 3.
Should be 0 to 255 . The Voltage at the analog Input goes the full way from 0V to 4.8V but the LCD shows only 4 different characters which change at about 1/4 of the voltage change, so its proportional to the voltage change .
I get the message "some configuration words are not in hex" from my PICKIT2 but only when programming the 16F88.

I will receive a 3 digit fast running number, impossible to read and no correspondece to the position of the poti for the analog Input.

I got the input in the 16F876A from 0 to 3
which is in the direction i need but way too coarse, then changed DEBUGIN_MODE 0 to 1 at the receiver still having DEBUG_MODE 1 at the transmitter and what: made no difference receiveived 0 to 3.
That was the point when I realized that Iīm stuck.

Re: PIC18F1320 HPWM on 2 pins

************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************