Shop OBEX P1 Docs P2 Docs Learn Events
Battery Problem — Parallax Forums

Battery Problem

ZenexerZenexer Posts: 20
edited 2011-09-05 03:57 in Propeller 1
I am trying to power a Propeller with four AAA batteries in series. 3.3 voltage regulator from the Parallax Store. 0.1 uF capacitor on the unregulated voltage, 10 uF capacitor on the regulated voltage. No matter how simple I make my circuit, the program will not run unless I limit it to a single cog. The moment I start a second cog, the propeller dies, as if I pulled the plug. I've tried fiddling with the capacitors, disabling the built-in brownout detector, and removing EEPROM. The only solution seems to be AC power: I just can't get it to run off these (tested good, brand new) batteries.

Comments

  • ZenexerZenexer Posts: 20
    edited 2011-09-03 15:58
    Slight adjustment to my previous post. It appears to be more related to the number of objects that I have rather than the number of cogs. I can start a second cog if I have three objects (the main object and two sub-objects), but any more than that and it dies when I start the second cog, even with the exact same code--minus the object difference.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-03 15:59
    This does seem strange.

    When you say "tested good" how did you test them? Dead batteries will still read almost normal voltage levels without a load.

    Duane
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:05
    Some cheap RadioShack battery tester. They came straight from the package, too.

    If it helps, I tried putting an LED across Vss and Vdd (with a proper resistor). It never dims or goes out noticeably.

    To eliminate bad components, I tried with a second breadboard and a new set of (fresh) components, all from Parallax. Same effect.

    I tried with four brand new AA batteries. Same effect.
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:11
    Here's my WORKING code. If I get any more complex than this, the Propeller dies around Console.Init.
    #define TERMINAL
    
    CON
      _CLKMODE = XTAL1 + PLL16X
      _XINFREQ = 5_000_000
    
    OBJ
      Console: "Console"
      Card: "Card"
    
    PUB Main
      dira[0]~~
      outa[0]~~
      waitcnt(CLKFREQ * 2 + cnt)
      Console.Init
      Console.ClearScreen
      Console.WriteLine(string("Test"))
    
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-03 16:13
    How about some non-working code?
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:19
    Non-working code. Dies somewhere in/before/after Console.Init.
    #define TERMINAL
    
    CON
      _CLKMODE = XTAL1 + PLL16X
      _XINFREQ = 5_000_000
    
      #1
      DOPinR
      CLKPinR
      DIPinR
      CSPinR[2]
      CDPinR
    
      #9
      DOPinW
      CLKPinW
      DIPinW
      CSPinW[2]
      CDPinW
    
    OBJ
      FatR: "SD-MMC_FATEngine"
      FatW: "SD-MMC_FATEngine"
      Console: "Console"
    
    PUB Main | r
      dira[0]~~
      outa[0]~~
    
     Console.Init
    
      Console.WriteLine(string("Starting FAT read engine."))
      ifnot \FatR.FATEngineStart(DOPinR, CLKPinR, DIPinR, CSPinR, -1, CDPinR, -1, -1, -1)
        Console.WriteLine(string("Could not start FAT read engine."))
        return
    
      Console.WriteLine(string("Starting FAT write engine."))
      ifnot \FatW.FATEngineStart(DOPinW, CLKPinW, DIPinW, CSPinW, -1, CDPinW, -1, -1, -1)
        Console.WriteLine(string("Could not start FAT write engine."))
        return
    
      Console.WriteLine(string("Mounting read file system."))
      r := FatR.MountPartition(0)
      ifnot (r == true) OR (r == false)
        Console.WriteString(string("Error mounting read file system: "))
        Console.WriteLine(r)
        return
    
      Console.WriteLine(string("Formatting and mounting write file system."))
      r := FatR.FormatPartition(0)
      ifnot (r == true) OR (r == false)
        Console.WriteString(string("Error formatting/mounting write file system: "))
        Console.WriteLine(r)
        return
    
      Console.WriteLine(string("Stopping FAT engines."))
      \FatR.UnmountPartition
      \FatW.UnmountPartition
      \FatR.FATEngineStop
      \FatW.FATEngineStop
      Console.WriteLine(string("Done."))
    
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:21
    I keep thinking there must be an abort call somewhere, but then I remind myself that it works on AC power.
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:22
    This code works, though Console.Init appears to abort, since Run stops running around there. I think I need to reassess the problem.
    #define TERMINAL
    
    CON
      _CLKMODE = XTAL1 + PLL16X
      _XINFREQ = 5_000_000
    
      #1
      DOPinR
      CLKPinR
      DIPinR
      CSPinR[2]
      CDPinR
    
      #9
      DOPinW
      CLKPinW
      DIPinW
      CSPinW[2]
      CDPinW
    
    OBJ
      FatR: "SD-MMC_FATEngine"
      FatW: "SD-MMC_FATEngine"
      Console: "Console"
    
    PUB Main
      dira[0]~~
      outa[0]~~
      \Run
      repeat
        outa[0] := !outa[0]
        waitcnt(CLKFREQ / 10 + cnt)
    
    PRI Run | r
     Console.Init
    
      Console.WriteLine(string("Starting FAT read engine."))
      ifnot \FatR.FATEngineStart(DOPinR, CLKPinR, DIPinR, CSPinR, -1, CDPinR, -1, -1, -1)
        Console.WriteLine(string("Could not start FAT read engine."))
        return
    
      Console.WriteLine(string("Starting FAT write engine."))
      ifnot \FatW.FATEngineStart(DOPinW, CLKPinW, DIPinW, CSPinW, -1, CDPinW, -1, -1, -1)
        Console.WriteLine(string("Could not start FAT write engine."))
        return
    
      Console.WriteLine(string("Mounting read file system."))
      r := FatR.MountPartition(0)
      ifnot (r == true) OR (r == false)
        Console.WriteString(string("Error mounting read file system: "))
        Console.WriteLine(r)
        return
    
      Console.WriteLine(string("Formatting and mounting write file system."))
      r := FatR.FormatPartition(0)
      ifnot (r == true) OR (r == false)
        Console.WriteString(string("Error formatting/mounting write file system: "))
        Console.WriteLine(r)
        return
    
      Console.WriteLine(string("Stopping FAT engines."))
      \FatR.UnmountPartition
      \FatW.UnmountPartition
      \FatR.FATEngineStop
      \FatW.FATEngineStop
      Console.WriteLine(string("Done."))
    
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:29
    That's really strange... suddenly everything is working. I'm going to play around with it a bit to make sure it's really solved.
  • ZenexerZenexer Posts: 20
    edited 2011-09-03 16:39
    I'm not going to mark this as solved or unsolved, since I have absolutely no clue what happened. It just started working with the exact same code and circuit.
  • kwinnkwinn Posts: 8,697
    edited 2011-09-03 17:34
    Sounds like a bad contact or cold/no solder joint that you have temporarily fixed by handling the hardware.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-03 17:47
    How many 0.1uF ceramic bypass caps do you have between Vdd and Vss right at the power pins on the Propeller chip? (If the answer is "none", this could be the root of your problems.) A 10uF filter capacitor is not enough. You also need local bypassing.

    -Phil
  • bsnutbsnut Posts: 521
    edited 2011-09-03 23:48
    I agree with Phil on this one and suggest you to look at a schmatic for one of the Parallax boards to give you an idea how they setup there cap values for providing power to the Propeller
  • Mark_TMark_T Posts: 1,981
    edited 2011-09-05 03:57
    kwinn wrote: »
    Sounds like a bad contact or cold/no solder joint that you have temporarily fixed by handling the hardware.

    I'd agree with this diagnosis - I've been hit in the past by some cheap battery holders that have dodgy riveted contacts (leading to sporadic intermittent behaviour), this would explain the behaviour nicely.
Sign In or Register to comment.