View Full Version : Does Stamp sample along the order of microseconds?
03-24-2010, 08:39 PM
I'm working on a project in which Stamp will take an 8 ms pulse, calculate its energy (E = V^2 * t / R), and output the value on a display. In order to calculate energy accurately, Stamp must take data points on the order of 10's of microseconds. Does anyone know if Stamp is capable of this?
03-24-2010, 09:42 PM
Your question is a little confusing.
You say you need to "take an 8 mSec" pulse, but must "take data points on the order of..." something. Perhaps you mean "with a resolution of" 10's of microseconds.
I think the resolution of the PULSIN statement is 2 uSec, so that could work for you. However, the BS2 only cycles at a 2000 Basic Instructions Per Second, so you'll only be able to take that 8 mSec +- measurement every 20 milliseconds (estimated) or so.
If that will work for you, then the BS2 can do it.
03-24-2010, 10:07 PM
Thanks for the response, Allan. Yes, you were right in saying I need a resolution of tens of Ás. The PULSIN statement gives me the resolution I need, but doesn't it only give me the width of my pulse? For instance, if I am monitoring a voltage vs. time curve and I need to store the voltage values at every 10 Ás, it looks like the PULSIN statement would just tell me that my pulse is 8 ms.
03-24-2010, 10:27 PM
Yes, the PULSIN statement will only give you the width of the input pulse to a resolution of 2us. The Stamp can only do this about once every few hundred us since the minimum execution time for very simple statements is about 140us. It's really not suitable for this project.
A Propeller would be a much better choice for this sort of measurement. It has a program-accessible system clock with a resolution of 12.5ns and it can do its own ADC with better than 8 bit resolution at a 10us sample rate (with a few external resistors and capacitors). You'll need an external sample and hold circuit.
03-25-2010, 01:14 AM
Thank you Mike. I had a feeling the Stamp would not work for this project. Could you give me more information about the Propeller, such as a link to specs?
03-25-2010, 12:04 PM
Look at the Propeller downloads page on Parallax's website. You can download everything from the datasheet to the Reference Manual. Also checkout the Propeller forum, particularly the FAQ "sticky thread" at the top of the forum thread list.