lkml.org 
[lkml]   [2008]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Toggling GPIO at 38Khz
>> 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

The 38 kHz decoders will actually work across a range of frequencies
usually about +/- 4 kHz.

If you have a spare UART, you could configure it at 76800 baud and
just send out an appropriate bit pattern (taking into consideration
start bit, stop bit, parity, etc.

115200 baud might also work (3 bit times per 1/38400 of a second). It
won't be a perfect square wave, butI think it would still work.

You could also do something similar if you have a SPI interface. Just
set the clock to the right frequency and use the bits sent out to
generate your pulses.

--
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/


\
 
 \ /
  Last update: 2008-10-09 00:27    [W:0.109 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site