Max PIT Speed?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PearOs
Member
Member
Posts: 194
Joined: Mon Apr 08, 2013 3:03 pm
Location: Usually at my keyboard!

Max PIT Speed?

Post by PearOs »

Hey guys, I have always wondered this and after reading the wiki and doing some research myself I don't know if I'm right on this or how to exactly do it. I can right now make the PIT run every 10 ms I think. Is there a way to make this faster? Like half a mili second or less?

Thanks, Matt
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: Max PIT Speed?

Post by madanra »

The PIT can go up to 1.193182 MHz. The code example on the wiki has a section 'Program the PIT channel', which sets the frequency division. So if you set that to 1, the PIT will fire interrupts at 1.193182 MHz = every 0.838μs; if you set it to 2, the PIT will fire interrupts at 1.193182 / 2 = 0.596591 MHz = every 1.676μs. For 0.5ms, you want 2kHz, so you need to set the frequency division to 1.193182 MHz / 2 kHz ≈ 597.
PearOs
Member
Member
Posts: 194
Joined: Mon Apr 08, 2013 3:03 pm
Location: Usually at my keyboard!

Re: Max PIT Speed?

Post by PearOs »

Thanks!
Post Reply