Page 1 of 1

Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 10:43 am
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?

Re: Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 10:50 am
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

Re: Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 11:00 am
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

Re: Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 11:04 am
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

Re: Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 1:41 pm
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

Re: Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 1:51 pm
by kersing
Please exercise some patience. Spamming the forum does not make things go faster.

Re: Because it doesn't respect the delay

Posted: Fri Apr 12, 2024 4:30 pm
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.

Re: Because it doesn't respect the delay

Posted: Wed Apr 17, 2024 6:09 am
by hiromiyureei
Hi, I commented on the indicated line, actually the microcontroller does not block but continues, the only thing it transmits and receives.