Author Topic: Help... Needing a Kinetis Periodic Timer Example  (Read 11735 times)

Offline sam512bb

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help... Needing a Kinetis Periodic Timer Example
« on: January 07, 2013, 10:23:48 PM »
Good day Mark,

I was curious if you can provide a Kinetis Periodic Timer Example?  Sadly, I cannot use uTaskerMonoTimer, as I require the task to run every 100 milliseconds.  I have tried doing this via TIMER_INTERRUPT_SETUP as well as PIT_SETUP, but with no success...

Thank you in advance!

Cheers,

Sam

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Help... Needing a Kinetis Periodic Timer Example
« Reply #1 on: January 07, 2013, 11:11:28 PM »
Hi Sam

In ADC_Timers.h you can enable a PIT demo with TEST_PIT plus TEST_PIT_PERIODIC for a periodic interrupt.
Make sure that SUPPORT_PITS is enabled in app_hw_kinetis.h (so that the PIT driver is available).

This configures PIT0 using fnConfigurePIT() for a 500us interrupt period.

The interrupt handler (test_nmi()) will toggle an LED as defined by TOGGLE_TEST_OUTPUT so that a 500Hz square wave is generated. The output is, for example, the yellow LED on the K60 Tower board.

Regards

Mark




Offline sam512bb

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Help... Needing a Kinetis Periodic Timer Example
« Reply #2 on: January 08, 2013, 03:29:41 AM »
Good day Mark,

Excellent, thanks for the prompt response and info ... as usual :)

Cheers,

Sam