What to look for in RTM_TimerCalc V1.31

1 post / 0 new
Runtime Micro's picture
Runtime Micro
Joined: 07/24/2016 - 9:18am
What to look for in RTM_TimerCalc V1.31

This next version of RTM_TimerCalc includes extra info in generated code. Specifically you'll see Frequency (or Interval) called out as a C++ Comment. Included will be the Clock source frequency. See next;

// RTM_TimerCalc 1.31,  RuntimeMicro.com
// Timer-1 16-bit, Mode-10 Phase, Top=ICR
// 1 Second Interval, Clock is 16 MHz  

TCCR1B = 0x10; // 0001 0000, Disable Timer Clock
TCCR1A = 0x02; // 0000 0010

ICR1 = 31250-0;

// Set Overflow Interrupt Mask Bit
TIMSK1 |= 1; // ISR Prototype --> ISR(TIMER1_OVF_vect){}

TCCR1B |= 4; // Prescale=256, Enable Timer Clock

In the beginning comments, you get a reminder of what the code accomplishes! Added to the usual Mode and Timer info is the output Value, its Units and the source clock.

If you look back on this code block in the future, you'll know what the objective was and the needed clock frequency. Trust me when I tell you this can be helpful.

Work and Think in Preferred Units

The RTM_TimerCalc GUI goes the extra mile to help you stay focused. Choose your Ask Units from; Hz, uSec, mSec, Second, Minute and even Hours! Enter your Ask value, hit Calculate and see the results displayed in the same Units. Plus, the Report section is simplified and formatted for easy-on-the-eyes reading. See next image...

Image shows a selectable range of Units RTM_TimerCalc can work with.

DAC Equivalent?

In some circles its said the N-Divide value of your PWM is a good indication of its ability to act like a DAC. This may be true but I've seen it written you want 2-to-4 times the  from 2-to-4 additional bits for DAC like control in a closed loop circuit.

Nonetheless, the TimerCalc GUI now indicates the ( logN / log2 ) DAC number that equates with the N-Divide in a Tooltip. Hover your mouse over the Code-Window's label and you'll get an indication similar to what you see in the following Image.

Image shows Tooltip for DAC equivalent bits related to current N-Divide Number.

Adaptive Screen Capability

I recently discovered RTM_TimerCalc wasn't playing nice in different display environments. Specifically, it was hiding portions of its UI when run at certain resolutions and scaling (text size) modes. Version 1.31 has fixed a lot of this so (hopefully) you can see and use any part of the UI. If you install V1.31 and see a problem, please let me know using this site's Contact form.

Adaptive Prompt Capability

TimerCalc's circled-numbers (shown in next image), blink or flash to grab your attention. Their text is rendered by a Window's font (Segoe UI). But systems that didn't have Segoe UI installed, made the display look strange -- and failed to Prompt the User.

Image shows circled numbers that flash when prompting user.

Version 1.31 draws a filled circle in place of the missing number. Its color and flashing follow the same norms of Segoe UI. And -- systems that emulate Windows (such as Wine under Linux) should show a useable Prompt as intended. There should be no need to install Segoe UI.

Deprecated Features

Two features in TimerCalc have been removed. If you have a prior version, I recommend you do Not rely on these features! They have problems I discovered after release. The two features are;

  1. Phase Shifted Square Waves
  2. In-Pin Clocking

There's lots going on inside RTM_TimerCalc V1.31. More soon... Smile