Hi there,
I´m trying to use PWM in Flowcode 5 (I can´t post in the FC5 forum)
I use a counter to set PWM duty cycle on CCP1.
How can I connect the PWM signal to a led to adjust brightness?
If a connect a led, nothing is shown.
Please give me some hints on this.
Use of PWM
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Use of PWM
Hello,
Access to the v5 topic can be obtained by following the link in my signature.
This article on controlling LEDs may help.
http://www.matrixmultimedia.com/article.php?a=52
Access to the v5 topic can be obtained by following the link in my signature.
This article on controlling LEDs may help.
http://www.matrixmultimedia.com/article.php?a=52
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode v5 User
- Posts: 68
- Joined: Thu Mar 01, 2007 10:48 am
- Location: Netherlands
- Been thanked: 3 times
- Contact:
Re: Use of PWM
Hello Ben,
Thanks for your reply.
I have used the PWM function and the duty-cycle is changing, according the counter value.
When I connect a led to the output RC1 or RC5 of the PIC16F1824, nothing shows.
I don´t know how to get the value of the PWM to an output pin.
Rinie
Thanks for your reply.
I have used the PWM function and the duty-cycle is changing, according the counter value.
When I connect a led to the output RC1 or RC5 of the PIC16F1824, nothing shows.
I don´t know how to get the value of the PWM to an output pin.
Rinie
Greetings, Rinie
Flowcode V7 user
Flowcode V7 user
-
- 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: Use of PWM
Have you checked your configuration settings are all set correctly?
That is the main cause of hardware not working.
If you click on my signature, that should help.
If following that does not work and If not commercially sensitive, can you please post your flowchart, then someone i'm sure will help you further.
Martin
That is the main cause of hardware not working.
If you click on my signature, that should help.
If following that does not work and If not commercially sensitive, can you please post your flowchart, then someone i'm sure will help you further.
Martin
Martin
-
- Flowcode v5 User
- Posts: 68
- Joined: Thu Mar 01, 2007 10:48 am
- Location: Netherlands
- Been thanked: 3 times
- Contact:
Re: Use of PWM
Hello Medelec,
Thanks for your reply.
For now, i only have tested the software simulation on PWM.
I want to connect a led to an output pin and adjust the brightness while flashing.
So the led has to go from 0% to 100% and back to 0% in approx. 1 second.
For this i want to use the PWM signal and set the duty cycle of this with a counter value.
So first, i´m trying to get in to blink.
I have attached the test file for this.
As you can see, with a led on every pin.
So I asume that the led has to blink as discribed before.
Rinie
Thanks for your reply.
For now, i only have tested the software simulation on PWM.
I want to connect a led to an output pin and adjust the brightness while flashing.
So the led has to go from 0% to 100% and back to 0% in approx. 1 second.
For this i want to use the PWM signal and set the duty cycle of this with a counter value.
So first, i´m trying to get in to blink.
I have attached the test file for this.
As you can see, with a led on every pin.
So I asume that the led has to blink as discribed before.
Rinie
- Attachments
-
- Darthuizer test 004.fcf
- (10 KiB) Downloaded 307 times
Greetings, Rinie
Flowcode V7 user
Flowcode V7 user
-
- 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: Use of PWM
Hi Rinie,
Since PWM signal is generated by internal registers, you will not be able to connect an LED to PWM output to observe PWM duty (Simulation only). This is normal, and does not mean PWM is not being generated.
It should work on your hardware ok.
Martin
Since PWM signal is generated by internal registers, you will not be able to connect an LED to PWM output to observe PWM duty (Simulation only). This is normal, and does not mean PWM is not being generated.
It should work on your hardware ok.
Martin
Martin
-
- Flowcode v5 User
- Posts: 68
- Joined: Thu Mar 01, 2007 10:48 am
- Location: Netherlands
- Been thanked: 3 times
- Contact:
Re: Use of PWM
Martin,
I have tested this in hardware and that works as it should.
Thanks very much for your help on this.
Rinie
I have tested this in hardware and that works as it should.
Thanks very much for your help on this.
Rinie
Greetings, Rinie
Flowcode V7 user
Flowcode V7 user