Originally posted by nvisser
View Post
In basic code, the program reads line by line, thus I will explain the code line by line and put my comments in ()
Start: (this just is the begining)
SYMBOL ChargeSense = W1 '###### Reserves buffer for ChargeSense Value
SYMBOL BattLVLSense = W2 '##### Reserves buffer for BattLVLSense Value
SYMBOL TotalCompare = W3 '# Reserves buffer for TotalCompare
(the above is allocating buffer space in the chip to reserve room for variable values)
Main:
(this is the start of the routine that is read until the end of the program or a goto Main command is encountered)
pause 200
(i am pausing here to balance the program. The last line being read before the goto Main is Pin 6, 5 being told to go low (0 volts) and because the routine will just loop right back to the next line, which is to turn Pin's 4 and 7 high)
high 4, 7
(I am turning Pins 4 and 7 high (5 volts) which will fire Q1 and Q9. Q1 puts Batts 1 and 3 in series and Q9 opens up)
pause 150
(now that I have Q1 turned on, I am just keeping him on for 150 milli seconds)
low 4, 7
(I am now turning off Q1 and closing Q9)
pause 100
(this is another pause of 100 milli seconds, AKA "Deadtime")
high 6, 5
(I am now turning on Q2 and opening Q10)
pause 150
(now that I have Q2 turned on, I am just keeping him on for 150 milli seconds)
low 6, 5
(I am now turning off Q2 and closing Q10)
goto Main
(This returns me right back up to Main: an starts the process over and over and over---well you get the idea.
The adjustments that you guy's make with the Caps and resistors on the 3524for the frequency, I make with the "pause" command. For fine tuning the load I make with the tranny's "On time". This is kind of long winded, but I wanted you to understand the basics of "Basic".
Hope this helps.
Bit's
Comment