1 Data Visualizer Run Time (DVRT)

Data Visualizer Run Time (DVRT) is a tool used in Runtime Debugging, Verification and Application Tuning. DVRT can be configured to work in interrupt or polling mode. It has dependencies on TIMER and UART peripherals. Data transfer frequency depends on the streaming tick value.

Interrupt mode

In Interrupt mode, the dvrt process executes from timer interrupt context. All the requested variables are transfered to visualizer tool depending on the configured delay from the tool.

Polling mode

In polling mode, the dvrt process executes from main superloop. All the requested variables are transfered to visualizer tool depending on the configured delay from the tool. The DVRT Enable/Disable APIs are provided to the application to create critical section thereby executing the read/write operations atomically.

Using The Library

Interrupt Mode
volatile uint16_t counter = 10, LED_toggle_delay=500;
volatile int16_t demo_int16 = 0;
volatile uint16_t demo_uint16_array[] = {0};

void TMR4_Callback_InterruptHandler(uint32_t status, uintptr_t context)
{
    if(counter % 2 == 0)
    {
        demo_uint16_array[0] += 250; 
    } 
    counter++;
}

int main ( void )
{
        /* Initialize all modules */
        SYS_Initialize ( NULL );
        
        /* Register callback function for TMR4 period interrupt */
        TMR4_CallbackRegister(TMR4_Callback_InterruptHandler, (uintptr_t)NULL);
        
        /* Start the timer*/
        TMR4_Start();           //1ms 
        
        while ( true )
        {
            if(counter > LED_toggle_delay)
            {
                LED_Toggle();
                counter = 0;
                demo_int16 += 500;
            }
        }
        /* Execution should not come here during normal operation */
        return ( EXIT_FAILURE );
}

Polling Mode

volatile uint16_t counter = 10, LED_toggle_delay=500;
volatile int16_t demo_int16 = 0;
volatile uint16_t demo_uint16_array[] = {0};

void TC3_Callback_InterruptHandler(TC_TIMER_STATUS status, uintptr_t context)
{
    if(counter % 2 == 0)
    {
        demo_uint16_array[0] += 250; 
        demo_int16 += 500;
    } 
    
    counter++;
}

int main ( void )
{
        /* Initialize all modules */
        SYS_Initialize ( NULL );
        
        /* Register callback function for TC3 period interrupt */
        TC3_TimerCallbackRegister(TC3_Callback_InterruptHandler, (uintptr_t)NULL);
        
        /* Start the timer*/
        TC3_TimerStart();           //1ms 
        
        while ( true )
        {
            if(counter > LED_toggle_delay)
            {
                LED_Toggle();
                counter = 0;
            }
            DVRT_Process();
        }
        /* Execution should not come here during normal operation */
        return ( EXIT_FAILURE );
}