> The only way to prevent this is to either move the
> logic into the FPGA (on the ts-7300) so it's not being generated
by
> software at all, or to disable interrupts.
>
> --Andy Gryc
> President, Airchitex
The TS-7260 and TS-7300 XDIO uber-GPIO functionality will also allow
you to do this.
Another way you could do this is to use the ep9302 timer hardware to
generate an interrupt where the interrupt handler would twiddle the
DIO line. First order contributers to IRQ latency will depend on
the Linux interrupt handler preamble and the longest code path with
interrupts disabled in Linux. 2nd order contributers are L1
cache/TLB state and the current ARM opcode being executed and memory
space (in case of ldr/str insns to slow memory) being accessed.
You can dramatically improve interrupt latency from a timer
interrupt by configuring the ep9302 VIC to make the timer interrupt
the sole device generating an ARM FIQ interrupt. If its the sole
FIQ, you don't really need much of an OS interrupt preamble. Also,
if the kernel only masks IRQ and not FIQ in critical sections, you
could eliminate that particular worst-case response time aggressor.
Lastly, ARM processors can be programmed with L1 cache lock-down to
ensure the FIQ handler stays in L1 cache.
With the above tricks, it is possible to get an extremely
responsive, reliable and quick timer interrupt on the ARM to twiddle
for square wave generation. I would think 25Khz would then be
possible and not have to cause 100% cpu utilization. Of course, you
would have a bit of work to do to accomplish this in the Linux
kernel. The result would be better latency than the best of RTOS's
*for that particular intr* while simultaneously running regular ol'
Linux. TS could do this if the right customer came along-- I'd
estimate about a man-day worth of work to design and test... :-)
//Jesse Off
>
> --- In "Michael Schmidt" <michael@>
> wrote:
> >
> > > Hi all,
> > >
> > > I have a 7250 board and am looking to generate a 25Khz square
> wave on
> > > a DIO pin.
> > >
> > > I am also running debian linux from a USB flash drive.
> > >
> > > I am able to generate a waveform (as seen on an oscilloscope)
but
> > > only at a maximum of 25Hz. I can not achieve a higher
frequency.
> Here
> > > is a snippit of my C code:
> > >
> > > while (1){
> > >
> > > *PBDR = 0x01;
> > > usleep(20);
> > > *PBDR = 0x00;
> > > usleep(20);
> > > }
> > >
> > > The usleep() function SHOULD sleep for 20us. However, I can
only
> read
> > > a 25Hz wave on the oscilloscope meaning that each pulse length
is
> > > 20ms.
> >
> > usleep(20) will sleep a <i>minimum</i> of 20us. What in fact is
> happening
> > is that your process is being rescheduled for the next clock
tick,
> which
> > happens at 100Hz (10ms), times two is the 20ms period you are
> seeing.
> >
> > Regards,
> >
> > Michael
> >
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|