OPB timer Microblaze

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

Reply to
xenix
Loading thread data ...

perhaps you need to set XTC_CSR_AUTO_RELOAD_MASK.

alan nishioka snipped-for-privacy@nishioka.com

Reply to
Alan Nishioka

yes the roll over done.:)) some conflict was with the declarations and i assigned the HEX value of its setting straitgh away. now i am trying to find if there is any signal that idicating when the counter has rollover but as far now didnt find any.:(

Reply to
xenix

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.