I'm working on a project on my Spartan3E starter kit, using MicroBlaze.
I'm trying got get a timer working in capture mode, but without luck yet. I have a PWM signal input (2nd from the top on the J2 port, LOC B6), which I want my timer to trig on (low-true), and I want to measure the time between 2 falling edges.
Here is the info I think is relevant but please ask for more if you need it:
Net timer_CaptureTrig0_pin LOC=B6 | IOSTANDARD = LVCMOS33;
PORT timer_CaptureTrig0_pin = timer_CaptureTrig0, DIR = I
xil_printf("\n\r TimerCounterReg is: %d",counterReg);
The only output I get on my hyperterminal is:
I think my problem lies within the TCSR (Timer Control Status Register), and I tried a couple of different MASK setups but nothing works. I also tried the XTmrCtr_SetOptions() instead of XTmrCtr_mSetControlStatusReg() with different setups. I can’t figure out what the difference is between XTmrCtr_SetOptions() and XTmrCtr_mSetControlStatusReg. But I have tried some debugging and have come to the conclusion that XTmrCtr_SetOptions() does not affect the TCSR, which is the one I think I need to setup the right way. The only thing I can get running is, if I start the timer manually with XTmrCtr_Start() and then use XTmrCtr_GetValue() function to get the current value of the counter, the counter just counts up until it reaches the end at 32bit and then stop (it’s about 1½min.). So I know that something is working.
So again I can’t get the CaptureTrig0 working. Hope someone out there can help me.