Page 1 of 1

Possable PWM Issue ?

Posted: Fri Jan 03, 2020 1:49 pm
by Steve001
Hi I am using a PIC16F1828

With the Example PWM & ADC
https://www.matrixtsl.com/wikiv7/index. ... )#Examples

The only change I have made is to use the internal osc. as per this post

viewtopic.php?f=63&t=21754&p=98648

The output is floating around 1 V any idea's ? tried all 4 outputs they the same

I am waiting till next week, will add some to a RS order in case of a faulty device as I only have one.

Steve

Re: Possable PWM Issue ?

Posted: Fri Jan 03, 2020 4:11 pm
by LeighM
Hi Steve,
It's probably worth adding a toggle of a pin/LED in the loop, just to check that the program is running (and at correct speed).
e.g. with two 500mS delays

Re: Possable PWM Issue ?

Posted: Fri Jan 03, 2020 5:33 pm
by Steve001
Hi Leigh

Will try that and get back to you - (the timer i used in the post that i asked for config advice runs ok although i have not accurately checked the timings)

Steve

Re: Possable PWM Issue ?

Posted: Mon Jan 06, 2020 1:41 pm
by Steve001
Hi Leigh,

Had a quick play at the weekend, didn't have much time. Still not working yet
Did notice that PWM2 is mappable between 2 pins how do you change this ? in control the panel

Do you have to use the "APFCON Register code" . do I just use a c code icon before the PWM enable ?

Steve

Re: Possable PWM Issue ?

Posted: Mon Jan 06, 2020 7:09 pm
by medelec35
Hi Steve,
Looking at the datasheet, only CCP2 can be on an alternate pin as you have stated.
Just change Channel to Channel 2, Then you should be allowed to change Alternative from No to Yes.
If after that still not working then C code may be required.
If not already done so, you will need to make sure you are up-to date with the latest updates from here