Because it doesn't respect the delay

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
hiromiyureei
Posts: 30
http://meble-kuchenne.info.pl
Joined: Thu Dec 17, 2020 3:34 pm
Been thanked: 1 time

Flowcode v9 Because it doesn't respect the delay

Post by hiromiyureei »

Because in flow code I have to put FPLLODIV divided by 2 to have a correct delay, with a CPU at 80 MHz.
Let me start by saying that it works correctly in mplab, am I doing something wrong in the configuration in flowcode?
Attachments
1can.png
1can.png (237.28 KiB) Viewed 231 times
cantemp575.fcfx
(25.1 KiB) Downloaded 13 times

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 286 times
Been thanked: 412 times

Re: Because it doesn't respect the delay

Post by chipfryer27 »

Hi

Can't download your file until later in the day, but it sounds as though it could be a setting in configuration.

You will see a setting for:-
Speed (delay related timings)

This tells FC what speed your clock is running at so it can calculate the appropriate delays.

If this doesn't match your actual clock speed then issues arise.

It's the first thing I would check.

Regards

hiromiyureei
Posts: 30
Joined: Thu Dec 17, 2020 3:34 pm
Been thanked: 1 time

Flowcode v9 Re: Because it doesn't respect the delay

Post by hiromiyureei »

I correctly entered the clock speed of 80mhz, it seems that it works at 160, but obviously it is not possible, surely there are some employees who don't work for me,
the project is here
https://drive.google.com/drive/folders/ ... drive_link

hiromiyureei
Posts: 30
Joined: Thu Dec 17, 2020 3:34 pm
Been thanked: 1 time

Flowcode v9 Re: Because it doesn't respect the delay

Post by hiromiyureei »

I'm going crazy to understand but nothing to do if I insert code made with mpla and working correctly, it also works in flowcode,
but if I only insert flowcode init the controller crashes, I would like to buy flowcode 10 but I doubt it would solve this problem.
I attach example photos, the project is always the same

https://drive.google.com/drive/folders/ ... drive_link
Attachments
2can.png
2can.png (215.48 KiB) Viewed 226 times

hiromiyureei
Posts: 30
Joined: Thu Dec 17, 2020 3:34 pm
Been thanked: 1 time

Flowcode v9 Re: Because it doesn't respect the delay

Post by hiromiyureei »

This is the simple project working tx can with rx can, I still have to understand why it doesn't want to work with flocode init, I'm waiting for someone expert to answer me.
Thank you
Attachments
cantemp575.fcfx
(24.71 KiB) Downloaded 15 times

kersing
Valued Contributor
Posts: 158
Joined: Wed Dec 02, 2020 7:28 pm
Has thanked: 66 times
Been thanked: 58 times

Re: Because it doesn't respect the delay

Post by kersing »

Please exercise some patience. Spamming the forum does not make things go faster.

BenR
Matrix Staff
Posts: 1742
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: Because it doesn't respect the delay

Post by BenR »

Hello,

The only blocking code I can spot in the CAN initialise for the PIC32 is here,

Code: Select all

			// Set to operating (normal) mode
			C1CONbits.REQOP = REQOP_NORMAL;
			while(C1CONbits.OPMOD != REQOP_NORMAL);
You could double check if this is causing the problem by commenting out the while

Code: Select all

			// Set to operating (normal) mode
			C1CONbits.REQOP = REQOP_NORMAL;
			//while(C1CONbits.OPMOD != REQOP_NORMAL);
The code can be found here C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PIC32BIT

Copy and paste the path into your file explorer and then open the file PIC32BIT_CAL_CAN.c in a text editor.

The code in question can be found on line 296.

hiromiyureei
Posts: 30
Joined: Thu Dec 17, 2020 3:34 pm
Been thanked: 1 time

Re: Because it doesn't respect the delay

Post by hiromiyureei »

Hi, I commented on the indicated line, actually the microcontroller does not block but continues, the only thing it transmits and receives.

Post Reply