Jump to content

mattanonymous

Members
  • Content Count

    5
  • Joined

  • Last visited


Reputation Activity

  1. Like
    mattanonymous reacted to grahamf72 in Need help with simple 'once every hour' program   
    Try declaring your state variable as "volatile int state = 0".
     
    For low power delays, try the code sample in this thread:
    http://forum.43oh.com/topic/3447-sleep-mode-during-a-fixed-duration/
  2. Like
    mattanonymous reacted to pjkim in Need help with simple 'once every hour' program   
    Your circuit diagram shows the input to the MCU but not the output circuit. Are you by chance driving the buzzer/relay directly from a GPIO pin? If you are, two things.
     
    1) This would explain the buzzer working once and not the relay. Buzzers need a lot less current and can be driven directly depending on the buzzer. Relays need more than a GPIO pin can provide.
    2) Relays are inductive so if you drive them with a GPIO without a protection diode, the voltage kick at turn off will fry your output pin. This might explain why you said it worked once. Is the buzzer no longer working? You might have fried that pin.
  3. Like
    mattanonymous reacted to Rei Vilo in Need help with simple 'once every hour' program   
    Replace 
    pinMode(moistPin, INPUT); by
    pinMode(moistPin, INPUT_PULLUP); The switch is connected to GROUND.
     
    Without INPUT_PULLUP, the input is floating.
  4. Like
    mattanonymous reacted to spirilis in Help reducing power consumption please :)   
    That is bizarre, 40mA is a lot for that chip even when it's in fully active mode (I don't think it draws that much even if you have it in a busy-wait loop nonstop at full 16MHz active mode). What else is in the circuit?
     
    Also where are you measuring the 40mA -- at the Vcc jumper between the EMULATION and main portion of the launchpad board, or from the USB port? The emulation layer would use a fair amount of power keeping its chips & LED functioning which could account for that although I'm not really sure. And if the Vcc jumper is still installed but you're powering it from an external battery, the emulation layer (SBW programmer/UART) chips up top might still be receiving power back through that jumper... removing it should tell you.
  5. Like
    mattanonymous reacted to gordon in Help reducing power consumption please :)   
    ... but it still might be better safe than sorry (again, depending on what your compiler does).
  6. Like
    mattanonymous reacted to spirilis in Help reducing power consumption please :)   
    ah hmm right, guess the while(1) isn't necessary since the ISRs never perform a __bic_SR_register_on_exit() to wake it up.
  7. Like
    mattanonymous reacted to RobG in Help reducing power consumption please :)   
    Swap two lines of code and add LPM3 (low-power mode.)

    turnBuzzerOff(); //initialize buzzer state __bis_SR_register(GIE + LPM3); // Enable all interrupts
×
×
  • Create New...