• Welcome to the new NAXJA Forum! If your password does not work, please use "Forgot your password?" link on the log-in page. Please feel free to reach out to [email protected] if we can provide any assistance.

Possible AW4 Shift Controller with a Basic Stamp

SuperRA

NAXJA Forum User
Location
Santa Clara, CA
I was doing an engine swap in a 91 corolla with one of those low mileage used japanese engines and decided to swap in a 4spd auto in place of the 3spd. It was only an extra $100 and I figured the addition of OD would help mileage. Unfortunately I was sold an electronic transaxle while the car's original trans was non-electronic control. I found this out only after completing the swap. My friend suggested that I use a Basic Stamp microcontroller to make a TCU. Since I played with these in college, it was a fun project. I got to program how it shifts and made three modes, econ, normal, and power. Not too different from the comfort/econ switch in the XJ. I still use this car today and the home made TCU is still working fine. Since the AW4 is basically a toyota trans, I'd imagine it uses similar controls. Two solenoids for shifting and one more for TC lockup. Perhaps someone would be interested in building one and could easily add a "tiptronic" type shifter by adding a couple circuits and some extra code. Here is some pics of the unit I built. I could post a diagram of the logic, circuit, and code if people are interested. Perhaps someday I may do it for the XJ, but at this time I have no desire for it in there.

8690647719_1f90332258_c.jpg

8691766752_695bb634c1_c.jpg

8690647763_5e9fdb0059_c.jpg
 
That is very interesting.
What are all the part numbers?
It can be a fully programmable TCU? control shift points? Raise the shift point rpm?
 
That is very interesting.
What are all the part numbers?
It can be a fully programmable TCU? control shift points? Raise the shift point rpm?

Theoretically it can be programmed to do anything like sorting date codes on an assembly line, but yes, you can change where it shifts. It doesn't control exactly where it shifts by RPM though, at least the way I programmed it. My algorithm uses the vehicle's speed to determine shift points. Since vehicles speed is indirectly related to engine RPM, the end result is raised (or lowered) shift points. I'll see if I can dig up all this info and post it.
 
Looks like you did a good job on that box and wiring. This is the basic concept of what BrettM of AWShifting fame did.

Thanks. I like building these kind of things. I'm not familiar with that reference you mentioned. Is it a project someone did here on Naxja?

Here is the logic flowchart I made for me to visualize the code to write. Note that this doesn't include the "mode" switch. That would just make a flow chart that is 3X of the same logic but with different speeds values at which the transmission shifts.
8694047480_fe297c3225_c.jpg


And here is the general circuit diagram although I don't have any part numbers or resistor values because I think I drew this after I actually built the module. Also, I have one more level of transistor in between the stamp and the larger transistors (which are TIP40 I believe). That was just to protect the stamp in case the TIP40s drew too much current causing the stamp to blow that output pin. The Solenoids 1 & 2 are the shift solenoids and 3 is the lockup solenoid.
8692930511_ff199ac2d2_z.jpg


This is where things would have to change. The TPS in the corolla was a simple switch with three positions, idle, WOT, and everything in between. I'm not sure how it would connect to the XJs potentiometer type TPS.
8692930497_c3a1ce4bd9.jpg
 
Last edited:
Here's my code in P-basic for the basic stamp. Note this was all that I could find and it was changed around a lot during testing. Some lines are quoted out but may need to be in the code. If you were to actually do this, I'd advise that you actually learn the code and check it's function and not just copy and paste it expecting it to work.
Code:
' {$STAMP BS2}
'Transmission shifting program for a 1991 Toyota Corolla
speed         VAR Byte
lastspeed     VAR Byte
performance   VAR Bit
overdrive     VAR Bit
brakes        VAR Bit
tpswot        VAR Bit
tpsidle       VAR Bit
pulses        VAR Word
newpulses     VAR Word
pulses=0                       'initializes the variable "pulses"
INPUT 0                        'speed sensor input
INPUT 1                        'performance switch input
INPUT 2                        'O/D switch input
INPUT 3                        'brake switch input
INPUT 4                        'TPS WOT input
INPUT 5                        'TPS idle input
OUTPUT 8                       'output to solenoid 1
OUTPUT 9                       'output to solenoid 2
OUTPUT 10                      'output to lockup solenoid

mainloop:

performanceswitch:
IF IN1=0 THEN performanceon    'sets status of performance switch to ON
IF IN1=1 THEN performanceoff   'sets status of performance switch to OFF
performanceon:performance=1
GOTO overdriveswitch
performanceoff:performance=0

overdriveswitch:
IF IN2=0 THEN overdriveoff     'sets status of overdrive switch to O/D OFF (down position)
IF IN2=1 THEN overdriveon      'sets status of overdrive switch to O/D ON (up position)
overdriveoff:overdrive=0
GOTO brakestatus
overdriveon:overdrive=1

brakestatus:
IF IN3=0 THEN brakesoff        'sets status of brakes to OFF (brakes not applied)
IF IN3=1 THEN brakeson         'sets status of brakes to ON (brakes applied)
brakesoff:brakes=0
GOTO tpswotstatus
brakeson:brakes=1

tpswotstatus:
IF IN4=0 THEN tpswotoff        'sets status of tpswot to OFF (throttle is not WOT)
IF IN4=1 THEN tpswoton         'sets status of tpswot to ON (throttle is WOT)
tpswotoff:tpswot=0
GOTO tpsidlestatus
tpswoton:tpswot=1

tpsidlestatus:
IF IN5=0 THEN tpsidleoff       'sets status of tpsidle to OFF (throttle is not at idle)
IF IN5=1 THEN tpsidleon        'sets status of tpsidle to  ON (throttle is at idle)
tpsidleoff:tpsidle=0
GOTO speedsensing
tpsidleon:tpsidle=1

speedsensing:
COUNT 0, 500, newpulses           'retrieves speed sensor info
pulses=(pulses + newpulses)/2  'averages the count to smooth it out
speed = pulses/2

'IF tpswot=1 THEN accel
'IF tpsidle=1 THEN decel
normal:
'IF lastspeed > speed THEN mainloop       'keeps trasmission from downshifting in normal mode
'lastspeed=speed
'IF performance=0 THEN normalgearselect
'IF performance=1 THEN speedmodify        'modifies speed value if performance switch is on
'speedmodify:
'speed = speed - 5
normalgearselect:
IF speed < 15 THEN firstgear
IF speed >=15 AND speed < 25 THEN secondgear
IF speed >=25 AND speed < 40 THEN thirdgear
'IF overdrive = 0 THEN thirdgear
IF speed >= 40 THEN fourthgear

'accel:                                   'acceleration shift pattern
'IF speed < 30 THEN firstgear
'IF 30 <= speed < 60 THEN secondgear
'IF 60 <= speed < 80 THEN thirdgear
'IF overdrive = 0 THEN thirdgear
'IF speed >= 80 THEN fourthgear

'decel:                                   'deceleration shift pattern
'LOW 10                                   'turns off Lock up solenoid
'IF performance=0 THEN normaldecel
'IF performance=1 THEN perfdecel
'normaldecel:                             'normal deceleration pattern
'IF speed < 10 THEN firstgear
'GOTO mainloop
'perfdecel:                               'performance deceleration pattern
'IF speed < 10 THEN firstgear
'IF 10 <= speed < 20 THEN secondgear
'IF 20 <= speed < 30 THEN thirdgear
'GOTO mainloop

firstgear:                                'First gear solenoid activation
HIGH 8
LOW 9
LOW 10
GOTO mainloop

secondgear:                               'Second gear solenoid activation
HIGH 8
HIGH 9
LOW 10
GOTO mainloop

thirdgear:                                'Third gear solenoid activation
LOW 8
HIGH 9
LOW 10
GOTO mainloop

fourthgear:                               'Fourth gear (O/D) solenoid activation
LOW 8
LOW 9
LOW 10
'IF speed < 45 THEN mainloop
'IF speed >= 45 THEN brakeidlecheck
'brakeidlecheck:
'IF brakes=1 THEN mainloop
'IF tpsidle=1 THEN mainloop
'lockup:
'HIGH 10
GOTO mainloop
 
WOW, BASIC coding language. That looks familiar. I took BASIC in college in the late '70's used punch cards. Yea I'm old.
 
Yeah, Basic, I have played with the Basic Stamps some, I have one all breadboarded up to do the LED display for the gears and 4hi, 4lo and 2hi. Just never followed through with installing it in my ride. It would even play the Mission Impossible theme when you turned the key on.
 
I never went for BASIC Stamps... went straight to 8085 and Z80 with assembly language.

Nifty project - an XJ version would definitely need to take throttle position sensor input into account somewhat, or at least I'd want it to.
 
Wow.. Basic. I was taught that in middle school and junior high. Back before hard drives become popular. I never got to use card readers, that was a bit before my time, but my father had a big box of them that he used to make notes on.
 
Back
Top