use of processor pin PE0 for table switching

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.
Addicted
Posts: 188
Joined: Mon Oct 14, 2013 7:14 am
Location: Winchester, England

use of processor pin PE0 for table switching

Post by Addicted »

Lance,
What do I need to do to 'activate' this functionality? I'd assumed it was automatic. I have a 1K pullup to 5v and am using a 2N3904 to pull it to ground. I'm using GPI2 luckily which makes the header jumping easy to PE0. Operating the switch is showing 0 volts and 4.86 volts at PE0.. but it doesn't shift tables..

I have GPI1 set for 4th lever input.

MSQ attached

Martin
Attachments
2015-02-18_21.26.56.msq
(57.03 KiB) Downloaded 640 times
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: use of processor pin PE0 for table switching

Post by Bernard Fife »

I will have a look.
"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: use of processor pin PE0 for table switching

Post by Bernard Fife »

Addicted,

It looks like I forgot to add this capability (to use PE0 to switch tables) to the 5.xxx code after I added it to the 4.1xx code. I will do that and post here.

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: use of processor pin PE0 for table switching

Post by Bernard Fife »

Addicted,

Okay, here is code that might work:
Monitor_5099p.abs.s19
(82.59 KiB) Downloaded 500 times
- uses existing INI

It has the same changes for PE0 as the 4.14x code. I have not tested this code yet, so it might need some tweaks.

As you noted, you do need to set input 4 for the lever inputs to "active" for the code to use PE0 instead of the 2/4WD pin (PE1) for table switching.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Addicted
Posts: 188
Joined: Mon Oct 14, 2013 7:14 am
Location: Winchester, England

Re: use of processor pin PE0 for table switching

Post by Addicted »

Sorry Lance but it doesn't work :cry:

I reflashed 4.144 to check my hardware and it shifted tables perfectly..
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: use of processor pin PE0 for table switching

Post by Bernard Fife »

Thanks for trying that. I have likely got the port setup wrong. I will sort it once I am back at my desk.
"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: use of processor pin PE0 for table switching

Post by Bernard Fife »

Addicted,

I don't see anything obviously wrong in the code, though I have fixed one small potential issue in this area in the attached code which could help (but I am not confident about that).

PE0 is input only, so there are no real set-up options (other than the pull-up config). However, the code is somewhat different in this area than the 4.1xx codes, though, so it probably needs some tweaking.

I have made some diagnostic changes to the attached code that you can try. If you load this code and let me know at which points in time you have tried different signals on PE0, I should be able to see what is going on in a datalog if you post one.
Monitor_5099q.abs.s19
Uses previous INI
(82.62 KiB) Downloaded 486 times
Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Addicted
Posts: 188
Joined: Mon Oct 14, 2013 7:14 am
Location: Winchester, England

Re: use of processor pin PE0 for table switching

Post by Addicted »

Hi Lance,

Hopefully the attached is what you need.

I started the log, counted to 10 then pressed, counted 2 and pressed again, counted 2 and pressed again and repeated the pattern to the end of the log.

Martin
Attachments
2015-02-22_11.52.02.msl
(108.18 KiB) Downloaded 456 times
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: use of processor pin PE0 for table switching

Post by Bernard Fife »

Thanks Martin, I will have a look. 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: use of processor pin PE0 for table switching

Post by Bernard Fife »

Martin,

There were a couple of small peripherally related issues for the table switching status that the attached code should solve. Your datalog was very helpful in finding these bugs and fixing them. That doesn't necessarily mean the issue is entirely fixed, but if it isn't I'll keep working until it is! If you want to try the attached code, that would be helpful.
Monitor_5099r.abs.s19
Same INI as before
(82.64 KiB) Downloaded 470 times
Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Post Reply