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.
PWM on 12F615 not working
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
-
- 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
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
- 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
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.
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 398 times
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
-
- 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
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.
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
-
- 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
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?
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