Page 1 of 2

use of processor pin PE0 for table switching

Posted: Wed Feb 18, 2015 1:40 pm
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

Re: use of processor pin PE0 for table switching

Posted: Thu Feb 19, 2015 9:14 am
by Bernard Fife
I will have a look.

Re: use of processor pin PE0 for table switching

Posted: Thu Feb 19, 2015 9:28 am
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.

Re: use of processor pin PE0 for table switching

Posted: Thu Feb 19, 2015 9:43 am
by Bernard Fife
Addicted,

Okay, here is code that might work:
Monitor_5099p.abs.s19
(82.59 KiB) Downloaded 561 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.

Re: use of processor pin PE0 for table switching

Posted: Sat Feb 21, 2015 2:27 am
by Addicted
Sorry Lance but it doesn't work :cry:

I reflashed 4.144 to check my hardware and it shifted tables perfectly..

Re: use of processor pin PE0 for table switching

Posted: Sat Feb 21, 2015 10:00 am
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.

Re: use of processor pin PE0 for table switching

Posted: Sat Feb 21, 2015 4:49 pm
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 539 times
Lance.

Re: use of processor pin PE0 for table switching

Posted: Sun Feb 22, 2015 3:59 am
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

Re: use of processor pin PE0 for table switching

Posted: Sun Feb 22, 2015 7:45 am
by Bernard Fife
Thanks Martin, I will have a look. Lance.

Re: use of processor pin PE0 for table switching

Posted: Sun Feb 22, 2015 8:37 am
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 530 times
Lance.