Searching \ for '[PIC] Having Trouvle with PWM on PIC16F1779??' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=pwm
Search entire site for: 'Having Trouvle with PWM on PIC16F1779??'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Having Trouvle with PWM on PIC16F1779??'
2016\07\06@135121 by Jim Ruxton

flavicon
face
I have used PWM a number of times in the past but for some reason I am having trouble getting it to work on this chip. Can anyone think of any gotchas I may be missing?  Could it be something to do with the PPS? I have never used that feature on a PIC before. I am expecting PWM output on RA3 but getting nothing. Below is the code I am using to start the PWM? Any thoughts? Pulling my hair out on this one. Thanks.

    TRISA=0xFF;
    PWM10CON=0x00;
    T2PR=0x52;
    PWM10DCL = 0x80;
    PWM10DCH = 0xF0;
    PIR1bits.TMR2IF = 0;
    T2CON = 0x00;
    T2CON=0x80;
    TRISA=0xF0;
    RA3PPS=0x1E;
    PWM10CON = 0x80;

Jim


-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2016\07\06@145433 by Rob Hamerling

picon face

Hi Jim,

I haven't used the 16f1779 with PWM, but I do with a 16f18855. I expect for PWM these are similar.
As you can see in the datasheet (TABLE 4) there is no default PWM output pin. You need to assign one with PPS.
Not very complicated: RA3PPS = 0x1E; when you want the PWM signal on RA3  (see table 12.2 and provided you follow example 12.1)

Good luck! Rob.


On 07/06/2016 07:51 PM, Jim Ruxton wrote:
{Quote hidden}

-- *Rob H*amerling - http://www.robh.nl
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2016\07\06@171416 by Gál Zsolt

flavicon
face
Hello,

I never used this chip, I have read only the datasheet just now.

http://ww1.microchip.com/downloads/en/DeviceDoc/40001819A.pdf

I found TIMER2 more complicated than it was earlier. If I see well, you
would like to use one 10 bit PWM modul. There is TABLE 25-5 on page 326
which is showing the associated registers to 10 bit PWM modules. For using
PWM10 module you decided to use TIMER2 module by not change the default
value of CCPTMRS2 register <7:6>. I'm not sure but I think the source of
your problem is the TIMER2 module. It has the T2CLKCON register. You can
set the source of the clock for TIMER2 module trough this register. The
default value is 0x00 and that means clock come for an input pin named it
RC3 according the T2INPPS register default value ( 0x13 ). So I think you
should set T2CLKCON register to 0x01 ( or 0x02 ) if you want to use Fosc/4
( of Fosc ) as a clock source for TIMER2 module. You can check it on page
301.

Regards,

  Zsolt

2016-07-06 19:51 GMT+02:00 Jim Ruxton <spam_OUTcinetronTakeThisOuTspampassport.ca>:

{Quote hidden}

-- ~~~~~~~~~~~~~~~~
http://galzsolt.zzl.org
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2016\07\06@191632 by Denny Esterline

picon face
No experience with this particular part, so take this with a grain of
salt...
I see mention of setting the peripheral pin select to map the PWM to an
output.
My understanding is that that has to be done inside a specific unlock-lock
sequence
written in assembly language.
On the dsPIC33 parts I use for sure...

-Denny
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

More... (looser matching)
- Last day of these posts
- In 2016 , 2017 only
- Today
- New search...