Hello all. below is a part of my code for an OPB timer attached to a Microblaze with no inerrupts. the timer counts correct but when reaches the value 0xFFFFFFFF ( end point) should roll over and start again counting but this doesn't happend. what might be wrong here?
#include "xparameters.h" #include "xstatus.h" #include "xtmrctr_l.h"
#define TMRCTR_BASEADDR XPAR_OPB_TIMER_1_BASEADDR #define TIMER_COUNTER_0 0
int main(void) {
Xuint32 *memloc; Xuint32 Value1; Xuint32 Value2; Xuint32 *TimerCurrentValue; Xuint32 ControlStatus; Xuint32 TmrCtrBaseAddress; Xuint32 HasEventOccurred; Xuint8 TmrCtrNumber; XTmrCtr_mSetControlStatusReg(TmrCtrBaseAddress, TmrCtrNumber,0x0);
/* * Set the value that is loaded into the timer counter and cause it to * be loaded into the timer counter */ XTmrCtr_mSetLoadReg(TmrCtrBaseAddress, TmrCtrNumber, 0xFFFFF000); XTmrCtr_mLoadTimerCounterReg(TmrCtrBaseAddress, TmrCtrNumber);
/* * Clear the Load Timer bit in the Control Status Register */ ControlStatus = XTmrCtr_mGetControlStatusReg(TmrCtrBaseAddress, TmrCtrNumber);
XTmrCtr_mSetControlStatusReg(TmrCtrBaseAddress, TmrCtrNumber,ControlStatus & (~XTC_CSR_LOAD_MASK ));
/* * Start the timer counter such that it's incrementing by default */ XTmrCtr_mEnable(TmrCtrBaseAddress, TmrCtrNumber);
thank you all Xenix