473,507 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

repeated readings

Hello,
i need to read from a variable every 'x' microseconds. Someone can help
me?

Thanks!

Jan 22 '07 #1
5 1282
"Lowell" <lo****@katamail.comwrites:
i need to read from a variable every 'x' microseconds. Someone can help
me?
Maybe you could explain what difficulty you're having. But I
should warn you, first, that the standard C language and library
don't provide much support for this kind of thing. You're likely
to need to resort to implementation-specific constructs, which
are more likely to be handled well by a newsgroup specific to
your implementation than by comp.lang.c.
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p[i]\
);}return 0;}
Jan 22 '07 #2
Lowell wrote:
Hello,
i need to read from a variable every 'x' microseconds. Someone can help
me?

Thanks!
If you're developing under POSIX use the nanosleep() function. For
further details, since pure ISO C, the topic of this group, has no
reliable method for pausing program execution for microseconds,
followup in comp.unix.programmer.

Jan 22 '07 #3

"Ben Pfaff" <bl*@cs.stanford.eduha scritto nel messaggio
news:87************@blp.benpfaff.org...
"Lowell" <lo****@katamail.comwrites:
> i need to read from a variable every 'x' microseconds. Someone can
help
me?

Maybe you could explain what difficulty you're having. But I
should warn you, first, that the standard C language and library
don't provide much support for this kind of thing. You're likely
to need to resort to implementation-specific constructs, which
are more likely to be handled well by a newsgroup specific to
your implementation than by comp.lang.c.
--
int main(void){char
p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int
putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof
p-1;putchar(p[i]\
);}return 0;}

I use a DSP (ADSP 2181) and i must read from data bus and put the data into
array every 'x' microseconds. I believed that ansi C supported this
function...
Thanks however...
Jan 22 '07 #4
Lowell wrote, On 22/01/07 18:56:
"Ben Pfaff" <bl*@cs.stanford.eduha scritto nel messaggio
news:87************@blp.benpfaff.org...
>"Lowell" <lo****@katamail.comwrites:
>> i need to read from a variable every 'x' microseconds. Someone can
help
me?
Maybe you could explain what difficulty you're having. But I
should warn you, first, that the standard C language and library
don't provide much support for this kind of thing. You're likely
to need to resort to implementation-specific constructs, which
are more likely to be handled well by a newsgroup specific to
your implementation than by comp.lang.c.
--
int main(void){char
p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int
putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof
p-1;putchar(p[i]\
);}return 0;}
Please don't quote people signatures (the bit after the "-- ") unless
you are commenting on them.
I use a DSP (ADSP 2181) and i must read from data bus and put the data into
array every 'x' microseconds. I believed that ansi C supported this
function...
Thanks however...
You believe wrong.

The C standards say that the implementation defines what you get when
casting an integer to a pointer, and this will probably get you part way
there if your "data bus" is mapped in to part of the address space you
can read. The volatile qualifier will also probably be needed, although
again the standards leave a significant amount about this implementation
defined. On the other hand, the standard will not help you at all with
the "every 'x' microseconds" bit of your problem.

You would probably be better off asking somewhere like
comp.arch.embedded, although if you don't show any sign of having made
some attempt and don't say what part you are having difficulty with I'm
not sure how helpful they will be.
--
Flash Gordon
Jan 22 '07 #5

Lowell wrote:
Hello,
i need to read from a variable every 'x' microseconds. Someone can help
me?

Thanks!
I think you can use signals...But, at the same time I will caution you
that It is not safe to use signals always.So it depends on your problem
you want to solve.

Regards,
Raman Chalotra

Jan 23 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
10544
by: Leif K-Brooks | last post by:
How do I make a regular expression which will match the same character repeated one or more times, instead of matching repetitions of any (possibly non-same) characters like ".+" does? In other...
0
625
by: Wolfgang Lipp | last post by:
From: Lipp, Wolfgang Sent: Tuesday, 27?January?2004 13:26 <annotation> the first eleven contributions in this thread started as an off-list email discussion; i have posted them here with...
15
1479
by: Robert Sturzenegger | last post by:
// Code sequence A for (int i = 0; i < 10; ++i) { int k = something(); // some more code which uses k } // Code sequence B int k; for (int i = 0; i < 10; ++i) { k = something();
2
1332
by: RingTone | last post by:
SQL Server 2000/Access 2000 linked tables PK = FLOOR/DESK NO/TYPE A User has complained about seeing data below simply by scrolling through the attached table, the data is there when you look at...
1
1856
by: Alec MacLean | last post by:
Hi, Outline of problem: I've built a set of user controls that are used to output questions for a survey and gather the responses using simple radio buttons. I'm adding an optional textbox...
3
1366
by: IraqiAli | last post by:
ok i have a couple of textboxes. The user is required to input values from 1 to 6 into those boxes. and submit it, those values would then go into an array. What i need to do is do checks to make...
7
1670
by: bagelman | last post by:
Hi, I have a string Array. Its length is 100. I want to search the array to find repeated strings in it. And after finding repeated strings I want to write to screen which word repeated how many...
7
3491
by: mcha226 | last post by:
Hi All I have to build a page which includes a select element (as a drop down menu) with all the country names in it. However I just found out that the need to be repeated many times so the...
1
1232
by: phanigamini | last post by:
Hi, I have a column like product name where in i want to retrive repeated words in the same row. Ex: Table Name: product_tbl Column Name: productname data: xyz and abc and ltd Here the...
9
2981
by: C#_Help_needed | last post by:
I need help with the following question. THANKS :) Write a program in c# that takes in a directory as a command line parameter, and returns the longest repeated phrase in ALL text files in that...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.