[NECTO Studio 2.1.0: Timer Calculator] PIC32MZ: Wrong prescaler setting for timer 4 [solved]

Timer Calculator is a free software development tool used for easier calculation of timer interrupts.
Post Reply
Author
Message
frank.malik
Posts: 96
Joined: 09 Apr 2021 20:37

[NECTO Studio 2.1.0: Timer Calculator] PIC32MZ: Wrong prescaler setting for timer 4 [solved]

#1 Post by frank.malik » 21 Sep 2022 11:35

Hello,

using the timer calculator with PIC32MZ might generate the wrong code.

Configuration: mikromedia for PIC32MZ, using PIC32MZ2048EFH100 @200MHz.
Target: Generate a 1ms interrupt with Timer 4.

Selecting "PIC32MZ EC" from the table of MCUs in the timer calculator. Using timer 4, 200MHz, 1ms Interrupt time.
TimerCalculator_PIC32MZ_200MHz_timer4_1ms.png
TimerCalculator_PIC32MZ_200MHz_timer4_1ms.png (17.55 KiB) Viewed 1031 times

The timing generated is 0.5ms instead of 1ms.
Looking at the comments, it says "Prescaler 1:2", however the T4CON register is set to 0x8000, which indicates "No Prescaler" resp "Prescaler 1:1".
The correct setting for T4CON is 0x8010. Using this value, the timing is correct with 1ms.

I haven't tested the other timers, but might be the case that there is a similar issue.
Last edited by frank.malik on 24 Oct 2022 07:59, edited 1 time in total.
Kind regards
Frank

Fusion for STM32 v8, STM32F407ZG@168MHz, 4" TFT capacitive
mikromedia 3, PIC32MZ2048EFH100@200MHz, 3" TFT capacitive
NECTO Studio 3.0.0, mikroC AI for ARM/PIC32, mikroSDK v.2.7.2

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: [NECTO Studio 2.1.0: Timer Calculator] PIC32MZ: Wrong prescaler setting for timer 4

#2 Post by filip » 21 Sep 2022 13:10

Hi,

Thank you for reporting this, I will pass it to our developers.

Regards,
Filip.

frank.malik
Posts: 96
Joined: 09 Apr 2021 20:37

Re: [NECTO Studio 2.1.0: Timer Calculator] PIC32MZ: Wrong prescaler setting for timer 4 [solved]

#3 Post by frank.malik » 24 Oct 2022 08:00

Hi,

solved in NECTO Studio 2.3.0.

kind regards
Frank
Kind regards
Frank

Fusion for STM32 v8, STM32F407ZG@168MHz, 4" TFT capacitive
mikromedia 3, PIC32MZ2048EFH100@200MHz, 3" TFT capacitive
NECTO Studio 3.0.0, mikroC AI for ARM/PIC32, mikroSDK v.2.7.2

Post Reply

Return to “Timer Calculator”