From: "Jon Smirl" <jonsmirl@gmail.com>
To: "ARM Linux Mailing List"
<linux-arm-kernel@lists.arm.linux.org.uk>,
lkml <linux-kernel@vger.kernel.org>
Subject: Toggling GPIO at 38Khz
Date: Tue, 7 Oct 2008 23:43:50 -0400 [thread overview]
Message-ID: <9e4733910810072043m6c69f3bdv104bd32928fe64ae@mail.gmail.com> (raw)
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
next reply other threads:[~2008-10-08 3:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 3:43 Jon Smirl [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e4733910810072043m6c69f3bdv104bd32928fe64ae@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®