Latest Code Updates

A forum for discussing applications and implementations of the MegaShift transmission controller code for the GPIO from B&G. This can control up to 8-speeds and 6 shift solenoids (plus a 16x9 table for controlling a PWM line pressure valve). It has manual and fully automatic modes (16x9 load x speed table), with under and over rev-limit protection, and full data logging of all inputs and outputs (among many other abilities). A TransStim to test your completed board is also available.
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Tue Nov 05, 2013 2:11 pm

The latest 4.134 and 5.008 release and beta codes have been posted:

4.134 release: http://www.msgpio.com/manuals/mshift/V41code.html

5.008 beta: http://www.msgpio.com/manuals/mshift/V5code.html

These codes add a simple TCC load hysteresis factor ("TCC Unlock Hysteresis") to the torque converter clutch ("TCC") lock-up behavior. There is more discussion on this here: viewtopic.php?f=4&t=729. The documentation for the release code is here: http://www.msgpio.com/manuals/mshift/V41tune.html#nt.

Note that there has been a change in the labeling of one of the TCC parameters; "Max. TCC Load" is now "TCC Unlock Above Load" but the associated parameter (noTCC_load) remains the same.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Thu Nov 14, 2013 11:52 am

The latest 4.135 code is here: http://www.msgpio.com/manuals/mshift/V41code.html

This code allows the use of PE0 for table switching whenever the 2WD/4WD input is used as an additional digital lever input. PE0 will have to be wired through an unused circuit and Ampseal pin with a 5V pull-up (an 1K resistor). Grounding that pin will switching the the target gear control from table 1 to table 2.

There is more discussion of this here: viewtopic.php?f=4&t=736#p3931
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Tue Jan 28, 2014 9:44 am

4.136 code is now available, you can get it here: http://www.msgpio.com/manuals/mshift/V41code.html

This code:
- re-enables line pressure reporting, which had been inadvertently disabled since version ~4.131.
- manages the timer interrupt code better to allow smoother operation of the interrupt based outputs.
- has a new user parameter called 'Speedo Output Duty Cycle' under 'Spare Ports -> Speedo Output on Spare Port 0' to set the pulse width modulation percentage for the speedometer output. There is more information here: http://www.msgpio.com/manuals/mshift/V41tune.html#su).
- fixes a number of typos in the INI.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Sun Feb 02, 2014 9:47 am

4.137 release code and 5.009 beta code and respective INIs have been posted:

- 4.137: http://www.msgpio.com/manuals/mshift/V41code.html
- 5.009: http://www.msgpio.com/manuals/mshift/V5code.html

The 4.137 code fixes:
- the external speedo output driver at high frequencies (more here: viewtopic.php?f=4&t=781).
- the line pressure reporting (which was inadvertently commented out in some earlier version). See: viewtopic.php?f=4&t=791 Line pressure is now a signed integer (meaning it will go negative rather than 'roll-under' if the value gets too low). Smoothing was also added to the line pressure value, though this is not user adjustable (yet).
In addition, numerous improvements were made to the interrupt structure to allow more entry points for non-timer inputs/outputs.
4.137 is now the current release code.

Thanks to Tobmag and mill3833 for their help in identifying these issues, solving the problems, and testing the fixes.

The 5.009 code has the same fixes and improvements, but also corrects an error on the output channel (outpc) size in the INI that could cause CAN pass-through issues when connected to another ECU. 5.009 has been tested with CAN pass-through (to an MS-II running 2.920) and it works fine. This is still beta code, though, so it should be used in a vehicle only with great caution.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Mon Feb 10, 2014 6:18 pm

The latest beta code and INI, version 5.010, is here:

http://www.msgpio.com/manuals/mshift/V5code.html

This code adds:

- Aux Volts (x100) to the available indices for all spare ports. x100 means that you would enter a value of 325 in the index bin for 3.25 Volts, 189 for 1.89V, etc.

- 'Gear Indicator' mode for spare port 2. This mode lets the user set an independent PWM percent and period (=1/freq) for each gear (PNR1234...8).

The periods can be from 0.512 millisecond to 819.1 milliseconds (for frequencies from 1.2 Hertz to 1953 Hertz). This could be used to drive a tachometer as a gear indicator, for example.

Note that the PWM percentage is the percent of time 'high' at the processor pin. Whether this is high for your device depends on the driving circuit and the device itself. In some case the PWM% can be inverted by the particular circuit's layout and components, so use caution in implementing this control (you may need to set the value to 100% minus your desired percentage).

Also, higher frequencies will have less resolution on the PWM%, and the value will be rounded up or down. Lower frequencies mean the PWM percent will likely be closer to the user-set value (for example, a value of 12.8 milliseconds (78 Hz) will give at least 2% accuracy, while a value of 1.28 msec (781 Hz) will give a potential error of up to 20%). At the highest frequencies (lowest period), setting the PWM% to 25%, 50% or 75% will give the best results.

For background discussion on these additions, see: viewtopic.php?f=4&t=739

This code has had some testing (especially for the new additions) but is by no means proven, so use only with great caution in a vehicle.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Sat Feb 22, 2014 10:09 am

The latest 5.012 beta code has been released here:

http://www.msgpio.com/manuals/mshift/V5code.html

This code:
- checks the user input baud rate and defaults back to 115200 if there is an obvious issue. Fore example, if a flash burn is corrupted, large portions of the user parameter block(s) can be left filled with ones (which show up as a bunch of 255, 64535, 64.535, etc. parameters in TunerStudio) due to the physical process used to write the flash memory. This kills the comms (because the controller and PC baud rates no longer match), and because the user doesn't have comms they can't fix the erroneous value. The only practical solution has been to burn new code using the serial monitor, which is often inconvenient. The latest code checks if the baud rate is between 300 and 691200. If it isn't (and it won't be if the flash burn was corrupted - the baud rate setting will be 4,294,967,295 (= 1111 1111 1111 1111 1111 1111 1111 1111 in binary) which won't work with anything at all), so the code then reverts to using 115200 baud, allowing the user to send an good MSQ (restoring the baud rate as well as all the other user settings that may have been corrupted) and there is no need to jumper to bootloader pin and burn the code from scratch using the serial monitor.
- fixes a compiler cast error that affected the non-CAN load.
- implements the minimum load for all slip based adjustments (some situations were missed in previous code), as well as a minimum speed (3 mph).

The code has been briefly tested, but needs much more testing, so use in a vehicle only with great caution.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Mon Mar 31, 2014 10:31 am

The latest release code, version 4.138, has been posted here:

http://www.msgpio.com/manuals/mshift/V41code.html

This code adds no new user settings or features, but does remove the PWM% checking when the gear is P, N, or R.

In the previous code, the PWM% was limited to no less than the lowest value in the 16x9 PC table at all times (to prevent rounding errors or other mishaps), so settings lower than the lowest table value in park, neutral or reverse were not implemented.

This latest code sets the PNR PWM% independently of the table values, so they be anything from 0% to 100% (but only with INI changes, as the INI limits the values to the 40% to 100% range under all conditions).

See this thread for more information: viewtopic.php?f=4&t=814

The 5.xxx code was different in the area (due largely to the spare port 3 implementation) so it did not need to be changed.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Sat Apr 12, 2014 12:05 pm

The latest 4.139 release code and 5.015 beta codes are here:

release: http://www.msgpio.com/manuals/mshift/V41code.html
beta: http://www.msgpio.com/manuals/mshift/V5code.html

These codes made sure that an under-rev condition is not checked in first gear, and an over-rev condition is not checked in high gear. This prevents attempts to shift to neutral or invalid gear.

There were no new user parameters or functions added to these codes.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Fri Jul 18, 2014 2:09 pm

The newest 4.145 release code is here:

http://www.msgpio.com/manuals/mshift/V41code.html

This code has a number of changes, including:
- numerous changes to lever error mode to improve the error handling capabilities (thanks to mill3833 and others!),
---- change lever error checking (leverErr) default value to 0 (Ignore all errors) from 1 (Report lever errors),
---- check that target gear is in range (1...num_gears) 100x per second, if it isn't revert to last known good target gear,
---- change target_gear initial value from 0 to 1,
---- added check for correct target_gear after gear errors,
- added 'burnout mode' for D2; see: http://www.msgpio.com/manuals/mshift/V41tune.html#gs (thanks mill3833!),
- fixed jake brake internal status code that was causing line pressure errors (thanks to 1991Blazer!),
- added LED1 through LED4 status to the output channels,
- fixed manual gear lever fourth input issue (thanks to Addicted and gui67!).

As well, this code:
- exposes the debug input variables,
- re-enables a number of indicators that were commented out in recent INIs,
- increases the output channel byte size from 64 to 72,
- exposes the bit values for error codes,
- fixes a line pressure INI error that cause TS to report values that were 10x too low (thanks Shaodome!),
- adds Jake Brake indicator,
- adds LED1-4 status, input1-3 logical status, up/downshift status, out-of range rev shift block and gear range error values to the datalog,

In addition to those mentioned above, many, many thanks to everyone who participated in the discussion, troubleshooting and testing that made these improvements possible. I apologize in advance to those I didn't name explicitly. The details can be found in recent threads from April 12, 2014 to July 17, 2014.

These changes will be carried over to the beta code soon (where they apply), and a note will be posted here when the new beta code is ready for download.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Latest Code Updates

Post by Bernard Fife » Wed Jul 23, 2014 8:54 am

The latest 5.016 beta test code (and matching INI) is here: http://www.msgpio.com/manuals/mshift/V5code.html

This code has all the applicable bug fixes from recent 4.1xx codes.

As well, there was a bug between the 'Jake brake' and 'forced downshift' bit assignments of the output channels in both the 4.145 and 5.015 codes. These have been fixed. The 4.145 code S19 file was reloaded to the website. So if you have downloaded 4.145 code since Friday, you might want to re-download it (the small change did not justify a new release number as very few people had downloaded prior to the fix).

The 5.xxx series of code, including the latest 5.016, is currently beta code intended primarily for bench testing. If you are using any 5.xxx beta code in a vehicle, proceed with great caution and only after verifying all operations on a static vehicle. Be prepared to revert to release code at any time.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw

Locked