Page 1 of 1

CCP on 12F1822

Posted: Sun Nov 27, 2016 2:34 pm
by conroydp
Hi Martin,

Tx again for your quick and very helpful response, much appreciated.

I have developed another flowchart which will assist in counting the interrupts on RA2 and provide an output using CCP1. Unfortunately, the INT and CCP are both on pin5.

I noticed that flowcode does not allow me to "Use alternative pin"
1822Capture.JPG
1822Capture.JPG (35.47 KiB) Viewed 7985 times
I then resorted to setting "apfcon=0x01;" in a "C-code" block. According to the datasheet, this should move CCP to RA5, however it does not appear as if I am getting an output on RA5.

I found a few posts relating to Alternative CCP not working, but nothing related to the 12F1822.

I would appreciate it if you could advise as to any known bugs/workarounds.

Regards
Conroy
12F1822 CCP.fcf
(16 KiB) Downloaded 398 times

Re: CCP on 12F1822

Posted: Mon Nov 28, 2016 12:21 pm
by Benj
Hi Conroy,

You might need to make pin A5 be an output before enabling the PWM (CCP), e.g. using an output icon in single bit mode.

Hopefully this will allow it to work as expected.

Re: CCP on 12F1822

Posted: Fri Dec 02, 2016 4:26 pm
by conroydp
Hi Benji,

I added an output for RA5. Now I am getting the PWM signal on both pins (RA2 and RA5).

Any suggestions?


Regards
Conroy