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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 02-23-2010, 01:53 AM   #61 (permalink)
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
Buttons used to give me problems too, the first time around. Instead of buying new ones, i salvaged them off old junk. For some reason, the first time using them on the guino, one or more of them were constantly "on", so when i would hit Left, it would think i hit Left+Right or Left+Middle or whatever, and do something crazy. Then i desoldered them, retested them a few times & hooked em back up, and never gave me a problem since.

My very first set was completely ruined, i think by too much heat from the soldering iron.

Have you tried feeding the vss pin 0v & 5v directly from the duino board itself?

  Reply With Quote
The Following User Says Thank You to nickdigger For This Useful Post:
gtkid2002 (02-23-2010)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 02-23-2010, 02:20 AM   #62 (permalink)
EcoModding Apprentice
 
gtkid2002's Avatar
 
Join Date: Feb 2009
Location: USA - WA
Posts: 110

The Bug - '69 Volkswagen Bug Base
Thanks: 6
Thanked 0 Times in 0 Posts
Yeah, I did the 0-5v thing just right on the board using the 'duino's 5v pin. I salvaged these buttons as well, so I'll swap them out in a bit and pray that's the issue. Or I'll use my electronics workstation.

It's just weird though, I know the buttons work. The multimeter even says they do, but if it's a possibility, then I'll explore it. I'm tired of tweaking the pins on the code. They won't work with PWM pin 10 or 11 either, so it probably is the buttons.

No, not the buttons. I've tried a wire straight from 5v on the UART section straight to Pin 10/11, 5v from the v out pin to 10/11. Yeah, this thing just does not like picking up anything. This is really irritating. I feel like punching a wall and burning this or something.

Is there a compatibility issue due to the difference in pins from the mega or something? Argh. Surely someone out there has a Seeeduino mega and a screen and ten minutes so they can hook this up and use mpguino v0.82 code and try it and see if I'm not just delusional.

---- Is there anything I can do to see if the analog pins work? I'm not going to be happy or surprised if mine is just a bad one, but I don't think I can get any money back on it, or a return for that matter.
__________________
I suck at coding! Woo!

1969 VW Bug - Daily Driver
1975 VW Baja - Current Project
Priors:
1989 Honda Prelude Si 4WS (RIP)
1995 Honda Prelude Si (Traded)
1980 Fiat Spider 2000 (Sold)

Last edited by gtkid2002; 02-23-2010 at 02:25 AM..
  Reply With Quote
Old 02-23-2010, 03:05 AM   #63 (permalink)
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
Remember when testing the buttons, that they are "on" when connected to Gnd, and "off" when there is voltage. By default in the guino code, the 3 buttons have 5v already because the pullup resistors are activated., so i think when you touch a 5v lead, you aren't affecting anything. Before i had any buttons, i just jumped a wire from Gnd to Analog 3/4/5

The thing that screwed me when testing my buttons was, my ohmeter was set to the low range, so when the defective buttons actually had 1M or 2M ohms, the meter just read "1" which to me meant 'no connection". Doh.

Another thing to try might be some Examples in the arduino library, like "Button.pde"

Are you using the PWM 10/11 for buttons? Without looking at the specs, i assumed the mega had the same pinouts as all other Arduinos, for the base set of pins, and then have the extras off to the side... for backward compatibility purposes. Am i correct?

Last edited by nickdigger; 02-23-2010 at 03:16 AM..
  Reply With Quote
Old 02-23-2010, 09:10 AM   #64 (permalink)
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
What version of the arduino software are you using?
  Reply With Quote
Old 02-23-2010, 09:57 AM   #65 (permalink)
EcoModding Apprentice
 
gtkid2002's Avatar
 
Join Date: Feb 2009
Location: USA - WA
Posts: 110

The Bug - '69 Volkswagen Bug Base
Thanks: 6
Thanked 0 Times in 0 Posts
Well this says something I think. I cut every wire I put on the board off, and I can't make the Button sketch work. Either the LED stays lit, or nothing happens. I'm using version 0018 of the software on a Mac if that makes any difference, and I'm just trying to jump the wire. I'll play with this more after classes.
__________________
I suck at coding! Woo!

1969 VW Bug - Daily Driver
1975 VW Baja - Current Project
Priors:
1989 Honda Prelude Si 4WS (RIP)
1995 Honda Prelude Si (Traded)
1980 Fiat Spider 2000 (Sold)
  Reply With Quote
Old 02-23-2010, 10:49 AM   #66 (permalink)
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
I ask because the MPGuino .pde says you need to use version 0011 due to program storage space limitations. The mega obviously has more program storage, but the 'guino code may have other incompatibilities with newer Arduino versions.

I'll solder the headers on my seeeduino mega and see what I can get it to do.
  Reply With Quote
Old 02-23-2010, 01:23 PM   #67 (permalink)
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
Okay... The big difference I notice between the standard boards and the mega is the pin numbering when using the analog pins as standard digital I/O. The scheme is the same but the numbering is different: the analog pins can be addressed as digital pins just beyond the range of dedicated digital pins. In the case of standard boards, the digital pins are numbered 0-13, so the digital-analog pins become 14-19 (or 14-21 for the Seeeduino). The mega boards have 54 digital I/O pins (0-53) so the analog pins become 54-69. The Seeduino Mega has an additional bank of 16 digital I/O pins, but these are unnumbered, so the standard mega numbering scheme applies.

Paste this into Arduino and upload it to your board. Grounding any of the first 13 standard digital pins (0-12), or any of the 16 analog pins should make the "L" indicator LED light. Pin 13 gets left out because it's being used to drive the LED.
Code:
int pinValue;

void setup()
{
  pinMode(0, INPUT);           //Set up standard digital IO pins as inputs, using internal pullups
  digitalWrite(0,HIGH);
  pinMode(1, INPUT);
  digitalWrite(1,HIGH);
  pinMode(2, INPUT);
  digitalWrite(2,HIGH);
  pinMode(3, INPUT);
  digitalWrite(3,HIGH);
  pinMode(4, INPUT);
  digitalWrite(4,HIGH);
  pinMode(5, INPUT);
  digitalWrite(5,HIGH);
  pinMode(6, INPUT);
  digitalWrite(6,HIGH);
  pinMode(7, INPUT);
  digitalWrite(7,HIGH);
  pinMode(8, INPUT);
  digitalWrite(8,HIGH);
  pinMode(9, INPUT);
  digitalWrite(9,HIGH);
  pinMode(10, INPUT);
  digitalWrite(10,HIGH);
  pinMode(11, INPUT);
  digitalWrite(11,HIGH);
  pinMode(12, INPUT);
  digitalWrite(12,HIGH);
  
  pinMode(13, OUTPUT);         //Use the LED on pin 13 as as an indicator
  
  pinMode(54, INPUT);          //Set up mega's analog pins as digital inputs, using internal pullups
  digitalWrite(54,HIGH);
  pinMode(55, INPUT);
  digitalWrite(55,HIGH);
  pinMode(56, INPUT);
  digitalWrite(56,HIGH);
  pinMode(57, INPUT);
  digitalWrite(57,HIGH);
  pinMode(58, INPUT);
  digitalWrite(58,HIGH);
  pinMode(59, INPUT);
  digitalWrite(59,HIGH);
  pinMode(60, INPUT);
  digitalWrite(60,HIGH);
  pinMode(61, INPUT);
  digitalWrite(61,HIGH);
  pinMode(62, INPUT);
  digitalWrite(62,HIGH);
  pinMode(63, INPUT);
  digitalWrite(63,HIGH);
  pinMode(64, INPUT);
  digitalWrite(64,HIGH);
  pinMode(65, INPUT);
  digitalWrite(65,HIGH);
  pinMode(66, INPUT);
  digitalWrite(66,HIGH);
  pinMode(67, INPUT);
  digitalWrite(67,HIGH);
  pinMode(68, INPUT);
  digitalWrite(68,HIGH);
  pinMode(69, INPUT);
  digitalWrite(69,HIGH);
}

void loop()
{
  pinValue = 0;                            //reset pinValue
  
  pinValue = pinValue + digitalRead(0);    //read pin values and add them up
  pinValue = pinValue + digitalRead(1);
  pinValue = pinValue + digitalRead(2);
  pinValue = pinValue + digitalRead(3);
  pinValue = pinValue + digitalRead(4);
  pinValue = pinValue + digitalRead(5);
  pinValue = pinValue + digitalRead(6);
  pinValue = pinValue + digitalRead(7);
  pinValue = pinValue + digitalRead(8);
  pinValue = pinValue + digitalRead(9);
  pinValue = pinValue + digitalRead(10);
  pinValue = pinValue + digitalRead(11);
  pinValue = pinValue + digitalRead(12);
  
  pinValue = pinValue + digitalRead(54);
  pinValue = pinValue + digitalRead(55);
  pinValue = pinValue + digitalRead(56);
  pinValue = pinValue + digitalRead(57);
  pinValue = pinValue + digitalRead(58);
  pinValue = pinValue + digitalRead(59);
  pinValue = pinValue + digitalRead(60);
  pinValue = pinValue + digitalRead(61);
  pinValue = pinValue + digitalRead(62);
  pinValue = pinValue + digitalRead(63);
  pinValue = pinValue + digitalRead(64);
  pinValue = pinValue + digitalRead(65);
  pinValue = pinValue + digitalRead(66);
  pinValue = pinValue + digitalRead(67);
  pinValue = pinValue + digitalRead(68);
  pinValue = pinValue + digitalRead(69);
  
  if(pinValue < 29)
  {digitalWrite(13,HIGH);}
  else
  {digitalWrite(13,LOW);}
}
  Reply With Quote
The Following User Says Thank You to bobski For This Useful Post:
gtkid2002 (02-23-2010)
Old 02-23-2010, 01:51 PM   #68 (permalink)
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
i'm using 0016, and i think some others are using 0017 or some lower versions. IDE version shouldn't be the problem.
  Reply With Quote
Old 02-23-2010, 08:22 PM   #69 (permalink)
EcoModding Apprentice
 
gtkid2002's Avatar
 
Join Date: Feb 2009
Location: USA - WA
Posts: 110

The Bug - '69 Volkswagen Bug Base
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nickdigger View Post
Are you using the PWM 10/11 for buttons? Without looking at the specs, i assumed the mega had the same pinouts as all other Arduinos, for the base set of pins, and then have the extras off to the side... for backward compatibility purposes. Am i correct?
I thought that would be true, but I guess not. Kudos to Bobski for pointing that out.

Quote:
Originally Posted by bobski View Post
Okay... The big difference I notice between the standard boards and the mega is the pin numbering when using the analog pins as standard digital I/O. The scheme is the same but the numbering is different: the analog pins can be addressed as digital pins just beyond the range of dedicated digital pins. In the case of standard boards, the digital pins are numbered 0-13, so the digital-analog pins become 14-19 (or 14-21 for the Seeeduino). The mega boards have 54 digital I/O pins (0-53) so the analog pins become 54-69. The Seeduino Mega has an additional bank of 16 digital I/O pins, but these are unnumbered, so the standard mega numbering scheme applies.

Paste this into Arduino and upload it to your board. Grounding any of the first 13 standard digital pins (0-12), or any of the 16 analog pins should make the "L" indicator LED light. Pin 13 gets left out because it's being used to drive the LED.
Thank you for that bit of code Bobski. The 'duino mega -does- work, and I got the code to work properly. Although if I removed any of the inputs the led just stayed lit, which was a little irritating, but whatever.

I see why you both are using your own custom codes. Trying to decipher the code is confusing as hell, even if I don't know what i'm doing.

I soldered everything back up after testing the code Bobski posted, and the screen is working just fine, although I am still stuck on the buttons, and the vss. I should probably test it with the injectors, but for the moment I am going to pass on that. Once I get the speedo working I'll hook up the injectors and then from there I'll just plug everything in.

So all there is left to do is to get the buttons and vss working. I would like to stick to the original code so that it is just a souped up version of the Mpguino that can run mainly on the Mega series, and that is open for later custom additions, however confusing they may be to add in at a later time.

Again, thank you Bobski and Nickdigger for your help on this.


Update: So I found an area of code I get to tweak with.
Quote:
#define lbuttonPin 55 // Left Button, on analog 3, Mega would be analog 1
#define mbuttonPin 56 // Middle Button, on analog 4 Mega would be analog 2
#define rbuttonPin 57 // Right Button, on analog 5 Mega would be analog 3

#define vssBit 0 // pin14 is a bitmask 1 on port C
#define lbuttonBit 8 // pin17 is a bitmask 8 on port C
#define mbuttonBit 6 // pin18 is a bitmask 16 on port C
#define rbuttonBit 32 // pin19 is a bitmask 32 on port C
If I change the bitmask settings, the screens just utterly spaz out. I'm guessing that's noise, and a lot of it. If I change them back to the stock settings, they don't change at all. I'd love to include the Bounce bit, but I'm still figuring out how. And I think I figured out that there isn't much love for the Seeeduino Mega. Didn't realize nobody has really made a pinout chart for it yet, and I think it is still different from the Arduino Mega.

Anybody know what the bitmask is for and/or what it does?

And this is a video of just what this thing is doing.
__________________
I suck at coding! Woo!

1969 VW Bug - Daily Driver
1975 VW Baja - Current Project
Priors:
1989 Honda Prelude Si 4WS (RIP)
1995 Honda Prelude Si (Traded)
1980 Fiat Spider 2000 (Sold)

Last edited by gtkid2002; 02-24-2010 at 12:06 AM.. Reason: found touchy code
  Reply With Quote
Old 02-23-2010, 10:23 PM   #70 (permalink)
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
Quote:
Originally Posted by gtkid2002 View Post
Although if I removed any of the inputs the led just stayed lit, which was a little irritating, but whatever.
Huh... The LED switched off on mine. Odd. Were you testing more than one input at a time? The LED comes on when any one of the inputs is grounded; It won't turn off until ground has been removed from all of them.

Quote:
Originally Posted by gtkid2002 View Post
I see why you both are using your own custom codes. Trying to decipher the code is confusing as hell, even if I don't know what i'm doing.
I think the issue with the VSS and buttons is the pin numbering differences between the two board designs. The VSS and buttons are routed to analog pins which, when used as digital I/O pins, have pin number designations that depend on the board design. As such, the program needs to be tweaked to look at the proper pins.

Thankfully, well written code is easily adaptable. If you open up mpguino.pde and scroll down a little, you'll see a bunch of #defines. The first important one you'll come across is:
Code:
#define VSSPin 14 //analog 0
These defines are simply place holders... The above line lets a programmer type "VSSPin" where some bit of programming would expect a number, such as a pin number. The point being that changing the value (14) in the #define to some other number would then substitute that new value in to any function in the program that would make use of the VSSPin, so long as "VSSPin" is used where the pin number should be.
As I outlined above, the mega's analog pins start at pin 54, so that should be:
Code:
#define VSSPin 54 //mega analog 0
Scrolling down again, you'll see the pin designations for the LCD display, followed by:
Code:
#define lbuttonPin 17 // Left Button, on analog 3,        
#define mbuttonPin 18 // Middle Button, on analog 4       
#define rbuttonPin 19 // Right Button, on analog 5
Which should be:
Code:
#define lbuttonPin 57 // Left Button, on mega's analog 3,        
#define mbuttonPin 58 // Middle Button, on mega's analog 4       
#define rbuttonPin 59 // Right Button, on mega's analog 5
Give that a try.


Last edited by bobski; 02-23-2010 at 10:45 PM..
  Reply With Quote
Reply  Post New Thread




Similar Threads
Thread Thread Starter Forum Replies Last Post
MPGuino release one workspace dcb OpenGauge / MPGuino FE computer 1061 01-17-2020 01:37 AM
MPGuino rebooting and freezing also... Power issue? tygertec OpenGauge / MPGuino FE computer 28 04-17-2011 04:05 PM
MPGuino additon? BIG instant speed? gtkid2002 OpenGauge / MPGuino FE computer 11 02-19-2010 08:23 PM
MPGuino installation/setup: 1998 Geo Metro (Pontiac Firefly) MetroMPG OpenGauge / MPGuino FE computer 12 10-11-2009 03:29 PM
Will mpguino show the mileage going up while the engine is off and car is moving? abcdpeterson OpenGauge / MPGuino FE computer 6 06-02-2009 06:14 PM



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