Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Collateral Damage
Jun 13, 2009

Shouldn't be a problem. You don't need to digitalRead() every revolution, you just attach the sensor to an interrupt, then on each loop through the main code you check the interrupt counter and derive the rpm from that.

See http://playground.arduino.cc/Main/ReadingRPM

Adbot
ADBOT LOVES YOU

Collateral Damage
Jun 13, 2009

At 12k RPM you'd need an ignition pulse every 5ms. The Arduino Uno board is a 16Mhz CPU which is still going to let you do things in the microsecond range if not better. Some of the stock Arduino functions are a bit slow (because they do a bunch of idiot-proofing checks on each call), but there are ways to work around that if needed.

Collateral Damage
Jun 13, 2009

What Arduino board do you plan on using?

Or I guess I should ask what AVR, since I assume you're going to make your own board down the line if it works.

Collateral Damage
Jun 13, 2009

Rev. Dr. Moses P. Lester posted:

I have an uno now, it looks like it'll do what I need. All I need is one digital input pin and one digital output pin, really. I'm probably not planning on replacing it with a proper board unless someone in the club cries foul on the setup. (The Arduino itself is clearly not period appropriate equipment for 1983, but the rules in this class are very short and vague) I want to be able to easily change the software map in the future if I alter the ports/exhaust/intake/piston.
The code itself looks OK. If you find that it can't keep up because digitalWrite takes too much time, you can try one of the high performance IO libraries for Arduino, or just do low-level calls on your own.

There are probably some people over in the Arduino thread who are much better at optimization than I am who can tell you if there are any other performance pitfalls.

Collateral Damage fucked around with this message at 02:44 on Jan 18, 2016

Collateral Damage
Jun 13, 2009

Rev. Dr. Moses P. Lester posted:

Ugh I have to talk to Arduino nerds? I got into motorcycles specifically so I wouildn't have to do that.
Then trying to build an ECU on an Arduino might be the wrong route. :v:

You can always go talk to noisymime in the DIY ECU thread that babyeatingpsychopath linked.

  • Locked thread