PWM on 12F615 not working

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

Post Reply
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:

PWM on 12F615 not working

Post by medelec35 »

Unable to produce PWM to drive a DC golf trolley motor with 12f615
Config is set at 0x2007,0x3c54

Not sure what I have left out to enable PWM O/P

Circuit works as follows. ADC(0) is increased. This produces a PWM. Duty is proportional to ADC(0).
If ADC(1) (current limit ) rises above a certain threshold, then LED flashes. After a loop of flashing for 20 times (to allow cooling of FET), if over current is still detected, then LED is solid, PWM stays off, and is locked in this loop.

Any help would be greatly appreciated.
Attachments
Golf_trolleyA.fcf
(8.5 KiB) Downloaded 323 times
Martin

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: PWM on 12F615 not working

Post by medelec35 »

Update. If PWM is set for normal 8bit, then adjustable PWM is working. However when set to 10bit PWM, then there is no PWM o/p at all.
Martin

User avatar
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: PWM on 12F615 not working

Post by Benj »

Hello

The 10-bit PWM was recently fixed. I have attached the updated component code file. Simply drop the file into your Flowcode V3/Components folder and restart Flowcode.
Attachments
PWM_Code.c
(7.78 KiB) Downloaded 396 times

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: PWM on 12F615 not working

Post by medelec35 »

Dear Ben, is attached pwm_code.c same as at:
http://www.matrixmultimedia.com/mmforum ... =23&t=5222
if so that I though I had already replace existing file.
Thanks anyway as now 10bit pwm is working.
Martin

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: PWM on 12F615 not working

Post by medelec35 »

I remember now, With the old pwm_code.c and 16F737 it worked on channel 1 but did not work on channel 2. So I replaced file that you(Ben) posted.
If I still had orig pwm_code.c since 12F615 has only one PWM channel, it should of worked. So is file u posted on this thread, same as previous file you posted, or is it a later version?
Martin

Post Reply