View Single Post
Old 02-02-2009, 11:07 AM   #801 (permalink)
needs more cowbell
dcb's Avatar
Join Date: Feb 2008
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
updates for v0.75

added the instant gph fix per fx57.

updates for v0.74

added a small serial transmitter function. The guino now outputs the following data over the serial port at 9600 baud every half second:
instantmpg,instantmph,instant.injHius,instant.injP ulses,instant.vssPulses

So "realtime" laptop/cellphone integration should be a snap if your guino has a usb/rs232 connection or you can build one and you can gather the data on the laptop/cellphone. This also has applications for remote displays.

I also added a #define usedefaults so that you can build the guino without a lcd if you intend to only use it with a laptop/cellphone. It will simply skip the setup screen/loading of eprom values.

Since all the interesting data is already going over the serial port now, I removed the debug ifdef branching.

updates for v0.73

added large comment about only running on arduino 0011 to top of program

fixed strange instant bignum eoc display

added VSS Delay ms setup parm (default to 2, can set to 0 but distance accuracy may suffer)

added "move to next field" in editor, press left and right simultaneously to move to OK, XX, first digit.

replaced RPM with GPH on custom screen, more universal.

Updated eprom loader/saver. Keeps track of number of parameters in eprom so a new version can default new setup parameters.

updated addEvent to just call the event if time parameter is 0

updates for v0.72

to get to setup, use left and right buttons now. No middle button there, so less accidental resetting of current or tank trip.

Added eoc miles/Idle gallons screen after tank data. Tracked for current and tank. Layout:
Current EOC Miles, Current idle Gallons
Tank EOC Miles, Tank idle Gallons

removed raw screens

default contrast set for green display 95

Default to metro values, 500000000 us/Gallon, 8208 vss pulses/mile, 3 pulses/2 revolutions

instantmpg returns 999999 in eoc now

used ishi's formatter, and jmilk's brightness suggestion to get it to fit.

sketch 14104 bytes, 303 bytes ram free, cpu %51

updates for v0.71

1. Settled on 1/2 second average for vss. Metro is reasonably smooth now.

2. Added Custom screen as first screen with following layout.
Tweak doDisplayCustom function to put different values if you like.

3. Added rpm (you have to get the pulses per 2 revolutions parm right)

4. Added instant gph function (not displayed by default)

Notes, instant mph is a small bit wobbly on the signal generator and rpm also seems to read a bit high. But it is definitely an improvement.

I also had to ifdef out tons of stuff when in debug mode just to get the Serial library to fit. So bignumbers and parameter editor won't work in debug mode as-is.

sketch size: 13814 bytes, free mem 325, CPU% 52.42. We are for all practical purposes at the limit without a major re-write or some serious optimization and retest work, or an atmega328, or?

updates for v0.70

More experiments with vss processing. Instant mph is very smooth on saturn but still jumps a bit on the metro. Distance reading on metro appears reasonably accurate (102.6 miles on odo, 102.18 on mpguino using 8208 vsspulses/mile). So the guino is doing a pretty good job of counting the vss pulses, it is a little erratic in timing the pulses though.

want to add EOC miles to the trip next, don't know if it will fit
sketch size: 12884

updates for v0.69

Added event handler and added debouncing on vss. Still trying to clean up reed switch vss signal via software with no luck. will make separate post for vss issue.

Added instantaneous mph (mpg is next), this looks at the time between vss peaks to determine the speed instead of the number of pulses in the last half second, which was jumpy at slow speeds. We are getting really really tight on space. That might also be an issue when 0012 comes out (don't know when).

updates for v0.68

Removed all dependencies on timer0 so we should be arduino 0012 compatible. This also establishes an ISR under our control for scheduling events. Disabled Timer0 so use millis2(), delay2(), etc.

Knocked off a few hundred bytes by converting LCD to a namespace instead of a class.

updates for v0.67

Incorporated LCD timings from Yoshi, removed pin 15 code and power up detection code.

moved source code to google/svn Revision 32: /trunk

other happenings:
did a test with the scope regarding the voltage drop at peak pulse. I had the guino set a pin high and low within the interrupts receiving high and low and the pulse widths were the same except the generated one was perfectly square. So that is a good thing. Will need to test exactly what voltage level is acceptable.

The power supply on the scope died I think I just need a new TL431C or NTE999 though. I didn't get a chance to witness the vss bounce, the scope died during the attempt.

I am planning on moving all timing critical code to timer 2 with an event handler. I need real interrupt style debouncing for the vss and might as well use it as an event scheduler for debouncing the buttons as well as whatever else. This move will also allow for arduino0012 compatability.

updates for v0.66

ADDED AN ONBOARD VARIABLE EDITOR!!! VARIABLES STORED IN EEPROM!! Now you can upgrade and not lose your settings and make adjustments in the car. Refer to post 1[/url] for screens and edit usage.

Updated screens descriptions in post 1

Checked source into, linked post 1 to sourceforge (ran out of room again and wiki didn't like the extension .pde).

Sketch size 11734, 448 bytes free

updates for v0.65

Added 7 minute activity timeout. It saves the state of the persistent trips (just tank for now) at the point of last activity and after 7 minutes of no injector pulses/vss pulses/or button presses, it turns off the LED backlight and sets up current to be reset and tank to be restored when activity resumes.

Despazed the buttons and Screen labels so they display for a second and accidental double button presses are minimized.

Running out of excuses (and room) to no do the user input/eprom setup screen thing Sketch size 10502 bytes.

updates for v0.64

Fixed instant/tank screen (was displaying instant/current on that screen).

Improved LCD reinit on reprogram/reset. Can (usually) tell if LCD needs reinitializing. Press left and right buttons to force an LCD init if necessary. Want to free pin 15 for future tasks if it works well enough.

Added a bit of default verbiage to debug mode.

Working on a portable scope deal.

updates for v0.63
Wrote 64bit arithmetic routines, yay no more messing with "ifs" when it should be math!

Noticed double vss count didn't make it in .62, fixed.

Subtracting 500uS from each injector pulse.

Added cli/sei around top of loop trip copy.

Made big font a smidgeon bolder.

Code updated, sketch size 9812, CPU 54%, free mem 602

previous updates

  Reply With Quote