- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am new to eCos.
Currently I am using CycloneII chip with 40Mhz clock. I would like to delay for 1 second. I read eCos documents. And I found that I'm supposed to use below method. cyg_thread_delay(DELAY); But I'm not sure what value do I have to put in 'DELAY'. A clock that runs at 40MHz. In order to delay 1 second, which is 1000 millisecond, how to work out the number of clock ticks? I got confussed while I am reading the documents. Could you help me out, here? (I was doing experiments by putting random in DELAY, and it seems that cyg_thread_delay(1000); seems to be 1 second approximately. But I would like to know how to calculate it.) Thanks in advance.Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi romiodelta,
> But I would like to know how to calculate it.) from the ecos reference manual: <div class='quotetop'>QUOTE </div> --- Quote Start --- If the application requires delays measured in milliseconds or similar units rather than in clock ticks, some calculations are needed to convert between these units as described in Clocks. Usually these calculations can be done by the application developer, or at compile-time. Performing such calculations prior to every call to cyg_thread_delay adds unnecessary overhead to the system.[/b] --- Quote End --- See "Delay" at: http://ecos.sourceware.org/docs-latest/ref...ad-control.html (http://ecos.sourceware.org/docs-latest/ref/kernel-thread-control.html) Also Clock Resolutions and Ticks" and "cyg_clock_get_resolution" at: http://ecos.sourceware.org/docs-latest/ref...nel-clocks.html (http://ecos.sourceware.org/docs-latest/ref/kernel-clocks.html) Regards, --Scott
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page