Shop OBEX P1 Docs P2 Docs Learn Events
Running programs from an external EEPROM — Parallax Forums

Running programs from an external EEPROM

Robert SchwartzRobert Schwartz Posts: 141
edited 2005-03-23 22:08 in General Discussion
Is it possible to write a program to an external EEPROM and have the SX run it?

Comments

  • James NewtonJames Newton Posts: 329
    edited 2005-03-21 23:52
    The absolute correct answer to that question is YES.

    ...Ok, ok, I'll give you a hint: You didn't ask what language you could write the program in.

    In short, you can't execute SX machine code from external memory. You must write an token interpreter that fits INSIDE the SX and then you can put the tokens in the EEPROM.

    Read about "token interpreter", XPL0, "BASIC STAMP", "byte-code interpreter"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james@sxlist.com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-03-22 00:58
    Thanks James, but that sounds a bit too complicated for me. Do you know if this is possible on PIC chips or Amtel Mega's?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-22 01:21
    Perhaps those questions are better posted on PICmicro and Atmel support boards.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-22 03:16
    Robert, I am nearly certain that neither do. The SX, the ATmega, and PIC are harvard architecture microcontrollers, meaning thier program space and data space are accessed on two different busses, there are several reasons for the but it is beyond the scope of what you asked. But most harvard architecture processors availible on the market do not support memory expansion, this isnt an issue at least with the mega series which has devices with 128K program space.

    I am curious why several people are expressing questions along these lines. Microcontrollers were never meant to replace the functionality of full processors, they are designed for embedded systems which require complex logic to operate but are limited in thier scope and function (and hence a full processor is overkill and too much cost), perhaps you should be looking for an embedded 386 system or rabbitcore.

    Post Edited (Paul Baker) : 3/22/2005 3:21:14 AM GMT
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-03-22 16:57
    Along these lines, may I ask a question of our veteran/professional microcontroller people here? Is it true that if you find you are running out of code space then you need to either a)select a different 'tool' for the job (i.e. a different chip/processor/ic) or b) you are not going about accomplishing your task properly?

    I guess what I'm getting at: ever since I've started using micros, my friends (mostly coders, like me) always love to look at my hardware, but then jump to the question "how much memory does it have" - I try to explain that this isn't a computer- that the tasks being dealt with are different in scope than what I would use a PC for. I guess it is all a matter of selecting the proper tool for the job (or in this case uController)- and the ability to do *that* properly comes with experience...

    Honestly how often has running out of code space been a problem for people with their Stamps? SXes? I would really love to hear some feedback about this.

    Ryan
  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-03-22 23:17
    I wanted to be able to run a program off an EEPROM in a ZIF socket to run a SX52. You could just swap EEPROMS to have different functions. Paul, I think that I will just switch to a 386 or similar. Does anyone know of a pre-written bootloader I could use? Is this possible on a Basic Stamp?

    Post Edited (Robert Schwartz) : 3/22/2005 11:43:27 PM GMT
  • KenMKenM Posts: 657
    edited 2005-03-23 05:09
    An experienced and good programmer like Jon Williams at this forum stated once, or something to the effect that in all the years he has been programming stamps, he has run out of space once.

    And Jon has written some very complex programs.

    I will go out on a limb and state that efficient programming is the key, and efficient programming is far easier said than done.
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-03-23 14:55
    My project is to develop a moble robot, substantialy larger than a boe-bot. My first prototype was built with an BS2-1C as the 'brains' for the unit. Basically it controlled the two DC motors, an IR/Detect, and a remote control; it ran just as expected. But I soon realized that I had reched the limitations of the BS2. About this time the SX/B was introduced , and a price drop on the Tech kit. So I decided to start leaning in the direction of SX chips.

    Now to address the point of this thread; in my mind a 'usefull' robot has to have some sort of 'navigation' aspect, ie - mappping of an area, remembering objects that were encountered, and ability to return back to the charging station before the batteries run dry, to name a few items. All of the above mentioned would have to have access to some fast memory. And their is code examples for doing all this to be considered.

    I was thinking on going the route of an SX52 with access to a lot of eeprom (or something simillar), but I think that would have a very limited capability. I purchased a xx386 SBC with an I/O expansion card. I was thinking of having that be the 'brains', and interface to some SX chips that would do the 'grunt' work. The BIG problem, interfacing of the two, and not having to make a sacrifice in the comunication speed between the two 'systems'.

    So the best solution that I can envision is Parallax comming up with a 'computer' chip, 32 bits of course, at a very reasonable cost (less than a $100), that would be able to interface to the SX chips, smoothly, and access mass storage, and/or other things. Have the same language to work with between the two (probably both assembly and SX/B). How about that for a wish list.

    In the mean time my project has stalled, the wrong decission could end up costing a lot of time and money which would not have been well spent. So I guess I am open for some ideas.
  • BeanBean Posts: 8,129
    edited 2005-03-23 15:18
    I would think that using GPS for navagation would be SO much simpler.
    Unless there is a reason why GPS cannot be used ???
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video Display Module" Available Now.

    www.sxvm.com

    "A problem well defined, is a problem·half solved."
    ·
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-03-23 16:09
    Bean,

    I thought about GPS. Lets explore, GPS will tell the robot, in real time, within a couple of feet, where it is. Now, do I plan to map out objects, especially the edges, in numbers that the robot can understand. So everytime you move a chair, you have to have a seperate GPS module to tell you the location, then you have to feed the information to the robot. This falls in the premapping or prelearning scenario. This has to be consired if you want the robot to do some usefull things, and not just spend its time moving around and mapping 24/7.

    The other aspect is, lets say an SXxx chip does this, is their example code that is readilly available to achieve this(SX/B preferrably)? And once it starts getting all this data, how and where does it put it. From what I have read about the GPS systems, for BS2's at least, they are quite difficult to work with.

    I am sort of leaning in the direction of, via an IR remote control, you walk a robot through some designated path, and have the robot remember the path. In order to do this I am thinking some simple devices like a compass with 1 degree graduations, a sonar unit, and some IR/detect units. I have recently learned that Intel, in the near future, will have some laser technology that will be used for measurng distances. Something like that could replace the IR/detct unit, and the sonar. The IR, and sonar could be interfaced via I2C fairly quickly, again I like to work in basic when I am doing prototype work. GPS could become a unit of choice if the afermentioned problems could be overcome quickly and cheaply. I hope my drift is becomming apparent, QUICKLY and CHEAP for prototype work.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-23 16:53
    Rsadeika: the stuff you speak of sounds like it is capable of being accomplished via a SX52, with 40 I/O lines theres plenty of room to add SRAM to hold all the map data you seek to store, with a couple external chips the same can be done with an SX28, though incorporating all the features may run you into the 2K limit. If you are worried about your data in case of power loss you can always buy an NV-SRAM from Dallas, or one of thier memory backup chips that detect power loss and supply the SRAM power from a lithium battery to hold the contents. Another option is just interfaceing more than one SX, each would have thier subset of sensors to monitor and report the cooked data (processed) to the main SX which performs the appropriate action. If your deadset on interfacing the SX with a x86 system check out the code on the downloads page titled "Demo of the SX28 interfaced to ISA-XT Bus".
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-23 17:18
    The PIC chip (and the SX, which is a very-very fast PIC) was intended as a "Peripherial Interface Controller" (I believe that's the acronym) -- meaning have some 'higher' level processor (the x386) use the PIC as its 'real-time' interface.

    So, you need a fast interface between the 'slave' BS2 (or SX) and the 'master' x386. You can use RS-232 for that, or even RS-485. I believe the SX can support 115 KBaud -- which can do a lot if you've defined your communication protocol correctly (simply, that is).

    But it's way overkill to expect Parallax to leave their niche market -- small, battery powered, very simple to use processors -- and ask them to build a 32-bit, lots of RAM, lots of EEPROM processor just for you. There are many vendors out there (ok, more than 20) building small processor boards using '386, '486 or larger chips. The Rabbit boards are quite capable using a super-Z80.

    If you've already got an x386 single board processor in there, why not use DOS or Linux and do the real-time extensions on top of that? Use each piece for what it is good for, is my advice.

    Oh, and this WAS Bob Schwartz thread, I think.· I don't know who this other guy is.

    And Bob, the 'bootloader' approach that can be used in the 16F876 family of PIC processors (and later) -- I'm not sure if it is supported by the SX52, but you would think it would be.· It depends on a feature of the PIC processors that allow a 'protected' area of Flash to write to another area of Flash.· I'm not sure if this hardware feature is in the SX family.

    Post Edited (allanlane5) : 3/23/2005 5:21:42 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-23 17:24
    I agree this thread is going in too many directions, lets just stick to the original question posed by Robert, and split the other topics into seperate threads if there are further questions on them.

    I do not think the SX supports bootloading, I've read and re-read the specs to the SX, and I would have remembered seeing this feature. Now, you could mimic what the SX-Key does so that a boot loader controller would program the SX from an external EEPROM, but this seems like it would be more hassle than it is worth.

    Post Edited (Paul Baker) : 3/23/2005 5:29:47 PM GMT
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-03-23 17:51
    Paul,

    One of the scenarios that I was looking into, a few weeks ago, was just that, using an SX52 as the brains, and that would be linked with maybe two to three SX28's. In fact in a previous thread I brought up the topic of networking the SX's. My chief concern is the 'memory' aspect, once you run out, out goes what is left of my hair. I try to keep to the 'KISS' principal as much as possible.

    Since Paralax is going to be presenting an SX52 tech board, I may have to reconsider that scenario. What I need right now is a lot more info about the new SX52 tech board, I already saw the 'teaser' a week or so ago. The other thing that I have to consider is a multitasking element for the "brains', hopefully the person that developed the RTOS is thinking 'public domain', and if that RTOS is robust enough to do what I need it to do.
  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-03-23 22:08
    I tihnk that I will just use a single-board 386 computer or maybe a bootloadind PIC. Thanks for all the help guys.
Sign In or Register to comment.