Shop OBEX P1 Docs P2 Docs Learn Events
Can I expand memory? — Parallax Forums

Can I expand memory?

AImanAIman Posts: 531
edited 2007-01-10 13:13 in BASIC Stamp
Never tried to exapaned memory on a BS2 - Can it be done? If so how?

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-12-20 14:24
    AIMan -

    If you're speaking of program memory, no Stamp can be expanded. If you're speaking of EEPROM, that's a different matter.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2006-12-20 14:58
    If you are looking to add external eeprom - try this link - a simple start !

    http://geocities.com/SiliconValley/Orchard/6633/EEPROM.html
  • dandreaedandreae Posts: 1,375
    edited 2006-12-21 19:09
    You can add a serial EEPROM for data collection, here is a link to some of the EEPROMs that we carry:

    http://www.parallax.com/html_pages/products/basicstamps/oem_components.asp.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • Sarten-XSarten-X Posts: 32
    edited 2006-12-25 06:09
    Out of curiousity, is there an easy way to get parallel data out of an EEPROM? For a project I'm doing, I want to program data in using either serial or parallel, but I'll need to get it out really fast, so I'm thinking parallel is the best way for me to go. I haven't looked into it much, though...
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-25 07:32
    Parallel memory (whether EEPROM or RAM) is always a problem with the Stamps because of the number of I/O pins needed. You need at least 8 data I/O pins plus some number for addressing plus several (4-6) for control. A way to save pins is to use shift registers like the 74HC595. Two of these provide 16 bits of address with only 3-4 I/O pins needed for control. Alternatively you could use two 8 bit counters where both sets of inputs are connected to the data bus. You could load first one, then the other, then increment them to get sequential addresses. For your application, you could read the data off the 8 bit data bus while the counters are incrementing either under control of the external logic or the Stamp. You'd need a load signal for each counter plus an increment, plus read and write control lines. That's 13 I/O pins out of 16.
  • AImanAIman Posts: 531
    edited 2006-12-28 17:15
    So if I want to expand EEPROM is it best to run a second stamp as a slave?

    Also, how much EEprom can I expand into? Can I do 64K or 128K or more?
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-28 18:09
    AIman,
    It's not clear what you want to do. You can add data memory to a Stamp in all kinds of ways. The "best" solution depends on the details.
    What kind of Stamp do you want to use? A BS1? A BS2? A BS2p?
    The BS2p has statements for I2C and SPI built-in. The others do not, but this can be programmed with simpler statements.
    How many pins are available? 2? 14?
    Depending on the type of memory (I2C/SPI/Parallel) this will affect how much external hardware you will need.
    How fast does it need to be?
    Serial memories are slower than parallel memories. On the other hand, EEPROM takes time to write (5ms) and the data transfer time
    may be swamped by the write times.
    Like Sarten-X's project, how are you going to access/provide the data for the memory?
    There are SPI EEPROMs that are as large as 2MB. They're much more complicated to interface to than a smaller, simpler I2C or SPI EEPROM.
  • KatyBriKatyBri Posts: 171
    edited 2006-12-29 02:33
    While reading through this thread, I went to the Parallax site via one of the provided links. This link showed what EEPROMS Parallax sells. At the bottom of this list was a "brownout detector". It's description said it pulled the STAMP reset line to force a reset when a brownout was occuring (bleow a specified voltage).

    Do all of the STAMP BS2 boards have this device?

    How does resetting the BS2 prevent EEPROM data corruption? Is the problem with the BS2 sending "bad" data during a brownout, or is it with the EEPROM, or both?

    If you use your own components (BS2 chip, resonator, regulator, etc.) how do you wire the "brownout detector".

    Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-29 06:27
    See this schematic www.parallax.com/dl/docs/prod/schem/BS2SchematicRevH.pdf to see how to wire the "brownout detector".

    The BS2 is the only current device that needs one since it's based on a PIC processor. The other Stamps use an SX processor which has its own adequate brownout detector. The 24-pin version of the BS2 has one on the "substrate".

    The problem is that the PIC processor will run for a little while when the power supply voltage is too low for reliable operation and can "accidently" send the wrong data or wrong address to the attached EEPROM potentially corrupting the contents of the EEPROM.
  • AImanAIman Posts: 531
    edited 2006-12-29 15:33
    Ok, then if a BS2 is prone to brown out would it be better to use one of my Propeller chips, or one of my SX chips? The only stamps I have are BS2, but if brown out is an issue will it be better to change it out? I prefer to use a BS2 because they are so simple to work with, but if something else is better so be it.

    FYI - this robot goes VERY VERY slow. The tires are 2 1/2 inch diameter and rotate somewhere around 5 rpm. The slowness is needed because of the inspections accomplished, program·speed in processing is not as much of an issue as amount simply because of how slow the robot moves. The consideration of mounting a complete·desktop with hard drives·onto the back of the robot has been thought of seriously. As you may guess the program not only runs the robot and sensors but also collects and logs LOTS and LOTS of data.
  • ForrestForrest Posts: 1,341
    edited 2006-12-29 15:45
    The BS2 is NOT prone to brownout, because it includes a brownout detector.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-29 18:34
    +1 Forrest. Just because your car has a guage that tells you how much gas you have, doesn't make your car "prone to run out of gas". Nor would switching to a Ferrarri help that situation.

    The BS2 is a very reliable platform, BECAUSE it has that brown-out detector.
  • ZactlyZactly Posts: 7
    edited 2006-12-29 19:17
    If you are looking at putting a desktop on the back of a robot that means there is a huge amount of data to record or you can't think of any other way to get extra memory.

    Go with some extra EEProm and stick with the BS2.
  • AImanAIman Posts: 531
    edited 2006-12-29 19:34
    Mike Green said...
    What kind of Stamp do you want to use? A BS1? A BS2? A BS2p?
    How many pins are available? 2? 14?
    How fast does it need to be?

    To·answer to your questions.

    Stamp will be a BS2 with a second if needed

    Right now it looks like there will be 10 pins used not including the·6 IR sensors I want to hook in. So given 16 pins that either means a very full load. If I am correct that IR only takes one pin, if it takes two then I have to run a·slave.

    Doesn't need to be fast but does need to have large memory. Originally I was contemplating getting 64K from EEproms. From what I recall the BS2 can only hold about 500 commands before it ... well ... overloads. The total program will be a few thousand lines when all is said and done.

    Why? Glad you asked.

    All the data is record everytime an event happens on the event horzion.

    Huh?

    Fictional example:

    The Timer says 00:01:35 when the steering servo activates - this is an event. The memory captures the data for everything - motors, sensors -·the works. This data is then used later to create reports.

    ...Does anyone else feel like we're back in the 80's trying to expand an Apple 2 Plus?
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-29 19:48
    More and more it sounds like an 'SX' processor board, running SX/Basic, is what you need.

    75 MIPS, compiles to assembly, and can use BS2 devices. You'll probably need the MMS card writer to get all the data, though. I believe it goes up to 64 MBytes.

    And if you're doing all that, you'll need a 'bandwidth analysis' -- determine how much data needs to be captured, how often, and at what resolution of timing, and how long each device needs to get a reading. You'll need to do this analysis in any case.

    Note the BS2 is ONLY a 2000 Instruction Per Second processor. This is great for prototypes and proof of concepts and for a PC's real-time data capture of a few voltages and button presses. It's not so good for high-volume, heavy-duty, tight-timing applications. Which is what your application is beginning to sound like.
  • AImanAIman Posts: 531
    edited 2006-12-31 06:06
    I topped out my BS2 memory tonight so something needs to happen. The code simply won't fit with the variables being run.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-31 06:35
    Sounds like you're doing basically data logging. Bean (Hitt Consulting) has a nice data logger that is pretty cheap and works just fine with a BS2 using a serial port (one pin for input and one pin for output). It uses an MMC/SD card for the storage and even has a RAM buffer that you can access.
  • AImanAIman Posts: 531
    edited 2007-01-02 16:33
    Something to check into.

    I ran out of variable space as well so there is going to need to be some rethinking.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-02 18:00
    Hello,
    ·
    ·· Often variables can be re-used and memory can be saved in other ways as well.· It could be that the program simply needs to be optimized.· One other option is a BASIC Stamp with Scratch Pad RAM, which could be used for storage of values as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2007-01-02 21:30
    Hello AIman,

    Your example scenario reminds me of·some of the activities in Applied Robotics with the SumoBot.· The later programs really optimize the BS2·memory with temporary variables like Chris mentioned, and by using a single byte as a sensor flag register.· One activity does EEPROM datalogging of·the sensor and navigation states of a SumoBot during a match,·and then displays the report in the Debug Terminal afterward.· The programming strategies might be useful for ideas·even if you don't use a BS2 in the end. The book is a free download from the bottom of this page:

    http://www.parallax.com/detail.asp?product_id=27403

    -Stephanie Lindsay

    Editor, Parallax Inc
  • AImanAIman Posts: 531
    edited 2007-01-03 00:25
    Thanks for the tip about the book. I actually have downloaded all the books and nuts and volts volumes that are available for down load and dig through them fairly often. Obviously I miss stuff sometimes.
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-03 03:40
    if you are looking to store data for later review, why not use an sd card.· With the Hitt consulting SD Data Logger you can store up to 32 mb of data on the SD card and then pull it and stick it into your pc and se it in a .csv file.· This is what i do.· www.SdDataLogger.com· it has all the nessisary comands to interface to a basic stamp and it will only use 1 i/o port






    edit:· Sorry Mike, didnt see that this is also what you said.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!

    Post Edited (altitudeap) : 1/3/2007 3:44:31 AM GMT
  • AImanAIman Posts: 531
    edited 2007-01-04 15:18
    [size=2][code]
    [quote][b]Chris Savage said...[/b]
    [b][/b][/quote][quote]Often variables can be re-used and memory can be saved in other ways as well. 
    
    [/quote]
    


    [/code][/size]
    The probelm I run into is that I need to capture a handful of variables and compare them to earlier data from the same sensor. Running just three sensors means a min of 6 variables of WORD size. That doesn't include any commands contained in the text.
    

    The sonar units each require a Trigger, Echo and Distance. So to compare distance to distance will require two variables for each sonar. I have saved space by running 2 sonar back to back mounted on a servo for 360 degree detection which saved a lot.
    

    There is a geniric variable called TEST that is used repeatedly to collect data for reasons of saving space. I also try to run nested loops during down time so that the BS2 can be mazimaxed.
    

    I will go back over Nuts and Volts - perhaps there are additional things I can do.
    
    Dave Andreae said...
    You can add a serial EEPROM for data collection
    Ok, I looked at the link and have a question - going off what was observed only certain EEproms work with certain stamps - correct? Or can I wire in any EEprom to the stamp of my chosing?
    ·
    Steph Lindsay said...
    One activity does EEPROM datalogging of·the sensor and navigation states of a SumoBot during a match
    Thanks.



    Basiclly I run into a problem of how to cut corners. Most of the time KISS is prevelant because fewer variables are used. In this case I need to use Sonar, IR and bump sensors on the robot so it can navigate around home. Sonar and IR because the light changes drastically from east to north sides and because some of the things to avoid are angled, not straight.

    There is also an issue for bump sensors just incase something gets overlooked. I don't think shoes will care if they get run over but the robot tends to get stuck.

    Perhpas simply using IR in place of bump sensors is the way to go, but again that requires variables.

    Also I am running Several DC motors. One for drive and 4 to power a gripper. There are several servos, one for steering and the rest for the gripper.

    It may be better to mount 2 sonar and 2 IR onto a servo for object detection, but to record distances for navigation is going to be a trick. Also running the motors and servos is going to run into variable issues unless I am mistaken.

    Would it be better to hook the stamp into my old mother board and think of it as a slave to a computer?

    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-04 16:24
    It seems with the type and number of sensors you could really benefit from a BS2p or any Model that has Scratchpad RAM.· What you do is define two WORD variables for comparison an store your intermediate values in SPRAM.· That frees up 4 WORD variable or 8 bytes or variable space.· The two WORD variables would be used for each sensor/calculation so you’d be reusing them.· IR and bump sensors only use 1 bit each, and you could define an array or flags as a single NIB or BYTE variable addressing the corresponding bit within that NIB/BYTE as necessary.· With a little trickery in your main loop you could even use a single bit for all IR/Bump sensors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • AImanAIman Posts: 531
    edited 2007-01-09 18:18
    I think you are right about needing something else. Can I change out the BS2 on the BOE Rev C with a 2p? For that matter is there a board for the 2p40?

    Variables have been removed and used multipule times. Code has been re-written to accomadate problems, however, the BS2 is rather slow at times with the code and for some of the servo stuff it flat out crawls.

    The robot will use 8 different devices and after these are programmed there is very little space left with a BS2 to collect any data - or for that matter store data to use.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-09 18:26
    You can change out the BS2 on the BOE for any other Stamp. There used to be a board for the BS2p40, but it's a discontinued product now
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-09 18:38
    Currently the only development board we have which supports the BS2p40 is the Professional Development Board. Take care.

    http://www.parallax.com/detail.asp?product_id=28138

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • GadgetmanGadgetman Posts: 2,436
    edited 2007-01-09 22:04
    Isn't there a 24pin module with a Propeller chip under development?
    and isn't it supposed to drop right into BS2-compatible boards?

    I seriously think you should consider the Propeller for this robot.
    That, and a SD-card for data-storage.
    (A FAT driver was released recently which should make it easy)

    And with separate COGs working on the drive and sensors, you should even be able to increase the speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • AImanAIman Posts: 531
    edited 2007-01-10 13:13
    I am leaning more and more towards the Propeller for this project. The stamps are simply not up to par for the overall project level. Don't get me wrong, I like my stamps, however the need to link them or to change to something else is now a need.
Sign In or Register to comment.