Possable PWM Issue ?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Possable PWM Issue ?

Post 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
Success always occurs in private and failure in full view.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Possable PWM Issue ?

Post 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

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Possable PWM Issue ?

Post 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
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Possable PWM Issue ?

Post 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
Success always occurs in private and failure in full view.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Possable PWM Issue ?

Post 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
Martin

Post Reply