The same firmware and MegaTune that was used back in the old days for GenBoard/VerTwo (in 2003) should work today as well. Limited a bit, since
- v2.2 hardware is just a bit more advanced than the original MegaSquirt, comes nowhere to v3.x
- MegaTune was also harder to use with it's own tricks and watchouts
- TODO: find latest working and tested ver2.2 firmware that compiles cleanly.
- as a last chance, try anonymous CVS from sourceforge
- making stable1_0 branch compile for v2.2 should be relatively simple. Start from a recent released (or a newer, yet unreleased if exists) from http://www.vems.hu/files/Firmware/release/
- always publish patches in diff format (made with diff command)
- publish what the patch is against
I started to solve new firmware problems to ver2. Only few new ifdefs is needed so firmware compiles. I haven't tested these but if someone could confirm my changes so it doesn't break anything else. I made these changes to mt-RC2 packet.
for comm.c \n
uint8_t getMCPdataHIGH(uint8_t i) { uint16_t t; uint8_t r = 0; #ifdef GENBOARDv3 //add this if(i < 8) { t = mcp3208_data[i]; if (t != 0xffff) // r = (uint8_t) t >> 8; r = t >> 8; } #endif // add this return r; }\n
uint8_t getMCPdataLOW(uint8_t i) { uint16_t t; uint8_t r = 0; #ifdef GENBOARDv3 //add this if(i < 8) { t = mcp3208_data[i]; if (t != 0xffff) r = (uint8_t) t & 0xFF; read_mcp3208(i); } #endif //add this return r; }
for fuel calc.c\n
void fill_all_squirters(uint16_t pw) { .... // TODO: check if gcc adds sizeof... } while(i); #ifdef GENBOARDv3 //add this #ifdef INJECTOR_STAGING // Calculating pulsewidth of secondary injectors uint16_t pw2; if(engine.tps >= config.inj_stage2_start_tps && engine_kpa8() >= config.inj_stage2_start_map) pw2 = mult16_16(pw, (uint16_t)(config.inj_stage2_rate) + 256)>>8; // effectively (256 + 256) / 256 else pw2 = 0; i=SECONDARY_INJ_CHANNELS_NUM; while(i) { i--; cli(); inj_port_p->pwm_delay = t; inj_port_p->pwcalc = pw2; sei(); inj_port_p++; // TODO: check if gcc adds sizeof... } #endif // calculate injector bitmask used when firing all injectors simultaneously i = config.alternate & 0x0f; mask = injport_map(i); while(i) { i--; mask |= injport_map(i); } engine.injector_bitmask = mask; #endif //add this }
- ifdeffing out mcp3208 related code should not hurt
- INJECTOR_STAGING should NOT be defined for v2.2. I don't think that "ifdef GENBOARDv3" is necessary around it (at least in production code. In hwdef_v2.h it would be OK)