Avnet Electronics Marketing - Community Forum
    |   
 
Home Design Services My Account About Avnet
Reply
Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Timer Help

I've got a semi-working Timer where it eventually generates an interrupt but it takes about 120 seconds instead of the 6 seconds I'm setting the timer too.  Does anyone have any suggestions on what I'm doing wrong?  The following is how I'm setting up the timer with a Microblaze Kernel.

 

XTmrCtr_SetHandler(&Timer1, (XTmrCtr_Handler) TimerHandler, &Timer1);

 

XTmrCtr_SetOptions(&Timer1, (Xuint8)0, XTC_INT_MODE_OPTION | XTC_AUTO_RELOAD_OPTION );

 

XTmrCtr_SetResetValue(&Timer1, (Xuint8)0, 6 * 1000);

 

XTmrCtr_Start(&Timer1, (Xuint8) 0);

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: Timer Help

The IDS 13.2 "Embedded Example Design" for this board posted to the S6LX150T reference design download page: www.em.avnet.com/spartan6lx150t-dev has an interrupt example design that uses a timer. You may want to compare your code with the example design.

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: Timer Help

Thanks for the reply.  I'm using a Kernel and ran into a problem with I2C interrupt registration so I was told that I had to use register_int_handler which works.  I tried using the sample code that you pointed me to and it immediately goes to the interrupt.  So I'm wondering if I'm running into the same problem since I'm using a Kernel.  Any ideas?

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: Timer Help

 
Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: Timer Help

Not sure what you mean by "it immediately goes to interrupt".

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: Timer Help

The value entered to count to or from has no effect.

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: Timer Help

Have you tried the debugger to see the state of the timer registers?

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: Timer Help

What debugger are you referring too, Chipscope?  If so I'm not sure how this is possible.  Can you give me some pointers?

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: Timer Help

I'm referrign to the GNU software debugger.