Author Topic: RealTimeInterrupt are not fired when in a thread  (Read 7962 times)

Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
RealTimeInterrupt are not fired when in a thread
« on: October 23, 2008, 11:28:34 AM »
Hi

I have been trying to get a FAT system up running on SD card with good luck.

Now i try to get this into the uTasker, but have got a basic problem....
The SPI driver needs a 10 ms timer to get the timing/timeout right to the SD card.
My problem is now that the RealTimeInterrupt interrupt are only running when the system is idle, and I what the timer to count when in a thread as well.

Can this be done?

Regards
Steen

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: RealTimeInterrupt are not fired when in a thread
« Reply #1 on: October 23, 2008, 03:15:37 PM »
Hi Steen

The routine fnRtmkSystemTick() is called from an interrupt so will count uTaskerSystemTick from within a task, as long as interrupts are not disabled by the task code.

If you don't mind waiting in the code during the 10ms you can use the uTaskerSystemTick value to know when 10ms has passed (the tick resolution will however have to be increased from the 50ms standard value in the project).

Another technique is to use PIT1 as accurate timer.
See the example in application.c (SUPPORT_PIT1 is needed to activate the support - the demo is activated by TEST_PIT). You can use the interrupt to signal that you can continue.

Use also the following as a guide to waiting a fixed time using state/event method, which will allows the system to continue operating during the wait: http://www.utasker.com/forum/index.php?topic=383.0

Regards

Mark



Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: RealTimeInterrupt are not fired when in a thread
« Reply #2 on: October 28, 2008, 11:00:22 AM »
Hi Mark

Thanks for you quick reply.

I have had the chance to test it today and it works perfect when using PIT1. :D

Ones again thanks for the help.

Regards
Steen