I am new to ARM linux, i am working on AT91RM9200 board and using ARM linuc C complier.. i want to know how to produce nanosecond delay using software...
16 10027
I am new to ARM linux, i am working on AT91RM9200 board and using ARM linuc C complier.. i want to know how to produce nanosecond delay using software...
Take a look at the nanosleep function.
You may need to recompile your kernel to increase the timer interrupt frequency in order to improve the resolution of the nanosleep function.
I do not know what the clock-speed on that chip is, you may have to move your code into the kernel, if that fine of a resolution is attainable.
Take a look at the nanosleep function.
You may need to recompile your kernel to increase the timer interrupt frequency in order to improve the resolution of the nanosleep function.
I do not know what the clock-speed on that chip is, you may have to move your code into the kernel, if that fine of a resolution is attainable.
Thank ... I am using 18.432 MHZ Clock now i need to generate 100 nanosecond delay through software. i am using Kernal 2.4.19.. please giude me..
Thank ... I am using 18.432 MHZ Clock now i need to generate 100 nanosecond delay through software. i am using Kernal 2.4.19.. please giude me..
Did you take a look at the nanosleep function?
Do you have experience in rebuilding your kernel? If you did so, do you know how to get the new kernel onto your device?
Did you take a look at the nanosleep function?
Do you have experience in rebuilding your kernel? If you did so, do you know how to get the new kernel onto your device?
i tried it bit didn't get in nanosecond... No i didn't rebuilding kernel... help me plese ...
i tried it bit didn't get in nanosecond... No i didn't rebuilding kernel... help me plese ...
If nanosleep does not give you the resolution you are looking for (probably gives 10ms resolution for you :P ) and you don't have the knowledge to rebuild your kernel, I would suggest you build yourself a function, which performs some rudimentary calculation and returns. This will be your no-op function, and it's sole purpose will be to take up a small amount of time (hopefully less than a nanosecond). You may want to set this as a macro as calling a function may push you over the time you want. What you will then do is call the linux program time (or the built in C timing functions) and use that to measure the amount of time your no-op function takes. Once you know this, you can semi-accurately judge how many will give you the 100 nanoseconds you need.
If nanosleep does not give you the resolution you are looking for (probably gives 10ms resolution for you :P ) and you don't have the knowledge to rebuild your kernel, I would suggest you build yourself a function, which performs some rudimentary calculation and returns. This will be your no-op function, and it's sole purpose will be to take up a small amount of time (hopefully less than a nanosecond). You may want to set this as a macro as calling a function may push you over the time you want. What you will then do is call the linux program time (or the built in C timing functions) and use that to measure the amount of time your no-op function takes. Once you know this, you can semi-accurately judge how many will give you the 100 nanoseconds you need.
Hi.. i am trying out these ... i heared about GAS ASSEMBLER but i don't where can get it, how to install it,how to use it and is it possible to write assembly code in GCC ? how to compile it?
Hi.. i am trying out these ... i heared about GAS ASSEMBLER but i don't where can get it, how to install it,how to use it and is it possible to write assembly code in GCC ? how to compile it?
Well, you could try using inline assembly in your C code, but I have no experience with this.
Well, you could try using inline assembly in your C code, but I have no experience with this.
I have one doubt that i tried nanosleep command but i got only in millisecond using C in GCC compiler if i use the GAS can i attain my gaol...
I have one doubt that i tried nanosleep command but i got only in millisecond using C in GCC compiler if i use the GAS can i attain my gaol...
Did you try inline ASM?
Did you try the "no-op loop?"
How many nanoseconds are you talking about? If you really mean one nanosecond then it isn't going to happen. Processor instruction time isn't that fast so even assembly can't do it.
GAS is the gnu assembler. You probably have AS on your machine which is the assembler for gcc, at least on FreeBSD it is. But, like I said, you won't get nanosecond measurement with that.
Did you try inline ASM?
Did you try the "no-op loop?"
S.. i mean the same ....i need 800ns delay...
How many nanoseconds are you talking about? If you really mean one nanosecond then it isn't going to happen. Processor instruction time isn't that fast so even assembly can't do it.
GAS is the gnu assembler. You probably have AS on your machine which is the assembler for gcc, at least on FreeBSD it is. But, like I said, you won't get nanosecond measurement with that.
i need a dealy of 800 ns... is it possible ???????
Take a look at this post, I think it has the information you are looking for.
I haven't delved into instruction timing in a long time but I don't think he can get 800ns out of any routine. But I don't know anything about an embedded system like this either. And to react to 800ns would be quite a task.
Can u help me how to rebuild the GCC and kernel...
Can u help me how to rebuild the GCC and kernel...
In all honesty, no, we cannot help you with that task.
The process of rebuilding your kernel is complicated and involves a lot of tuning and knowledge of your hardware; two things which only you (hopefully) will be able to do.
I would strongly suggest contacting the supplier and finding out if they have a toolkit you can use for building software on the processor, and seeing if they have any documentation for re-flashing the system. Another great idea would be to join the development mailing list for the device you are working with. Also, try some thorough Googling.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: richard |
last post by:
I am trying to do non-delay mode read from cin, i.e.
char ch;
...
while( cin.getch(ch) )
{
...
}
I want getch to return whenever there is a char typed (not wait till
a newline is seen).
|
by: amos_s12 |
last post by:
Hello everybody
Is there a possibility to make a delay between two sql statements,
namely one sql statement is performed, then there is a delay of some
seconds and then rhe next statement is...
|
by: Macgyver |
last post by:
Hi all,
does anyone know how to generate a millisecond delay in C, compiling
under Linux? I understand the function sleep() will generate a delay
down to a resolution of one second, but I need...
|
by: silveira neto |
last post by:
Using a delay in C, using Linux. gcc-3.3
This program do a boy in a bike runing in the screen. :D
Its cool to see about games and delay in C.
#include<stdio.h>
int branco(int j){
int k;
for...
|
by: John |
last post by:
Hi all:
Is there a C function to make a procedure sleep or delay for a few
seconds/minutes on Linux and Sun OS platform?
Thanks
|
by: qbin_wang |
last post by:
Hi:
now i want to download a free c complier which can be used in
windows system.and i see many posts in the comp.lang.c,but i don't find
the answer.who can tell me the true and correct website...
|
by: Rene Grothmann |
last post by:
I have managed to communicate between forms and Java applets. A button
press sends the content of the text area to an applet, a second button
gets some text from the applet and puts it into the...
|
by: ShawnD |
last post by:
I'm having some issues when trying to read input off of a pipe using a python script. I'm trying to process packet data from tcpdump in real-time, so it's a filter that needs to read data while the...
|
by: W.K. |
last post by:
Hello,
I have a question about using GNU C++ proprietary software
development, is this possible or against the GNU license? Any good
commercial cross platform complier recommendation ?
...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |