Shop OBEX P1 Docs P2 Docs Learn Events
Dual Application/ EEPROM — Parallax Forums

Dual Application/ EEPROM

JonnyMacJonnyMac Posts: 9,105
edited 2014-06-25 12:15 in Propeller 1
I have this project that could benefit from having dual applications in the same hardware, and I can't fit both into 32K.

My memory seems to think that somebody has done this -- I just cannot remember how or where.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-06-21 16:40
    If both apps use some of the same objects, they might fit if you roll them into one app and use an input pin to select which thread to execute.

    -Phil
  • jazzedjazzed Posts: 11,803
    edited 2014-06-21 16:51
    A 32KB EEPROM would be a convoluted nut to crack.

    64KB EEPROM would be easy.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-06-21 18:17
    Do you have a 64KB eeprom? If so, then you could have the second program in the upper 32KB. When the program runs the lower 32KB checks to see if the alternate upper 32KB needs to be loaded.

    If you use two 32KB eeproms, then you could use an XOR chip (one as an invert/non-invert say A0, then another to invert the A0 to the second eeprom). Inversion/noninversion can be selected using a pullup and shunt to ground.

    IIRC there is code to load an upper 32KB eeprom.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-06-21 18:42
    Sorry, guys, should have made the clear. I have a 64K EEPROM.
  • jazzedjazzed Posts: 11,803
    edited 2014-06-21 19:13
    Here are some files. One to program upper 32KB, another to load the program.
    The loader is limited to 25KB, but that could be fixed if all the code was PASM.

    You'll get the idea looking at the code. Rewrite as required.

    EEprog32Kplus needs modification to actually do programming. It's set to read only now.

    As is, no warranty. I haven't used these in a while.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-06-22 20:42
    My PropOS has commands to program the lower and upper 32KB of the eeprom. It uses a microSD which I presume you don't have. This might also help you (see the link in my signature, and go to the end of the thread for the latest code).
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-06-22 21:57
    Somewhat different, but easily modified for your question, is the method I used for my Thermistor Cable Tester. The main program checked for a secondary EEPROM and if present, ran it's code. If it wasn't present, it continued on with the main code. This could be modified to check for a pin state then load upper EEPROM code.

    Secondary EEPROM loading thread/code
    Thermistor Thread

    I couldn't find it, but I agree with you that there is another thread here somewhere that answers your exact question........
  • MagIO2MagIO2 Posts: 2,243
    edited 2014-06-23 05:33
    I think the most important questions are still not asked.

    How do you want to switch the programs? Manually via switch? Programmatically? Automatic or according to user input? Only one time at boot? Random? How fast do you want to switch to the other program? Do both programs make use of the same hardware (drivers)?
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-06-23 09:05
    I do have an SD card on the project.

    I also have an HMI consisting of a few buttons and an LCD. Ideally, I could use the HMI to switch between the applications (the switch does not have to be fast; one of the applications is parameters setup for the main app).
  • MagIO2MagIO2 Posts: 2,243
    edited 2014-06-23 13:19
    Is it OK to have one of the programs being the default which is the one started after boot?

    If so it's easy. One of the FSRW SD card drivers allowed to "restart" the propeller with an EEPROM-file stored on SD-card. I think Femto-Basic can do this as well.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2014-06-23 13:36
    If the board has the EEPROM chip in a DIP form factor you could use one of my small bank switch boards:

    http://www.robotworkshop.com/robotweb/?page_id=578

    Robert
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-06-23 21:10
    Since you have an SD Card, then if you use an OS, you can write a simple program that is run from AUTOEXEC.BAT (most of the OS'es use this) to decide which program to run. You could use a switch or whatever to determine this.

    Note that most OS'es take longer to boot. But of course you could change the actual boot code.
    Here is my PropOS http://forums.parallax.com/showthread.php/138251-A-Propeller-OS-that-can-run-on-multiple-hardware...?highlight=propeller
    Look at the end.

    Jon, if you require any help in getting PropOS running, just shout. The only thing you should remember, is that I often forget to change the default xtal back to 5MHz.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-06-24 10:18
    Thanks, Ray, I'm going to have a look. The boot-up time for this application is not a problem. Long term, in the context of what this does, the ability to select an app from the SD would be helpful. Sorry to be a little mysterious -- this is all R&D for a customer project. At the moment, everything is in a single app. It would be nice, though, to pull setup and operation apart.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-06-24 10:20
    If the board has the EEPROM chip in a DIP form factor you could use one of my small bank switch boards:

    Everything except connectors will be SMD.
  • Mike GreenMike Green Posts: 23,101
    edited 2014-06-24 10:48
    sdspifemto.spin from FemtoBasic is an I2C driver that can boot from EEPROMs and it includes low level SD card SPI routines for reading and writing sectors. It includes an SD card boot routine. For EEPROM booting, you supply an EEPROM address on a 32K boundary which includes the I/O pin pair number so you can use EEPROMs on any pair of I/O pins. For booting from an SD card, you supply the sector address of the first sector in a 32K sequential block. The comments in the file should make it clear how to use either boot routine. The code in FemtoBasic for the SPIN statement shows how to use either the EEPROM boot or SD card boot routines.
  • GenetixGenetix Posts: 1,754
    edited 2014-06-25 12:15
    Look at the Hydra which stores most of its program data on the EEPROM.
Sign In or Register to comment.