EmbeddedRelated.com
Forums

Programming in Microseconds...?

Started by carmengillette April 20, 2004
Hi

I am trying to set up a real-time program in microseconds instead of
milliseconds. I am using dynamic C. I see that they have delays in
Milliseconds. (Ex. (DelayMs) ). And also I can access the system
clock using MS_TIMER. Does anyone know of anyway to access the
system clock in microseconds? I attempted simply dividing by 1000
but I would need to use a long double for this and Dynamic C appears
to give a compile error when using long double.

Thanks


Make sure you know what to expect from Rabbit. At 22MHz, simple processor
instructions can last several microseconds, so you may have to use pure
assembly language, and program delays with counting clock cycles.

See previus post "Is rabbit too slow" - it's good starting point as what to
expect.

-----Original Message-----
From: carmengillette [mailto:gillet37@gill...]
Sent: Wednesday, April 21, 2004 3:48 AM
To: rabbit-semi@rabb...
Subject: [rabbit-semi] Programming in Microseconds...? Hi

I am trying to set up a real-time program in microseconds instead of
milliseconds. I am using dynamic C. I see that they have delays in
Milliseconds. (Ex. (DelayMs) ). And also I can access the system
clock using MS_TIMER. Does anyone know of anyway to access the
system clock in microseconds? I attempted simply dividing by 1000
but I would need to use a long double for this and Dynamic C appears
to give a compile error when using long double.

Thanks

Yahoo! Groups Links


George is right, I did a project to determine the count from 3-phase power zero-crossing and I had to do all of the code in assembly and count the clocks, keeping all of the jumps equal in length for every possible execution path.

 

What I ended up doing is to run three separate PIC MPU (one on each phase) which ran at 40 MHZ and programmed these devices in assembly, which freed up the rabbit for doing all of the user interfacing and calculating offsets for the PIC’s to used all interconnected via RS232C.

 

I learned a long time ago that pre-processing saves a lot of development time and the PIC’s are not expensive to implement.

 

You could use all ZWorld Cores, overkill but possible!

 

 

 

 

IDE Solutions, Inc.

j...@idesolutions.us

Jim Ashby, CEO, President

901 FM517 RD. W., Suite 805

Dickinson, Texas 77539-4066

 

(832) 512-8083 Cell/Voice Mail

(281) 534-3076 Fax

 

DISCLAIMER: The information in this email is confidential. The contents may not be disclosed or used by anyone other than the addressee.  If you are not the intended recipient(s), any use, disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you have received this communication in error please notify us by e-mail or by telephone at (832) 512-8083 and then delete the e-mail and all attachments and any copies thereof.

IDE Solutions, Inc. cannot accept responsibility for the accuracy or completeness of this email as it has been transmitted over a public network.  If you suspect that the email may have been intercepted or amended, please call the sender.  Any views expressed by an individual in this email do not necessarily reflect views of IDE Solutions, Inc.  This communication is from IDE Solutions, Inc. a corporation registered in the United States of America in the Great State of Texas with a registered office at 901 FM 517 West, Suite 805, Dickinson, Texas 77539-4066

 

 

-----Original Message-----
From: George Georgiev [mailto:g...@sbcglobal.net]
Sent: Tuesday, April 20, 2004 7:55 PM
To: r...@yahoogroups.com
Subject: RE: [rabbit-semi] Programming in Microseconds...?

 

Make sure you know what to expect from Rabbit. At 22MHz, simple processor
instructions can last several microseconds, so you may have to use pure
assembly language, and program delays with counting clock cycles.

See previus post "Is rabbit too slow" - it's good starting point as what to
expect.

-----Original Message-----
From: carmengillette [mailto:g...@hotmail.com]
Sent: Wednesday, April 21, 2004 3:48 AM
To: r...@yahoogroups.com
Subject: [rabbit-semi] Programming in Microseconds...? Hi

I am trying to set up a real-time program in microseconds instead of
milliseconds.  I am using dynamic C.  I see that they have delays in
Milliseconds.  (Ex. (DelayMs) ).  And also I can access the system
clock using MS_TIMER.  Does anyone know of anyway to access the
system clock in microseconds?  I attempted simply dividing by 1000
but I would need to use a long double for this and Dynamic C appears
to give a compile error when using long double.

Thanks

Yahoo! Groups Links