PIC CCP wont run if Internal CAN Enabled

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
jay_dee
Posts: 215
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 81 times
Been thanked: 55 times

Flowcode v10 PIC CCP wont run if Internal CAN Enabled

Post by jay_dee »

Hi,
Using 18F PIC CCP and ECCP periferals, in capture mode and Timer3, in PIC 18F4680 and 18F2580.
ECCP works without issue. (The second ECCP module is only available on the higher pin count devices)

However, If the CAN Component is initaialised in internal mode, no external signal will trigger the interupt of CCP.

Attached is flowcode in a working state. CAN is set to External.
If this is changed to internal, the Interupt will never be called.
CCP_Capture_Test_PIC18F4680.fcfx
(49.63 KiB) Downloaded 10 times
I am not sure if this is due to some sharing of TMR3.
Or something to do with CAN Rx also being linked to the interrupts.

All bit of pain, as I'm quite commited to a comercial project requiring both CCP, ECCP ports + CAN. :)
(My CAN routine is not currently using any Interupts but I would like to do so in the future if possible. )
Any thoughs FC Team ?

BenR
Matrix Staff
Posts: 1936
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 506 times
Been thanked: 688 times

Re: PIC CCP wont run if Internal CAN Enabled

Post by BenR »

Hello,

I've just had a look and the internal CAN doesn't seem to use Timer 3 or CCP and so shouldn't cause an issue.

If you need to have a look at the CAN code then it's available here. Just copy and paste the address into the file browser address bar.

C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PIC

Then open the PIC_CAL_CAN.c in a text editor.

I wonder if it's a known silicone bug. You could maybe check the Errata documents here for potential known issues and workarounds.
https://www.microchip.com/en-us/product ... umentation

Seems to be a lot in there regarding the ECCP module.

jay_dee
Posts: 215
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 81 times
Been thanked: 55 times

Re: PIC CCP wont run if Internal CAN Enabled

Post by jay_dee »

Hmm, OK thanks for checking Ben, I check the extra docs. I think I'll also try to monitor the register values relating to the interrupts, see what's changing when the CAN initialises. J.

jay_dee
Posts: 215
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 81 times
Been thanked: 55 times

Re: PIC CCP wont run if Internal CAN Enabled

Post by jay_dee »

Hi,
short update.
I monitored the CIOCON register...there is something setting the CANCAP bit, this enabled CAN message recieve interupt and stops triggers from RC2 to the CCP1.
I tried to manually set the CANCAP bit to 0, but it did not seem stable and bit was getting reset to 1 somehow.
I tried to write my own CAN INIT but it was also not stable...

as I work around I'm looking at ways of avoiding CCP1. J.

Post Reply