CCP on 12F1822

Moderator: Benj

Post Reply
conroydp
Posts: 20
Joined: Mon Apr 09, 2012 8:53 am
Been thanked: 3 times
Contact:

CCP on 12F1822

Post 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 7334 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 377 times

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: CCP on 12F1822

Post 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.

conroydp
Posts: 20
Joined: Mon Apr 09, 2012 8:53 am
Been thanked: 3 times
Contact:

Re: CCP on 12F1822

Post 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

Post Reply