Quantcast
Channel: EngineerZone : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 51060

Timer keeps running in simulator

$
0
0

According to my reading of the hardware manual, a general purpose timer should stop once it has reached the width value in one shot mode.

The timer keeps running, and also doesn't reset when it reaches the width value nor the period value.

I am using the simulator while waiting for my EZ board.

Did I misconfigure something?

 

 

#include "stdio.h"

#include "cdefBF51x_base.h"

/*****************************************************************************

* Problem1.c

*****************************************************************************/

 

int main( void )

{

    int i;

    //Disable output pin

    *pTIMER0_CONFIG |= OUT_DIS;

    //Set mode to PWM

    *pTIMER0_CONFIG |= PWM_OUT;

    //Set Period

    *pTIMER0_PERIOD = 0x50000;

    *pTIMER0_WIDTH =  0x10000;

    *pTIMER_ENABLE |= TIMEN0;

   

    do

    {    i = *pTIMER_STATUS;

        printf("0X%x 0X%x\r\n",i,*pTIMER0_COUNTER);

   

    }

    while ((i & TRUN0 )==TRUN0);

    return 0;

}


Viewing all articles
Browse latest Browse all 51060

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>