PIC12F1840 PWM

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

Moderator: Benj

Post Reply
Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

PIC12F1840 PWM

Post by Dave Squibb »

Hello all,
The attached program works with a PIC16F88 but I can't get it to work on a PIC12F1840.
Porta,1 goes high so the oscillator is working. I've tried clearing trisa,2, the CCP1 pin and setting t2con,2 to turn on timer 2.
Could someone have a look please?
Thanks,
Dave.
Lantern_12F.fcfx
(9.15 KiB) Downloaded 272 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: PIC12F1840 PWM

Post by medelec35 »

Hi Dave,
The

Code: Select all

clear_bit(trisa,2);
set_bit(t2con,2);
is not required for PWM to work.
I have tested your flowchart with and without the above C code and PWM is present on pin 5.
Have you applied the FC6 fix found here?
You should make sure FC6 is updated with the latest version then apply fix after.
The version I'm running is 6.1.4.0
If Flowcode is updated after the PIC_CAL_PWM.c fix then PWM will no longer work.
Martin

Post Reply