PIC32MX575 @ 80MHz

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Kisen
Posts: 12
http://meble-kuchenne.info.pl
Joined: Sun Jun 20, 2021 11:55 am
Has thanked: 2 times
Been thanked: 1 time

PIC32MX575 @ 80MHz

Post by Kisen »

Hi,

I am attempting to set up a PIC32MX575 @ 80MHz

I am using 8MHz crystal, so looking on other forums and the datasheet, i need to divide by 2and multiply by 20.

FPLLIDIV = DIVIDE BY 2
FPLLMUL = MULTIPLY 20
FPLLODIV = DIVIDE BY 1
FPBDIV = DIVIDE BY 2

Clock speed is set to 80MHz for timing.

With my flowchart turning an LED on and off with 1 second intervals, i am getting real life at 0.5 seconds. So its running 2x faster.
Since flowcode should be set up for 80Mhz this seems to indicate that my hardware is running at 160Mhz?

Changing FPLLIDIV to DIVIDE BY 4 corrects to clock, but by the numbers, flowcode is set up for 40Mhz with a clock speed setting of 80MHz,.
So something is off somewhere.....

Am i on the right track here, or am i missing something?

I have attached the .fcfx file for you to take a look at if it helps. Its current setup is FPLLIDIV / 2 which is running 2 x fast.
Attachments
Q10 Main Development v0.1.fcfx
(7.77 KiB) Downloaded 294 times

Kisen
Posts: 12
Joined: Sun Jun 20, 2021 11:55 am
Has thanked: 2 times
Been thanked: 1 time

Re: PIC32MX575 @ 80MHz

Post by Kisen »

More info.

I have tried to get the UART to work so i can output to terminal.
In both of the above setups, i receive jargon from the PIC. Suggesting again that timings are off.

kersing
Valued Contributor
Posts: 192
Joined: Wed Dec 02, 2020 7:28 pm
Has thanked: 77 times
Been thanked: 64 times

Re: PIC32MX575 @ 80MHz

Post by kersing »

Have you tried setting the serial speed of the computer to twice your target speed or half of it to see it that produces the correct output? That would prove your theory.

Kisen
Posts: 12
Joined: Sun Jun 20, 2021 11:55 am
Has thanked: 2 times
Been thanked: 1 time

Re: PIC32MX575 @ 80MHz

Post by Kisen »

Good shout Kersing.

So, in order to get the serial to work, i am sending at 9600 from the PIC but receiving on the terminal at 4800. 2x slower

So heres what i have now set up.

8MHz crystal.
FLOWCODE CLOCK SPEED SET TO 80MHz

FPLLIDIV = DIVIDE BY 4
FPLLMUL = MULTIPLY 20
FPLLODIV = DIVIDE BY 1
FPBDIV = DIVIDE BY 1

All of the above i work out to running at 40Mhz, even tho Flowcode is set to 80mhz. This allows a 1 second LED blink to run on hardware properly.
Changing FPLLIDIV to /2 allows the UART to run at the correct speed of 9600. But the LED now blinks at 0.5 second intervals.

Since the UART works at the correct speeds, is this likely just a delay code issue?

SpeedPIC32
Posts: 261
Joined: Thu Dec 10, 2020 2:35 pm
Has thanked: 36 times
Been thanked: 17 times

Re: PIC32MX575 @ 80MHz

Post by SpeedPIC32 »

Hello Cushion

have a look at the settings in Excel that will already help you :)

greetings SpeedPic32
PIC32_OSC_CONFIG_v1.1.xlsx
(451.21 KiB) Downloaded 306 times

SpeedPIC32
Posts: 261
Joined: Thu Dec 10, 2020 2:35 pm
Has thanked: 36 times
Been thanked: 17 times

Re: PIC32MX575 @ 80MHz

Post by SpeedPIC32 »

Hello Kissen
sorry my tool translated your name with


write this into a C code field
UxBRG=108; // set uart 1 to 9600
x is to be replaced by your rs232 number
replace the number 108 with the value BRG0 or BRG1 from the tool brg nr then everything should work

greetings SpeedPic32

unzip the brg zip and start the exe
BRG.zip
(3.44 MiB) Downloaded 394 times

Post Reply