Shop OBEX P1 Docs P2 Docs Learn Events
Help? BS2PX missing ram, running hot — Parallax Forums

Help? BS2PX missing ram, running hot

ChapsChaps Posts: 4
edited 2006-01-18 21:54 in BASIC Stamp
I replaced a BS2 with a BS2px24 because I need more ram. It does not appear to have any more available than the BS2 when I run this code. Do you know what I'm doing wrong?

Version 2.2.5, my code looks like this:

'{$STAMP bs2px} (Also tried bs2p, it's not clear what to use here)
longdata VAR Byte(11)
latdata VAR Byte(10)
ns VAR Byte
we VAR Byte
out_of_memory_with_this_variable VAR Byte(11)

Also, the stamp runs too hot to touch for more than a couple of seconds. Is that normal? I am running 2 leds, a push button, and a serial input from a Pharos gps360, the load is not heavy.

I've tried searching the forums, "bs2px declaration" comes up with no results.

Thanks for any help!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-18 18:41
    Hello,

    ·· The BS2px has what's called scratchpad RAM, which cannot be used for variables, per se, but it can be used to store data (126 bytes) which can be handled using the GET and PUT commands.· There also may be other ways to reduce or conserve variable usage in your program.· Perhaps you should post it.· What are you lacking variable space for?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-01-18 18:43
    Chaps said...
    Also, the stamp runs too hot to touch for more than a couple of seconds. Is that normal?
    Heat... not good...· the "declaration" isn't a consideration for "heat".

    What's your DC source voltage?· An unregulated wall-pack?· Are you using a Development Board or your own?· Is there a short on the board?

    The PDFs state that the voltage range for a BS2 is 5-15VDC and the range for a BS2px is 5-12VDC.·

    (just a suggestion)
  • ChapsChaps Posts: 4
    edited 2006-01-18 19:08
    Hmm, thanks for the info. I'm using a 9-volt supply regulated by the "BOE" and the GPS is fed from the 5 volt regulator.· I guess adding a little heat sink is in order.

    I was so bleary eyed trying to figure·this out last night that I din't notice that search terms must be seperated by a comma. However, trying a search for "basic, stamp" yields no results!

    What I'm attempting to do is·encode a GPS coordinate into a unique filename for calling up data from another (as yet unattached) device. Something like "w36-55e111-55.png" I'm able so far to read the longitude and latitude and hemisphere data, but that leaves me out of variable space to do anything more. I'll try "put"ing the data into the scratchpad and reuse the variable space for further processing.

    -Steve
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-18 19:12
    I'm curious as to why you need so many bytes for latitude and longitude. Perhaps you could post your current program and we can find a way to trim your variable use (I've done several GPS projects, and the Scratchpad is very useful in this regard).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ChapsChaps Posts: 4
    edited 2006-01-18 19:48
    Sorry, the code is back at the home-office, so I'll try and post it later. There is not much more to it at this point, however, two serin commands read the $GPRMC feed from the gps and store the long, lat data in strings. and ns,ew in single bytes. I then spit them out the debug line I guess I could encode the nsew into a few bits and maybe split the coordinates up into degs, mins, seconds but I do need them to be a single string at some point.

    Incidently, I've found that I can intercept then GPS strings from the Pharos, process out the location, then feed the processed data into the Pharos bluetooth dock with one output pin+ground, yielding a "free" wireless debug port for this and future projects.
  • Clock LoopClock Loop Posts: 2,069
    edited 2006-01-18 20:23
    Chaps said...


    Also, the stamp runs too hot to touch for more than a couple of seconds. Is that normal? I am running 2 leds, a push button, and a serial input from a Pharos gps360, the load is not heavy.

    Thanks for any help!


    Your stamp should not even be getting warm for the most part. Sounds like something you have connected to the pins of your BS2 is draining too much current. You should current test each IN/OUT that your connecting to your BS2, if you don't already have it, think about using 10k resistors between each and every pin out and your circuit.

    What I do is try to run my circuit using 10k resistors to protect my stamp2 from leakage thru other chips and devices.

    For instance, when I hook up a BS2 to a Shift register (595) I use 3 BS2 pins. Data, Shift, and Latch. The 595 also has power and ground.

    If the power or ground were to accidentally get disconnected via bad jumper wire (on a breadboard) or via a bad connection, the 595 will end up pulling power THRU the data, shift and latch wires. So the 595 now is powering its self by draining thru the BS2.... This is potentially very bad, depending on what is hooked up to the 595.

    To avoid this STRAY drain, I "protect" my bs2 pins from the 595 by putting 10k resistors inline with each connection.

    So... BS2(PIN)
    (10k)
    (data on 595)

    If my device (595) doesn't work right, after doing that, I will lower that one lines resistor down to 1k, which usually fixes it.
    Going below 1k doesn't really provide the protection your looking for. Even 1k allows alot. 10k is better, 100k is close to over doing it.

    I had one circuit that used battery power, and I needed to minimize any stray drain, I found out that with a 595, and the bs2, I was able to go as high as 100k between the bs2 and the 595, and still have the two communicate good.

    So, do some current testing. Your BS2 should NOT be getting hot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Meh. Nothing here, move along.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-18 20:34
    You can use the SPSTR modifier to capture your $GPRMC string into the Scratchpad, and then parse it out from there -- this will probably be a big help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ChapsChaps Posts: 4
    edited 2006-01-18 21:54
    SPSTR...I'll delve into it.· And the 10K resistors. I had assumed that since the GPS and stamp are powered from the same soure and I'm only reading output from the gps (its voltage) into the stamp that no drain should occur. I'll rip out the LED's that signal good data being read, maybe I used the wrong value resistor on those.· Thanks everyone for the info, I feel re-charged and am going to jump back in there and finish the fight.

    -Steve
Sign In or Register to comment.