Just want to make sure this code doesn't fry my board before i try it
I just pulled apart a Christmas present of pass which is an old "RAD Robot" I have. I am using a SN754410 Quad Half H-Bridge IC www.sparkfun.com/commerce/product_info.php?products_id=315 to power the opening and closing of the arms and the leaning forward and backwards of the torso. So I have it wired up to my propeller education kit via the pin layout described here www.hobbyengineering.com/appHBridge1A.html however I am really afraid of frying it with the code I have. I have hooked this up on the BS2 before and it worked fine, but with that I just told two of the 4 signal pins to send HIGH commands and the others to have LOW and then just changed it. With the propeller I am a bit confused by the dira and the outa commands. I just need pins 27 and 25 to receive HIGH while 24 and 26 LOW and conversely.
If some one can help with this very simple problem that would be great, I am just afraid of having something get fried ha ha.
Thanks!
If some one can help with this very simple problem that would be great, I am just afraid of having something get fried ha ha.
Thanks!

Comments
as you didn't attached your code I can only say a little
DIRA is to set the DIRection of an IO-Pin
OUTA is for setting the IO-pins voltage
I enjoyed porting the BS2-example-code to SPIN
{BS2-Code: MotorID VAR Byte ' Current Motor ID } 'ported to SPIN 'see lines with PUB MotorBrake(MotorID), PUB MotorReverse(MotorID) etc. CON {BS2-code: Motor1 CON 1 ' Motor 1 control on stamp pins 1, 3 and 5 ' SN754410 pins 1 (1,2EN), 2 (1A) and 7 (2A) Motor2 CON 2 ' Motor 2 control on stamp pins 2, 4 and 6 ' SN754410 pins 9 (3,4EN), 10 (3A) and 15 (4A) } 'ported to SPIN: CON Motor1 = 1 Motor2 = 2 LOW = 0 HIGH = 1 {BS2_code: Loop: DEBUG CR, "s" MotorID = Motor1 GOSUB MotorBrake MotorID = Motor2 GOSUB MotorBrake PAUSE 1000 .... DEBUG "R" MotorID = Motor1 GOSUB MotorReverse MotorID = Motor2 GOSUB MotorReverse PAUSE 1000 GOTO Loop } 'ported to SPIN PUB Main DIRA[noparse][[/noparse] Motor1 + 0 ] := 1 'setup IO-Pins as outputs DIRA[noparse][[/noparse] Motor1 + 2 ] := 1 DIRA[noparse][[/noparse] Motor1 + 4 ] := 1 DIRA[noparse][[/noparse] Motor2 + 0 ] := 1 DIRA[noparse][[/noparse] Motor2 + 2 ] := 1 DIRA[noparse][[/noparse] Motor2 + 4 ] := 1 repeat MotorBrake(Motor1) MotorBrake(Motor2) WaitCnt(ClkFreq + cnt) 'wait for one second MotorCoast(Motor1) MotorCoast(Motor2) WaitCnt(ClkFreq + cnt) 'wait for one second MotorForward(Motor1) MotorForward(Motor2) WaitCnt(ClkFreq + cnt) 'wait for one second MotorReverse(Motor1) MotorReverse(Motor2) WaitCnt(ClkFreq + cnt) 'wait for one second 'the INDENTION defines what belongs to the repeat-loop 'no "end of loop statement required even NOT defined in SPIN {BS2-Code: MotorCoast: LOW MotorID HIGH MotorID + 2 HIGH MotorID + 4 RETURN } 'ported to SPIN PUB MotorCoast(MotorID) OUTA[noparse][[/noparse] MotorID + 0 ] := LOW OUTA[noparse][[/noparse] MotorID + 2 ] := HIGH OUTA[noparse][[/noparse] MotorID + 4 ] := HIGH {BS2-Code: MotorBrake: HIGH MotorID LOW MotorID + 2 LOW MotorID + 4 RETURN } 'ported to SPIN PUB MotorBrake(MotorID) OUTA[noparse][[/noparse] MotorID + 0 ] := HIGH OUTA[noparse][[/noparse] MotorID + 2 ] := LOW OUTA[noparse][[/noparse] MotorID + 4 ] := LOW {BS2-Code: MotorForward: HIGH MotorID HIGH MotorID + 2 LOW MotorID + 4 RETURN } 'ported to SPIN PUB MotorForward(MotorID) OUTA[noparse][[/noparse] MotorID + 0 ] := HIGH OUTA[noparse][[/noparse] MotorID + 2 ] := HIGH OUTA[noparse][[/noparse] MotorID + 4 ] := LOW {BS2-Code: MotorReverse: HIGH MotorID LOW MotorID + 2 HIGH MotorID + 4 RETURN } 'ported to SPIN PUB MotorReverse(MotorID) OUTA[noparse][[/noparse] MotorID + 0 ] := HIGH OUTA[noparse][[/noparse] MotorID + 2 ] := LOW OUTA[noparse][[/noparse] MotorID + 4 ] := HIGHbest regards
Stefan
Pin (of the SN754410) :
1: Vdd
2:P27
3: Motor 1 A
4: Vss
5: Vss
6: Motor 1 B
7: P26
8: Negative terminal on the battery
9: Vdd
10: P25
11:Motor 2 A
12: Vss
13: Vss
14:Motor 2 B
15: P24
16:Positive terminal on the battery
and the code (among many, that i have now tested) is
PUB LedsOn
repeat
dira[noparse][[/noparse]24..27] := %1111
outa[noparse][[/noparse]24..27] := %0101
waitcnt(clkfreq + cnt)
outa[noparse][[/noparse]24..27] := %1010
waitcnt(clkfreq + cnt)
Thank you so much, Happy Holidays!
Thanks again
Clock Loop mentioned that the SN754410-chip needs a SUPPLY-voltage of minimum 4.5V
so supplying it with 3.3V is too low
The IO-Pins start with zero not with 1
To do more analysing you have to provide a schematic of how you wired EVERYTHING
This means connections from Prop to SN754410 and SN754410 with the motor
With ALL pins numbered and named.
best regards
Stefan