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, 10:34 PM   #71 (permalink)
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
edit: never mind


Last edited by nickdigger; 02-23-2010 at 10:36 PM.. Reason: bobski beat me to it.
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 02-23-2010, 10:53 PM   #72 (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 nickdigger View Post
Reason: bobski beat me to it.
Phear my ninja posting skillz. ^_^
  Reply With Quote
Old 02-24-2010, 12:14 AM   #73 (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've been playing with those pins for a while. Just changing the numbers doesn't work on it for some reason. I know it should, but it doesn't. It's really really irritating. If you scroll down to just below the button code area, *where you pointed out I should change*, there will be some code that says something like

Code:
#define vssBit 1     //  pin14 is a bitmask 1 on port C        
#define lbuttonBit 8 //  pin17 is a bitmask 8 on port C        
#define mbuttonBit 16 // pin18 is a bitmask 16 on port C        
#define rbuttonBit 32 // pin19 is a bitmask 32 on port C
If I change that to what I believe should be the right ones, all I get is a rapidly changing screen that scrolls through everything constantly. I don't know how to use the Bounce bit of code to remove the noise either, so I'll have to tinker with that later.
__________________
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-24-2010, 01:13 AM   #74 (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
Ugh.
If you're fully aware of this stuff, feel free to skip ahead.
Bitmasks are used to examine or exclude particular binary bits in a larger unit-group (such as a nibble, byte or word). You'll notice the bitmask values are all some value of 2^n... 1, 2, 4, 8, 16, 32, 64, 128 and so on. Those are the values of the digits of a binary number, but represented in decimal. So a bitmask of 1 would look at the 1st digit, 8 would look at the 4th digit, 16 at the 5th digit and 32 at the 6th digit.

The fact that the comment references ports and individual bits probably means that somewhere or other the program isn't using the digitalRead() and digitalWrite() commands that are easily portable between Arduino architectures. Instead, it's grabbing a whole port's worth of data (8 or maybe 16 bits) off of a register some place and sorting it out manually.
To get that to work would require finding the code that polls data from the ports and, realistically speaking, rewrite or replace it with code that is relevant to the mega's port / bit / register mappings.
This is exactly the kind of stuff I'm trying to avoid by working on my own version.

Last edited by bobski; 02-24-2010 at 01:25 AM..
  Reply With Quote
Old 02-24-2010, 01:23 AM   #75 (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
I can find Arduino Mega's port mappings, but that's it I think.
Arduino Forum - Pinout for Port Registers on Arduino Mega??
Post #4. Only problem is that you look at the pins that are on the 'duino and where they start at analog, and the difference makes me nervous.

I believe it is using at least digitalWrite commands, but to what extent I don't know.

Any clues on how hard it would be to just bypass that?



UPDATE: Ooh, someone DID post. I checked it right after I posted this. http://forum.seeedstudio.com/viewtopic.php?f=4&t=378

It's not in a .pdf, but whatever, it works. I feel like a massive idiot now. I already looked at that page too, haha. Thought it was the Arduino Mega for some reason and kept scrolling.

In that case, it's using bytes. I scoured the code playing with the bitmaps for a little bit and just kind of... gave up for the time being.

If they had published a schematic of the Seeeduino Mega in a format I could actually read on this computer, then I could probably find those already.

I'm guessing it'll work with minimal effort on an actual Arduino Mega, but mock ups just have to have completely different pin numbers and such.....how smart.

Good golly this is turning into a nightmare. Guess I get to do some more scouring. Hopefully the people at Seeed studios publish the schematic in a .pdf on a support thread like I asked a bit ago so I can read it and so everyone else can figure out what the hell they did.
__________________
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 01:25 AM.. Reason: foudn linky
  Reply With Quote
Old 02-24-2010, 01:38 AM   #76 (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... So the bitmasks should be right, but the port needs to be changed. The '168 has its analog pins on port C, where the corresponding '1280 analog pins are on port F.
  Reply With Quote
Old 02-24-2010, 03:10 AM   #77 (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
Wow. I feel helpless.

I'm going to say that the bit of code I posted is not the part I should be editing. I edit that, it tweaks out and tweaking = bad. Right?
__________________
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-24-2010, 09:13 AM   #78 (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
I'm going to say that the bit of code I posted is not the part I should be editing. I edit that, it tweaks out and tweaking = bad. Right?
Right.
We need to find the specific lines of code where it reads data from port C and replace that with port F. Unfortunately, I have no idea what such a line of code would look like.
  Reply With Quote
Old 02-24-2010, 12:43 PM   #79 (permalink)
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
byte p = PINC;
  Reply With Quote
Old 02-24-2010, 02:32 PM   #80 (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
That's remarkably vague. I assume PINC is defined in some processor-specific defs file? So that would become PINF?

  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