ts-7000
[Top] [All Lists]

Re: [ts-7000] Generating a 25Khz wave on DIO pins

To:
Subject: Re: [ts-7000] Generating a 25Khz wave on DIO pins
From: "Don W. Carr" <>
Date: Fri, 3 Nov 2006 12:02:07 -0600
These are typically the kinds of things you should never do inside of the OS. You should really be using the 7260, or 7300 to do this in an FPGA, with the standard XDIO they provide. Or, as one author suggested with an external 555 timer, that you could possibly turn on/off with a DO.

But, in any case, a standard kernel right now is not fully preemptive and you can not count on timing like that. Typically the best is in the range of milliseconds on a 2.4 kernal.

I was at the Real-Time Linux Workshop, held in Lanzhou China this year and was able to talk to Thomas Gleixner who is working on high resolution timers and a fully pre-emptive kernel with the guy from RedHat. They just accepted, the patches for the 2.6.18 kernel as a matter of fact, and with the new kernel, you should expect an accuracy of in the range of 60 microseconds when doing a stock nanosleep(). Of course assuming you process has the priority needed and the system is not too busy. You should also not use usleep() anymore, for right now, usleep() just calls nanosleep(). They introduced nanosleep, expecting that the stock kernel will eventually have resolution better than 1 microsecond.

Here is an article about Gleixner and the patch:

http://linuxdevices.com/news/NS9566944929.html

Don.

On 11/2/06, yasbug <> 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.

A 25Khz wave should have a period of 40useconds with each period
consisting of a 20us high and a 20us low. For some reason, I cannot
achieve a frequency over 25Hz on the DIO pins.

Is there a pulse limitation on the DIO pins? Does the fact that I am
running Debian off of a USB flash have any affect? Should there be a
different behavior on the A/D or LCD pins? Any suggestions or ideas?

Thanks,
Yas




--
Dr. Don W. Carr
J. G. Montenegro 2258
Guadalajara, Mexico
+52-333-630-0704
+52-333-836-4500 ext 2930 __._,_.___


SPONSORED LINKS
Single board computer Hardware Computer running slow
Linux os Single board

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU