PIC32mx270f256b timing issues unresolved - [Solved]

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

PIC32mx270f256b timing issues unresolved - [Solved]

Post by Zane »

Hi,

I have installed the latest version of FC and have noticed that delay macro works ok now :D. To get the UART to work correctly at a given baud rate the peripheral clock divisor needs to be set to /4. In doing this, having a timed interrupt that is also driven from the peripheral clock source, it will roll over at half the desired frequency.

To avoid having to use fiddle factors, should it be set so that with the peripheral clock divisor set to 1, a given baud rate selected will transmit at that rate and also the rollover frequency of the timed interrupt to occur at the rate set in the properties for the timed interrupt? I have not had time to test other functions such as CAN or PWM etc but would they be affected in the same manner?

Any help in getting this resolved would be hugely appreciated.

Thanks

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: PIC32mx270f256b timing issues unresolved

Post by Benj »

Hi Zane,

Please can you try this updated CAL file to see if it fixes the baud problems with a peripheral divisor of 1.

The file needs to be placed into your "Flowcode 7/CAL/PIC32BIT" folder.
PIC32BIT_CAL_UART.c
(22.18 KiB) Downloaded 225 times
Let us know how you get on.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: PIC32mx270f256b timing issues unresolved

Post by Zane »

Hi Ben,

I have installed the updated CAL file and with the peripheral clock divisor set to 1 the UART transmits data at the correct rate :D.
To get the UART to work correctly at a given baud rate the peripheral clock divisor needs to be set to /4. In doing this, having a timed interrupt that is also driven from the peripheral clock source, it will roll over at half the desired frequency.
Now the timed interrupt will roll over at 2 x the desired frequency.

Thanks

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: PIC32mx270f256b timing issues unresolved

Post by Benj »

Hi Zane,

Right I have changed the FCD now and hopefully the timer interrupt frequency should now be calculated correctly.

Simply copy the attached file into your "Flowcode 7/FCD/PIC32" folder and restart Flowcode for the changes to be loaded.
32MX270F256B.fcdx
(52.73 KiB) Downloaded 200 times
Let me know how you get on, if this works well for you then I'll roll it out to the other devices.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times
Contact:

Re: PIC32mx270f256b timing issues unresolved

Post by Zane »

Hi Ben,

I have installed the FCDX file and it works :D. In the properties for the timer 1 interrupt the roll over frequency has changed from 150hz to 300hz.

Thanks

Post Reply