02-15-2009, 11:20 AM
|
#311 (permalink)
|
OBDuino coder
Join Date: Jun 2008
Location: Montréal, QC
Posts: 212
Titine - '13 Hyundai Sonata Hybrid
Thanks: 3
Thanked 10 Times in 8 Posts
|
When the RPM goes to 0, I save all trip data into the EEPROM, no need of a button cell, and EEPROM can be saved 100'000 times.
Also for the CAN version I can put it in sleep mode and it will be woken up when there is activity on the bus. It will draw a few µA only.
__________________
2013 Hyundai Sonata Hybrid
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
02-16-2009, 10:00 PM
|
#312 (permalink)
|
EcoModding Lurker
Join Date: Oct 2008
Location: nova scotia
Posts: 35
Thanks: 2
Thanked 0 Times in 0 Posts
|
RPM will never reach zero
The RPM will never reach zero with the configuration I have. I am using the iso version(not using elm chip), and as soon as the car is shut off, the communication stops with the obduino and the obduino "freezes". (I guess the ecu doesn't run when you put the car to acc.)
I assume this is because it is getting stuck trying to receive a data packet from the car and that it can not go any father or save the data once the car is shut off because it will always be waiting for a packet.
looking at the code in the receive data function there is a line of code that is something like while(receive()==-1).
Would it be hard for there to be a timeout function added. and upon failure it will save its trip data and reset itself so it can attempt to reinitialize with the car?
|
|
|
02-17-2009, 10:16 AM
|
#313 (permalink)
|
OBDuino coder
Join Date: Jun 2008
Location: Montréal, QC
Posts: 212
Titine - '13 Hyundai Sonata Hybrid
Thanks: 3
Thanked 10 Times in 8 Posts
|
Interesting, on my car when I shut down the engine, the ECU still answer for maybe 5 seconds before giving a timeout.
Yes in the receive function, a timeout should be inserted in the while, something like:
Code:
int iso_read_byte()
{
byte t=0;
int b;
while(t!=500 && (b=serialRead())==-1)
{
delay(1);
t++;
}
return b;
}
and the result of the function should be tested, if it's -1 it's a timeout
__________________
2013 Hyundai Sonata Hybrid
|
|
|
02-17-2009, 12:46 PM
|
#314 (permalink)
|
EcoModding Lurker
Join Date: Oct 2008
Location: nova scotia
Posts: 35
Thanks: 2
Thanked 0 Times in 0 Posts
|
Thanks for the quick reply, I will test it out.
Just a side not, the limit should be less then 256 not 500 if we are going to use a byte for t.
|
|
|
02-17-2009, 01:19 PM
|
#315 (permalink)
|
OBDuino coder
Join Date: Jun 2008
Location: Montréal, QC
Posts: 212
Titine - '13 Hyundai Sonata Hybrid
Thanks: 3
Thanked 10 Times in 8 Posts
|
lol yes you are right for the type, put either an int or put the limit to 255
__________________
2013 Hyundai Sonata Hybrid
|
|
|
02-17-2009, 10:53 PM
|
#316 (permalink)
|
EcoModding Lurker
Join Date: Oct 2008
Location: nova scotia
Posts: 35
Thanks: 2
Thanked 0 Times in 0 Posts
|
I just modified it to this, and now it saves the trips and will even resume reading the data once the car is turned on.
Code:
int iso_read_byte()
{
int b;
byte t=0;
while(t!=250 && (b=serialRead())==-1) {
delay(1);
t++;
}
if (t>=250) {
b = 0;
}
return b;
}
*Bug* This works great. The only problem is that once the car is turned off, throttle position is going to be reported as 0. this means that engine breaking will no long be accounted for. That should be taken into consideration else where in the code if you use this (i.e. reset the throttle position minimum value when ever the car is started up again.)
Last edited by electromike; 03-03-2009 at 09:07 AM..
Reason: found a bug
|
|
|
02-19-2009, 09:41 AM
|
#317 (permalink)
|
EcoModding Lurker
Join Date: Feb 2009
Location: Rochester, NY
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
I'm currently porting this software to the Sanguino under the Arduino version 0013 software. But, I'm having trouble getting the MCZ33290EF interface IC. Mouser and Digikey are sold out, and the best estimate was a May delivery time. Does anyone know where I can get one of these
|
|
|
02-19-2009, 10:19 AM
|
#318 (permalink)
|
Master EcoModder
Join Date: Nov 2008
Location: 18603, USA
Posts: 759
Thanks: 221
Thanked 60 Times in 45 Posts
|
You can get up to 2 of them for free from Freescale Electronics as a "sample."
Last edited by Nevyn; 02-19-2009 at 10:19 AM..
Reason: grammar police
|
|
|
02-21-2009, 07:07 PM
|
#319 (permalink)
|
EcoModding Lurker
Join Date: Feb 2009
Location: Toronto, ON
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi all,
I'm pretty new with arduino coding, and have been away from coding in general for a few years. I just downloaded version 121 of the source code and tried compiling it but I get an error:
In function ‘void params_save()’:
error: invalid conversion from ‘const void*’ to ‘void*
with reference to this line:
eeprom_write_block((const void*)¶ms, (void*)0, sizeof(params_t));
Can anyone lend a hand? I haven't changed the code and am tried to compile for ISO. I tried Arduino-0011 to 0013.
Thanks.
__________________
|
|
|
02-22-2009, 07:23 AM
|
#320 (permalink)
|
EcoModding Lurker
Join Date: Feb 2009
Location: Rochester, NY
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
Quote:
Originally Posted by Justin K
Hi all,
I'm pretty new with arduino coding, and have been away from coding in general for a few years. I just downloaded version 121 of the source code and tried compiling it but I get an error:
In function ‘void params_save()’:
error: invalid conversion from ‘const void*’ to ‘void*
with reference to this line:
eeprom_write_block((const void*)¶ms, (void*)0, sizeof(params_t));
Can anyone lend a hand? I haven't changed the code and am tried to compile for ISO. I tried Arduino-0011 to 0013.
Thanks.
|
Heh, I'm having the same problem using 0013A on Mac OSX. My friend successfully compiled for the Arduino Duemilanove on version 0012 under Windows XP though...
__________________
Man, I hate winter.
Last edited by CranberrySauce; 02-22-2009 at 07:25 AM..
Reason: clarification
|
|
|
|