Shop OBEX P1 Docs P2 Docs Learn Events
Looking for low cost solution — Parallax Forums

Looking for low cost solution

TCTC Posts: 1,019
edited 2010-07-22 22:08 in General Discussion
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.
' {$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

  • Martin_HMartin_H Posts: 4,051
    edited 2010-07-22 02:18
    Well you could buy and build an OEM BS2 kit as they are $30. They work exactly like a regular BS2, they're just a little larger. A BS2 OEM lite might even be a little cheaper if you already have a programming plug.

    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).
  • TCTC Posts: 1,019
    edited 2010-07-22 02:38
    The only thing is, at this point in time is I only know how to program in pbasic. Was thinking of using a bs1 but I don't have a programing adapter. When I get home again I will check out the other options.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    We all make mistakes when we are young………That’s why paste is edible!
  • LeonLeon Posts: 7,620
    edited 2010-07-22 02:45
    if you have a parallel port you can make an AVR programmer for about $2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-07-22 07:52
    I would not use a 50.00 part to do this.

    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/
  • iDaveiDave Posts: 252
    edited 2010-07-22 08:19
    Picaxe baby...picaxe. Just a few dollars a piece and if your used to pbasic the picaxe basic is not that dissimilar.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “How much of human life is lost in waiting.” Ralph Waldo Emerson"
  • ercoerco Posts: 20,260
    edited 2010-07-22 20:09
    Picaxe, or a Kronos Athena ($5, BS1-like) or Nemesis ( $7, BS2-like). BASIC programmable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • TCTC Posts: 1,019
    edited 2010-07-22 22:08
    sounds like picaxe is the best option. It looks easy to work with and cheep. Thank you for everyones help

    TC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    We all make mistakes when we are young………That’s why paste is edible!
Sign In or Register to comment.