public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Toggling GPIO at 38Khz
@ 2008-10-08  3:43 Jon Smirl
  2008-10-08  6:40 ` Eric Miao
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jon Smirl @ 2008-10-08  3:43 UTC (permalink / raw)
  To: ARM Linux Mailing List, lkml

I'm working on getring the LIRC IR subsystem integrated into the
kernel. One common IR hardware implementation is based on standard
serial ports. It uses the serial port's DCD and DTR as GPIO pins.
This common IR hardware does not have a transmit modulator and is
modulating the IR signal in software. Luckily is has hardware
demodulation.

There are four common IR frequencies - 36Khz, 38Khz, 40Khz, 56Khz. I
need to create these frequencies in software. Data is then transmitted
as 400-600us burst of these frequencies. Around 10-30 clock pulses.

So how do I reliably generate 38Khz without destroying latency in the
system? I also don't want to measure the speed of the code I'm
executing - same code has to run on 90Mhz ARM and 3Ghz Core2. If a do
a loop with nanosleep() I need to know how fast my code is to subtract
it's execution time form the sleep time. The existing LIRC code works
this way and measures it's timing loop.

hrtimers look promising, but hrtimers doesn't have a periodic API. Is
there a technique for creating periodic timing that doesn't accumulate
error caused by rescheduling the timers?  If I need to send 30 pulses
of 38Khz, it is more important that the total time be (1/38000)*30 =
0.7894ms than it is for each pulse to be generated at exactly 26.3us
intervals.

Are there other techniques for generating pulse trains in the 36-56Khz
range on a simple GPIO pin? Anyone have some sample code?

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <bkydL-21G-5@gated-at.bofh.it>]

end of thread, other threads:[~2008-10-09 17:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08  3:43 Toggling GPIO at 38Khz Jon Smirl
2008-10-08  6:40 ` Eric Miao
2008-10-09  8:38   ` Andy Green
2008-10-08 12:01 ` Bill Gatliff
2008-10-08 13:06   ` Jon Smirl
2008-10-08 17:00     ` Chris Friesen
2008-10-08 21:58     ` Krzysztof Halasa
2008-10-08 18:57 ` Remy Bohmer
2008-10-08 22:24   ` Dave Hylands
2008-10-09  2:26     ` Bill Gatliff
2008-10-09 17:53     ` linux-os (Dick Johnson)
     [not found] <bkydL-21G-5@gated-at.bofh.it>
2008-10-08 12:15 ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox