Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 04-10-2017, 12:46 PM   #101 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Adafruit shield working

I have a demo MPiGuino sled running with the Adafruit LCD/button shield. Much nicer having only two wires (in addition to power and ground) to contend with. I changed the two zener diodes to 2.1v to avoid frying the 3.3v Pro Mini and will be testing it in-vehicle today. Because the Adafruit buttons do not generate a hardware interrupt there is no 'wake on button press' so I will verify wake on start.



T_Vago: Does ODO/Scratchpad add a known value to current or tank mileage? Asked another way, can I input mid-tank values from one MPGuino to another, so that I can switch Arduinos mid-tank, maintaining my current tank distance and tank fuel used?

  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (04-10-2017)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 04-10-2017, 04:25 PM   #102 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,761

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 797
Thanked 681 Times in 437 Posts
Quote:
Originally Posted by skybolt View Post
I have a demo MPiGuino sled running with the Adafruit LCD/button shield. Much nicer having only two wires (in addition to power and ground) to contend with. I changed the two zener diodes to 2.1v to avoid frying the 3.3v Pro Mini and will be testing it in-vehicle today. Because the Adafruit buttons do not generate a hardware interrupt there is no 'wake on button press' so I will verify wake on start.
Kewl! Let us know how it goes.



Quote:
Originally Posted by skybolt View Post
T_Vago: Does ODO/Scratchpad add a known value to current or tank mileage? Asked another way, can I input mid-tank values from one MPGuino to another, so that I can switch Arduinos mid-tank, maintaining my current tank distance and tank fuel used?
Not at this time. Guess I could add that as a compilable option, though, certainly, it would help with my own production/testbed MPGuino. Let me work on that.
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
Old 04-11-2017, 01:46 PM   #103 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Obeservation: Adafruit LCD does NOT like being powered from the Pi while getting data from the Arduino, even with common ground. Works fine until power from the Pi is interrupted and re-introduced (like getting back in the car and powering up the Pi). This results in garbled output to the LCD, which can only be fixed by powering down the Arduino and powering backup. The real fix is to supply voltage from the 5v regulator stepping down car current for the Arduino, which is capable of supplying current to the LCD. But, if there's a "oh no I just got powered up, let's see if I can re-initialize myself" function on the LCD, you should add it to the bottom of the list. (It's possible the Pi can be forced to supply too much current to the LCD though it's 5v pin, cooking the Pi's regulator. If this is the case then the LCD must be powered via a separate regulator and then this is a non-issue).
  Reply With Quote
Old 04-11-2017, 04:56 PM   #104 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,761

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 797
Thanked 681 Times in 437 Posts
Well, there's not a "oh no I just got powered up, let's see if I can re-initialize myself" possibility, as such. There is currently no way to tell whether the LCD got de-synched... Although I just thought of a possibility which might work.

In the meantime, you can force an LCD reset by cycling completely through the LCD brightness settings. Every time that "brightness 0" or "brightness off" is selected, MPGuino also forces an LCD hardware reset. I put that in a while back because every once in a great while, my own MPGuino display would get goobered up for no apparent reason.
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
skybolt (04-28-2017)
Old 04-27-2017, 04:45 PM   #105 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Adafruit shield working great, at least with debug readings. LCD init isn't an issue if LCD is powered from 7805, which works well. Warning: Do NOT use 12v input for Arduino Pro Mini 3.3v (even though the onboard voltage regulator clearly states 12v is acceptable). Fried many boards (regulator KB33).

Cannot compile 20170210 code, with #define useDebugReadings true enabled and #define useAdafruitRGBLCDmodule true enabled. (Your lines may vary as I added some LED blinking code to the JSON function so I could tell when the Arduino was active). Tried disabling #define useBufferedLCD true and #define useTWILCD true (in both locations including the define embedded in ifdef Adafruit ...).

I believe it's tied to your DevLCD code, which appears to be a placeholder for LCD code under development (like Adafruit!)

Compiler output:

Quote:
/var/folders/cq/lyq3h1cs7pqf_5f_vbg2jwwh0000gq/T/arduino_modified_sketch_427538/_20170210_-_mpguino_1.94_tav.ino: In function 'void LCD::writeNybble(uint8_t, uint8_t)':
_20170210_-_mpguino_1.94_tav:7512: error: 'asLCDdelayTimer' was not declared in this scope
initADC(asLCDdelayTimer);
^
_20170210_-_mpguino_1.94_tav:7512: error: 'initADC' was not declared in this scope
initADC(asLCDdelayTimer);
^
_20170210_-_mpguino_1.94_tav:7516: error: 'analogState' was not declared in this scope
while (analogState & asLCDdelayTimer) idleProcess(); // wait for LCD timer delay to complete
^
exit status 1
'asLCDdelayTimer' was not declared in this scope
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (04-29-2017)
Old 04-28-2017, 04:03 PM   #106 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,761

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 797
Thanked 681 Times in 437 Posts
Quote:
Originally Posted by skybolt View Post
Adafruit shield working great, at least with debug readings. LCD init isn't an issue if LCD is powered from 7805, which works well. Warning: Do NOT use 12v input for Arduino Pro Mini 3.3v (even though the onboard voltage regulator clearly states 12v is acceptable). Fried many boards (regulator KB33).

Cannot compile 20170210 code, with #define useDebugReadings true enabled and #define useAdafruitRGBLCDmodule true enabled. (Your lines may vary as I added some LED blinking code to the JSON function so I could tell when the Arduino was active). Tried disabling #define useBufferedLCD true and #define useTWILCD true (in both locations including the define embedded in ifdef Adafruit ...).

I believe it's tied to your DevLCD code, which appears to be a placeholder for LCD code under development (like Adafruit!)
I just downloaded and attempted to compile the 20170210 code, with useDebugReadings and useAdafruitRGBLCDmodule enabled. It compiled successfully.

Can you upload here what you have?
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
Old 04-29-2017, 02:00 AM   #107 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Let me try with a fresh copy of 20170210. In the meantime, here's what I am trying to compile:
Attached Files
File Type: zip skybolts_crash_20170210.c.zip (84.4 KB, 4 views)
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (04-29-2017)
Old 04-29-2017, 02:23 AM   #108 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Line 276, I didn't have a board set --- needed to uncomment #define useLegacyBoard true, then it compiles without having debugReadings true. But, then the Adafruit LCD now longer shows any output, just 1 line of black boxes. If I take back out useLegacyBoard and put back in useDebugReadings, the Adafruit LCD works again.

So:
legacyboard = true + useAdafruit + debugReadings false = no display

Nothing set for board (all four board lines around 276 commented out) + useDebugReadings + useAdafruitLCD works, but only with debug readings.

Nothing set for board + useAdafruitLCD + debugReadings commented out = won't compile.

UseLegacyBoard + UseClassicLCD (sic) + debugReadings commented out = compiles and sends readings to the Pi (though possibly inaccurate readings, but that could be my 3.3v zener diodes)

Note: using an 8MHz Pro Mini, with board set to "Arduino Pro or Pro Mini". Arduino 1.8.1, with fairly recent bot not completely recent board definitions. (Last time I updated boards in Feb, lots of things broke).
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (04-29-2017)
Old 04-29-2017, 03:24 AM   #109 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,761

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 797
Thanked 681 Times in 437 Posts
Code:
#ifdef useAnalogLCDdelay
#define useAnalogInterrupt true
#endif // useAnalogLCDdelay
Move this block from line 576 of your code to line 607. Your code will compile successfully after you do this. What is happening is that, for the useAdafruitRGBLCDmodule #define, the useAnalogLCDdelay #define is getting set to true after the above processor directive is compiled. When this occurs, the analog interrupt handler section never gets compiled in, and since the analog interrupt handler section is required for generating LCD hardware delays, the compile fails as you have described. When the useDebugReadings #define is set to true, it masks this error.

Not sure how the Arduino digitalWrite functions will interact with the MPGuino code, but I do not think they'll be a problem.
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
Old 04-29-2017, 01:25 PM   #110 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Great! Thanks - it tcompiles and I will test it in-vehicle shortly. I expect the instrument readings to be the same as using legacy code (which is giving me anomalous results, but again that is likely tied to the lower voltage zener diodes).

(Note: LCD is monochrome without bg color option - oh the tragedy of 1st world problems) ERROR - scratch that, LCD parameter was set to 99, from the old CONTRAST location. LCD color works great.

current settings and behavior:

Code:
276:
//#define useLegacyBoard true

294:
#define useAdafruitRGBLCDmodule true
cut code snipped from 576 and moved it to the new 607 (shifted 4 lines down from 612 after the cut from 576). Tried a few things (commented out 576, added it to 607, etc. - behavior seems consistent.

  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (04-30-2017)
Reply  Post New Thread


Thread Tools




Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com