Looking for low cost solution
TC
Posts: 1,019
I have a working project that uses a BS2 to control an old ATX power supply that I am using for a bench supply. But I am having problem with wasting a $50 part to do a simple task. I would like to use a much cheaper option. I am willing to pay someone that has the software/hardware to help me out. Here is the code I made that works. I do not want to spend an arm and a leg.
Thank you for looking and thanks for any and all input or help.
TC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!
' {$STAMP BS2} ' {$PBASIC 2.5} 'ATX power supply controler 'PINS PWR_OK PIN 0 'active high when power supply is OK (input from PS) PS_ON PIN 1 'active low to turn on power supply (output to PS) SW_ON PIN 2 'return to center rocker switch SW_OFF PIN 3 'return to center rocker switch LED_GRN PIN 4 'dual color led green LED_RED PIN 5 'dual color red red 'VAR BUTTON_CTRL VAR Byte POWER_CHECK VAR Bit 'program POWER_SUPPLY_OFF: 'Turm power supply off program HIGH PS_ON 'High output PS_ON to turn power supply off HIGH LED_RED 'turn on RED LED LOW LED_GRN 'turn off GREEN LED POWER_CHECK = 0 'set power supply flag to 0 GOTO BUTTON_CHECK 'go to main program BUTTON_CHECK: 'switch state program IF PWR_OK = 0 AND POWER_CHECK = 1 THEN POWER_SUPPLY_SHORT 'check if power supply is shorted BUTTON SW_ON,0,0,0,BUTTON_CTRL,1,TURN_ON 'switch moved to on BUTTON SW_OFF,0,0,0,BUTTON_CTRL,1,POWER_SUPPLY_OFF 'switch moved to off GOTO BUTTON_CHECK 'do it agian TURN_ON: 'make sure switch stays on until power supply is OK LOW PS_ON 'turn power supply on LOW LED_RED 'turn off RED LED IF PWR_OK = 1 THEN POWER_SUPPLY_ON 'check if power supply is ok, if OK end turn on loop BUTTON SW_ON,0,0,0,BUTTON_CTRL,1,TURN_ON 'is switch ON? GOTO POWER_SUPPLY_OFF 'if not, turn off power supply POWER_SUPPLY_ON: 'power supply is OK HIGH LED_GRN 'turn on GREEN LED POWER_CHECK = 1 'set power supply flag to 1 GOTO BUTTON_CHECK 'go check the switch POWER_SUPPLY_SHORT: 'flash the LED RED/GREEN and shut off power supply if power supply HIGH PS_ON ' is not OK any more LOW LED_RED HIGH LED_GRN PAUSE 200 LOW LED_GRN HIGH LED_RED PAUSE 200 BUTTON SW_OFF,0,0,0,BUTTON_CTRL,1,POWER_SUPPLY_OFF 'must switch switch off to reset power supply GOTO POWER_SUPPLY_SHORT
Thank you for looking and thanks for any and all input or help.
TC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!
Comments
Another inexpensive option would be a PICAXE which are a bit over $10 and are also programmed in a BASIC dialect and a serial cable.
An AVR with support components would be about $12, but you'll need a programming plug which would be another $6 (using Arduino boot-loader) to $19 (6-pin ISP programmer for vanilla AVR).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
The 50 would be better spent on a Propeller chip,
a Prop Plug and a free copy of PropBASIC.
Personally, I'd use a Tiny88 and WinAVR for this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
justasm.blogspot.com/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“How much of human life is lost in waiting.” Ralph Waldo Emerson"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
TC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!