mattstrike
New member
New to PICAXE, but have some basic questions (took a class in Java at one point).
I've decided to dive right into the project I'm working on, which is a stand-alone controller for the torque converter on my truck project. Using the 08m2, three 5v digital inputs, one analog input (switched to ground between 0-100hz), and a single output that will go to a transistor control of a relay.
First question I have, is if I use the command high C.5 (or any pin) over and over again, will it cause issues? Let's say that the code has previously resulted in a C.5 high, then loops back to the beginning, then C.5 high comes up again does it have a problem if it's already at the high state? My initial thought was that it might cause instability and that the code should check the status, and only execute C.5 high if it's not already high. But I couldn't figure out how to check C.5 for it's current state before commanding high C.5
Here's an excerpt from what I'm trying to accomplish (I was going to post the full code, but limited by characters):
I guess I thought that TCC0: and TCC1: processes should be able to poll the current state of C.5 and only run if the state is not already set.
My second question is related to how one of the input signals works. VSS output from the vehicle PCM is described as follows:
In my application, there is nothing connected to this PCM output. So I think this means that I need to make sure that this input has a pull-up resistor to make sure it gets to 5v - the VSS signal won't exceed 100hz - how do I calculate the correct pull-up resistor if it's connected to the 5v input for the PICAXE?
I can post more details (circuit, code) if I need, let me know.
I've decided to dive right into the project I'm working on, which is a stand-alone controller for the torque converter on my truck project. Using the 08m2, three 5v digital inputs, one analog input (switched to ground between 0-100hz), and a single output that will go to a transistor control of a relay.
First question I have, is if I use the command high C.5 (or any pin) over and over again, will it cause issues? Let's say that the code has previously resulted in a C.5 high, then loops back to the beginning, then C.5 high comes up again does it have a problem if it's already at the high state? My initial thought was that it might cause instability and that the code should check the status, and only execute C.5 high if it's not already high. But I couldn't figure out how to check C.5 for it's current state before commanding high C.5
Here's an excerpt from what I'm trying to accomplish (I was going to post the full code, but limited by characters):
Code:
Sensor0: ;Label Sensor0 - read sensors
; pause 500 ;optional wait 500ms
Count C.3, 1000, speed ;VSS - Count pulses over 1 second, output variable is named speed
ReadADC C.1, throttle ;TPS - Read sensor, output variable named throttle
ReadADC C.2, boost ;MAP - Read sensor, output variable named boost
goto Main0
;Current state variables defined.
;Begin Main Logic
Main0: ;Label Main0.
if speed < v_0 then ;If speed is less than 25mph
goto TCC1
end if
if speed > v_0 then ;if speed is greater than 25mph
if throttle < t_0 and boost < b_0 then ;if throttle is less than 20% and boost less than 2.5psi
goto TCC0
end if
goto TCC1
end if
;TCC processes
TCC0: ;label TCC0
high TCC ;turn on TCC
goto Sensor0 ;loop back to sensor read
TCC1: ;label TCC1
low TCC ;Turn off TCC
goto Sensor0 ;Loop back to sensor read
My second question is related to how one of the input signals works. VSS output from the vehicle PCM is described as follows:
Code:
; The vehicle speed sensor in the trans is a permanent magnet generator that produces a sine wave output.
; That signal is fed to the PCM, which uses it to produce a vehicle speed output signal
; that is switched to ground at a frequency of 4000 pulses per mile.
; That output is pulled up to 5V or higher by the speedometer, cruise module, etc.
I can post more details (circuit, code) if I need, let me know.