01-20-2014, 10:00 PM
|
#1 (permalink)
|
Master EcoModder
Join Date: Dec 2011
Location: New Zealand
Posts: 5,077
Thanks: 2,903
Thanked 2,560 Times in 1,586 Posts
|
MPGuino suddenly giving weird readings
First off, this is a prebuilt unit from a member on this forum.
Recently my MPGuino has been giving very weird readings. My wife said it slid off the steering column when she went around a corner (trying to conserve speed ) but that it didn't hit anything, just ended up dangling by the wires. Here's a sample of the readings:
At first I thought maybe she had inadvertently altered some of the settings, but upon checking, everything seems right. Closer inspection revealed that "tank" and "current" readings are correct, but anything based off of "instant" is very wrong. Gallons per hour always reads between 15 and 17, and instant MPG shows up as being around 2. So, what I'm thinking is somehow the ROM got corrupted.
I hooked up a second unit that I built myself from an arduino and all of the readings were normal, so there's nothing wrong with my vss or injector lines. I briefly gave consideration to the resistor at the end of my injector line having gone bad, but again, "current" and "tank" readings are still reliable.
I suppose my question is this: is it possible, or even likely from my description, that the ROM has been corrupted? Can I just swap the ROM chip from my arduino and see if it works?
EDIT: For the life of me I can't remember who I got my MPGuino from. Does anyone know who built the units with the blue plastic housing for the inputs?
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
01-21-2014, 12:08 PM
|
#2 (permalink)
|
MPGuino Supporter
Join Date: Oct 2010
Location: Hungary
Posts: 1,807
iNXS - '10 Opel Zafira 111 Anniversary Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
|
I don't think the ROM got corrupted, but certainly the circuit board itself may have cracked when your pre-built MPGuino slid off. Your tank and current trip readings are directly based off your instant readings, but they can more-or-less read correctly even if your instant readings are off. IIRC, this was because the older code version had different display routines for instant readings than for current and tank trip readings.
You can certainly swap the AtMega chips between your pre-built MPGuino and your Arduino (assuming both are using AtMega 168/328 chips). Not sure what crystal your pre-built MPGuino is using, but Arduinos usually use 16 MHz crystals.
|
|
|
The Following User Says Thank You to t vago For This Useful Post:
|
|
01-22-2014, 01:35 AM
|
#3 (permalink)
|
Master EcoModder
Join Date: Dec 2011
Location: New Zealand
Posts: 5,077
Thanks: 2,903
Thanked 2,560 Times in 1,586 Posts
|
I switched out the ROM from my Arduino, flashed with this code:
http://opengauge.googlecode.com/svn/...no/mpguino.cpp
After taking it apart, I couldn't see any visible damage to anything. Upon starting it up, I realized that it most definitely was not the same version of code that it shipped with - brightness is inverted (3 is dimmest, 0 brightest) and the buttons are a lot less... responsive, so perhaps the unit I have had your modified code already.
The results of the new chip: gallons per hour reads properly, but I can't get it to read the VSS now. Or, perhaps, I can't find a VSS delay setting that works properly? With a delay of 2ms I get a reading but it's low by about 20%, while a setting of ~250 (like I was using before) gives no reading at all.
I will probably figure it out before you respond (by reading your thread properly) but I can't flash your code with the Arduino software.
EDIT: Line 225 ^^
EDIT2: "#define useLegacyLCDinvertedBrightness true" doesn't seem to fix the inverted brightness settings. I also tried manually changing "const uint8_t brightness[] PROGMEM = { 0, 41, 84, 128 }" to "{ 255, 170, 85, 0 }" to no avail.
Last edited by Ecky; 01-22-2014 at 02:36 AM..
|
|
|
01-22-2014, 03:39 PM
|
#4 (permalink)
|
MPGuino Supporter
Join Date: Oct 2010
Location: Hungary
Posts: 1,807
iNXS - '10 Opel Zafira 111 Anniversary Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
|
Quote:
Originally Posted by Ecky
I switched out the ROM from my Arduino, flashed with this code:
http://opengauge.googlecode.com/svn/...no/mpguino.cpp
After taking it apart, I couldn't see any visible damage to anything. Upon starting it up, I realized that it most definitely was not the same version of code that it shipped with - brightness is inverted (3 is dimmest, 0 brightest) and the buttons are a lot less... responsive, so perhaps the unit I have had your modified code already.
The results of the new chip: gallons per hour reads properly, but I can't get it to read the VSS now. Or, perhaps, I can't find a VSS delay setting that works properly? With a delay of 2ms I get a reading but it's low by about 20%, while a setting of ~250 (like I was using before) gives no reading at all.
I will probably figure it out before you respond (by reading your thread properly) but I can't flash your code with the Arduino software.
EDIT: Line 225 ^^
EDIT2: "#define useLegacyLCDinvertedBrightness true" doesn't seem to fix the inverted brightness settings. I also tried manually changing "const uint8_t brightness[] PROGMEM = { 0, 41, 84, 128 }" to "{ 255, 170, 85, 0 }" to no avail.
|
Code:
*/
// if the below "#define"s are commented out, code will compile for an AtMega328-series processor
//#define ArduinoMega2560 true
//#define TinkerkitLCDmodule true
// if the below #define is commented out, 16 MHz system clock will be assumed
//#define use20MHz true // force 20 MHz system clock values
// only one of the below LCD options may be chosen - choosing more than one will cause a compilation error to occur
// if TinkerkitLCDmodule is used, useLegacyLCD will automatically be used, and the below options will be ignored
#define useLegacyLCD true
//#define useParallaxLCD true
// only one of the below button options may be chosen - choosing more than one will cause a compilation error to occur
#define useLegacyButtons true
//#define useAnalogMuxButtons true
//#define useParallax5PositionSwitch true
// the below options only work if useLegacyLCD is selected. If useLegacyLCD is not selected, the below options will not be inserted at all
//#define useLegacyLCDinvertedBrightness true // For alternate LCD backlight connections
#define useLegacyLCDbuffered true // Speed up LCD output
Starting at line 223, does your code look like the above?
|
|
|
01-22-2014, 04:07 PM
|
#5 (permalink)
|
Master EcoModder
Join Date: Dec 2011
Location: New Zealand
Posts: 5,077
Thanks: 2,903
Thanked 2,560 Times in 1,586 Posts
|
Quote:
Originally Posted by t vago
Code:
*/
// if the below "#define"s are commented out, code will compile for an AtMega328-series processor
//#define ArduinoMega2560 true
//#define TinkerkitLCDmodule true
// if the below #define is commented out, 16 MHz system clock will be assumed
//#define use20MHz true // force 20 MHz system clock values
// only one of the below LCD options may be chosen - choosing more than one will cause a compilation error to occur
// if TinkerkitLCDmodule is used, useLegacyLCD will automatically be used, and the below options will be ignored
#define useLegacyLCD true
//#define useParallaxLCD true
// only one of the below button options may be chosen - choosing more than one will cause a compilation error to occur
#define useLegacyButtons true
//#define useAnalogMuxButtons true
//#define useParallax5PositionSwitch true
// the below options only work if useLegacyLCD is selected. If useLegacyLCD is not selected, the below options will not be inserted at all
//#define useLegacyLCDinvertedBrightness true // For alternate LCD backlight connections
#define useLegacyLCDbuffered true // Speed up LCD output
Starting at line 223, does your code look like the above?
|
I'll try that, I was flashing the following:
Code:
*/
// if the below "#define"s are commented out, code will compile for an AtMega328-series processor
//#define ArduinoMega2560 true
//#define TinkerkitLCDmodule true
// if the below #define is commented out, 16 MHz system clock will be assumed
//#define use20MHz true // force 20 MHz system clock values
// only one of the below LCD options may be chosen - choosing more than one will cause a compilation error to occur
// if TinkerkitLCDmodule is used, useLegacyLCD will automatically be used, and the below options will be ignored
#define useLegacyLCD true
//#define useParallaxLCD true
// only one of the below button options may be chosen - choosing more than one will cause a compilation error to occur
//#define useLegacyButtons true
//#define useAnalogMuxButtons true
#define useParallax5PositionSwitch true
// the below options only work if useLegacyLCD is selected. If useLegacyLCD is not selected, the below options will not be inserted at all
//#define useLegacyLCDinvertedBrightness true // For alternate LCD backlight connections
//#define useLegacyLCDbuffered true // Speed up LCD output
EDIT: Brightness is still inverted after flashing, with or without "#define useLegacyLCDinvertedBrightness true" commented out.
EDIT2: It seems I had a wire come loose in my arduino-based testbed and that's why the brightness was wonky. Testing out my prebuilt again shortly.
Last edited by Ecky; 01-22-2014 at 05:08 PM..
|
|
|
The Following User Says Thank You to Ecky For This Useful Post:
|
|
01-22-2014, 10:10 PM
|
#6 (permalink)
|
Master EcoModder
Join Date: Dec 2011
Location: New Zealand
Posts: 5,077
Thanks: 2,903
Thanked 2,560 Times in 1,586 Posts
|
It seems everything is working after reflashing. Thanks for the code! ^^
|
|
|
01-22-2014, 10:18 PM
|
#7 (permalink)
|
MPGuino Supporter
Join Date: Oct 2010
Location: Hungary
Posts: 1,807
iNXS - '10 Opel Zafira 111 Anniversary Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
|
Quote:
Originally Posted by Ecky
It seems everything is working after reflashing. Thanks for the code! ^^
|
Glad to hear it! I will post an update to my thread, that has the legacy MPGuino hardware enabled by default.
Is your original issue fixed?
|
|
|
01-23-2014, 08:33 AM
|
#8 (permalink)
|
Master EcoModder
Join Date: Dec 2011
Location: New Zealand
Posts: 5,077
Thanks: 2,903
Thanked 2,560 Times in 1,586 Posts
|
Quote:
Originally Posted by t vago
Glad to hear it! I will post an update to my thread, that has the legacy MPGuino hardware enabled by default.
Is your original issue fixed?
|
It is, actually.
Do I need to make any code changes to get it to read properly from my arduino-based unit, or will it detect the 16mhz oscillator by itself? I haven't checked the readings on it yet.
|
|
|
|