Possable PWM Issue ?

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

Moderator: Benj

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1106
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 454 times
Been thanked: 507 times
Contact:

Possable PWM Issue ?

Postby Steve001 » Fri Jan 03, 2020 1:49 pm

Hi I am using a PIC16F1828

With the Example PWM & ADC
https://www.matrixtsl.com/wikiv7/index.php?title=Component:_PWM_(Outputs:_General)#Examples

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

https://www.matrixtsl.com/mmforums/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: 2008
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 688 times
Contact:

Re: Possable PWM Issue ?

Postby LeighM » Fri Jan 03, 2020 4:11 pm

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
These users thanked the author LeighM for the post:
Steve001 (Fri Jan 03, 2020 5:35 pm)
Rating: 5%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1106
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 454 times
Been thanked: 507 times
Contact:

Re: Possable PWM Issue ?

Postby Steve001 » Fri Jan 03, 2020 5:33 pm

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: 1106
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 454 times
Been thanked: 507 times
Contact:

Re: Possable PWM Issue ?

Postby Steve001 » Mon Jan 06, 2020 1:41 pm

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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8601
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2474 times
Been thanked: 3558 times
Contact:

Re: Possable PWM Issue ?

Postby medelec35 » Mon Jan 06, 2020 7:09 pm

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
These users thanked the author medelec35 for the post (total 2):
Benj (Tue Jan 07, 2020 11:20 am) • Steve001 (Wed Jan 08, 2020 1:38 pm)
Rating: 10%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.