Shop OBEX P1 Docs P2 Docs Learn Events
Does Stamp sample along the order of microseconds? — Parallax Forums

Does Stamp sample along the order of microseconds?

thaimyshoe06thaimyshoe06 Posts: 3
edited 2010-03-25 04:04 in BASIC Stamp
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?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-03-24 13:42
    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.
  • thaimyshoe06thaimyshoe06 Posts: 3
    edited 2010-03-24 14:07
    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-24 14:27
    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.
  • thaimyshoe06thaimyshoe06 Posts: 3
    edited 2010-03-24 17:14
    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?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-25 04:04
    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.
Sign In or Register to comment.