Shop OBEX P1 Docs P2 Docs Learn Events
Will my BS2 Stamp work for prototyping an automotive ignition circuit? — Parallax Forums

Will my BS2 Stamp work for prototyping an automotive ignition circuit?

Dan MDan M Posts: 4
edited 2006-04-28 21:35 in BASIC Stamp
Hello, I'm new to microcontrollers and I just picked up a Basic Stamp kit from radioshack. I bought it to interface with a GM 7 pin HEI module (actually 2 of them).

I know the stamp can send and recieve the signals I need, but I don't know if it can do it fast enough. Here's what has to happen:

sense trigger signal from pickup coil one (this is already a TTL logic level)
sense trigger signal from pickup coil two
calculate miliseconds between them
do a table lookup to determine how long to delay the next event
send TTL low to HEI module one (based on table lookup)
sense trigger signal from pickup coil one and calculate miliseconds between the previous signal
calculate miliseconds between them
do a table lookup to determine how long to delay the next event
send ttl low to HEI module two

lather, rinse, repeat smile.gif

I have maybe 2-6 milliseconds to work with at maximum RPM (I think, I haven't measured this out yet)

Eventually there will be a third input, a vaccum (MAP) sensor that gets included in the table lookup portion.

Can my basic stamp handle prototyping something like this?

Thanks,

Dan

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-04-28 15:20
    Not really.

    This particular application has a 'hard' real-time goal. The BS2 takes about 500 uSec per instruction executed. So you could execute MAYBE 12 instructions in your 6 millisecond time window.

    If you were really-really lucky, this application MIGHT be do-able. But you're operating on the hairy edge of what the BS2 is capable of.

    On the other hand, an SX based solution should work fine.
  • Dan MDan M Posts: 4
    edited 2006-04-28 15:58
    oh...bummer. The SX solution, I've seen that advertised on the main parallax site. Is that something user friendly to program like the stamp?

    Dan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-04-28 16:04
    The BS2p is the fastest -- 12,000 instructions / sec (84 usec / instr.)

    Yes?· No?
  • Dan MDan M Posts: 4
    edited 2006-04-28 16:23
    You know, I could just slow the rpms down in the test phase and do development that way.


    How hard would it be to move my code to the SX chip?

    Dan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-04-28 17:19
    SX isn't STAMPing, it's not PBASIC, it's pretty much different.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-28 19:12
    PJ Allen said...
    The BS2p is the fastest -- 12,000 instructions / sec (84 usec / instr.)
    Yes?· No?
    BS2px is fastest...19,000 instructions/second.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-04-28 19:50
    Well, sink me.· blush.gif

    19,000 -- OK, that's 53 usec / instruction, that's almost 19 in 1msec.

    Is that enough for Dan M's project?· Over to you, Dan M.
  • Dan MDan M Posts: 4
    edited 2006-04-28 21:35
    well I need to read and write to the control lines a total of 4 times in 5 mSecs - but at that speed I don't need to do a table lookup because I'm past a threshold - which happens when the duration between pulses is 6 mSecs.

    So basically at my highest rpm point with the table lookup I'll be doing this:

    time pulse 2 relative to pulse 1
    determine that it is within range to do the needed table lookup
    read in from map sensor
    do table lookup
    begin the ouput pulse and hold it until x amount of time passes (the time I looked up in the table)

    Now I don't know what the definition of an instruction is for the stamp - is it something like a table lookup or a math function? sounds like with 1/2 mSec per instruction I probably can't do this. It'll still give me something to play with for a while.

    I was also wondering if this is the type of application that would benefit from interrupts?

    Dan
Sign In or Register to comment.