Define output pin1 pin2 pin3 pin4 ************************** Define input pin5 ************************** Define variable input ;charge value, nominally = 15V x ;pulse width Bat ;bat values = 12. ;bat not used ************************** Set x to 1us to start ;small to protect equipment FREQ 32000 ;32kHz ************************** Loop: Convert pin5 hex Place value in input if (input>15) decrement x If (input<15) increment x If(x>25us) Set X=25us If(x=0us) Set x=1us ;pwm ****************** If(x<5) { Loop 100 times For xus pin1 = ON pin2 = ON pin3 = ON pin4= OFF end For xus to (5-x) us pin1= ON pin2=ON pin3=OFF pin4=OFF End For 5us to 25us Pin1=ON Pin2=OFF Pin3=OFF Pin4=OFF End For 25us to (x+25)us Pin1=on Pin2=ON Pin3=OFF Pin4=ON End For (x+25)us to 30us Pin1 = on Pin2 = on Pin3 = off Pin4 = off end For 30us to 50us Pin1=off Pin2=on Pin3=off Pin4=off } If(x>5us) Loop 100 times For 5us Pin1=ON Pin2=on Pin3=on Pin4=off End For 5us to xus Pin1=on Pin2=off Pin3=on Pin4=off End For xus to 25us Pin1=on Pin2=off Pin3=on Pin4=off End Etc……………………. If (x=0) Loop Etc……………………. end **************************