Shop OBEX P1 Docs P2 Docs Learn Events
Small EEPROMs — Parallax Forums

Small EEPROMs

jac_goudsmitjac_goudsmit Posts: 418
edited 2017-10-16 15:25 in Propeller 1
Hi everyone,

What happens if you connect a Propeller to a small EEPROM? Can it boot (in theory) from e.g. a 24LC02 (256 bytes)?

And can the Propeller tool be used to download a program to a small EEPROM? If not, can the loader that comes with SimpleIDE do it?

Background: I finally got a DE0-Nano FPGA board and I tried a quick experiment, connecting the tiny EEPROM of the DE2-Nano to pins 28 and 29 of the virtual Propeller. I sort of expected it to give an error on the download because Propeller Tool probably always downloads 32K regardless of the program size, but I was hoping I could still boot a small program like the Cog LED test which is 96 bytes. But I couldn't get it to work right away so I was wondering if I did something wrong in my Verilog or if it's just not possible to do this with Propeller Tool.

Thanks!

===Jac

Comments

  • BeanBean Posts: 8,129
    It depends on the EEPROM. Most of them just wrap-around so you end up with the contents repeated over and over into the propeller memory.

    Bean
  • Mike GreenMike Green Posts: 23,101
    edited 2017-10-16 17:37
    The EEPROMs that the Propeller can boot from all use a 16 bit address (2 bytes). Smaller EEPROMS like the 24LC02 use an 8 bit address (1 byte) which won't work with the boot software in ROM. A Propeller can use something like a 24LC02 for storing a little bit of data using appropriate software
  • I guess you could modify the boot code so it did work with a lc02.

    Is this because thats what on the nano?

  • Cluso99Cluso99 Posts: 18,069
    I have used a 24C64 before but I had to use special code to program the eeprom. I had to fudge the checksum in $0005 so that it would load. The code loaded into hub 4 times due to wraparound. The 24C64 has the same addressing (and the 24C32 IIRC) so they will work with the checksum fiddling. There is a thread here somewhere that I posted after I did this experiment.

    However, as Mike said, the addressing is different with the 24LC02 so it probably will not work. I have changed the P1V Boot ROM and Interpreter so this is possible. You may need to change the booter and runner code to support the 24LC02.
  • Mike Green wrote: »
    The EEPROMs that the Propeller can boot from all use a 16 bit address (2 bytes). Smaller EEPROMS like the 24LC02 use an 8 bit address (1 byte) which won't work with the boot software in ROM. A Propeller can use something like a 24LC02 for storing a little bit of data using appropriate software

    Aha, thanks!
    Tubular wrote: »
    I guess you could modify the boot code so it did work with a lc02.

    Yep. Alternative boot loaders are definitely high on the agenda for all targets of the P1V project.
    Tubular wrote: »
    Is this because thats what on the nano?

    Yes. The DE0-Nano has a 24LC02. Of course it can be replaced but it's not easy because they used a tiny package.

    I replaced the EEPROM on my BeMicroCV with a regular soldering iron and a steady hand. I think they used a similar type of EEPROM package on the BeMicroCV-A9 as well. But still, not everyone wants to do that.
    Cluso99 wrote: »
    I have used a 24C64 before but I had to use special code to program the eeprom. I had to fudge the checksum in $0005 so that it would load.

    I forgot there's a checksum (I looked at the booter code but it's been a while -- I know I'm just being lazy, I could have looked this all up in datasheets and by googling in the forums). Yeah that would make things even more difficult.
    Cluso99 wrote: »
    However, as Mike said, the addressing is different with the 24LC02 so it probably will not work. I have changed the P1V Boot ROM and Interpreter so this is possible. You may need to change the booter and runner code to support the 24LC02.

    I understand now that a change to the booter would be necessary. I'm thinking the most portable way is probably to let the HDL intiialize the hub ram (somehow, depending on the hardware), and then let the booter pretend that the hub was just loaded from EEPROM.

    But why would the runner need to be changed? I thought once it's started the SPIN interpreter, the EEPROM isn't used anymore?

    ===Jac

  • jmgjmg Posts: 15,173
    Yes. The DE0-Nano has a 24LC02. Of course it can be replaced but it's not easy because they used a tiny package.

    What package did they use ? You can likely get a larger-memory part in the same package.
    A hot air system should remove the old one ok ?


    One issue with HDL init, is that occurs on FPGA init at power up, but a P1 running on FPGA has a separate reset, and expects valid boot code on that reset release.
    Seems better to use the normal EEPROM memory ?
  • jmg wrote: »
    What package did they use ? You can likely get a larger-memory part in the same package.
    A hot air system should remove the old one ok ?

    It looks like it was a DFN package.

    I don't have a hot air system and I expect that the majority of the P1V audience also wouldn't want to bother; it's a software project after all. It's much easier to just connect an external I2C EEPROM to the pins and get the problem out of the way. And that's reversible :-)
    One issue with HDL init, is that occurs on FPGA init at power up, but a P1 running on FPGA has a separate reset, and expects valid boot code on that reset release.
    Seems better to use the normal EEPROM memory ?

    Yes, I thought about that, but there are easy ways around that. After all, with HDL we're in full control of how the Propeller sees the world. We could easily add something that's "wired" to detect that the Propeller is booting by checking for the current execution address, and run a sequencer that copies some external data source to hub RAM.

    Another option is of course to emulate the EEPROM to read and write some other data source such as an SD card or a Flash ROM. And I bet this isn't the first project that needs something like that, so there may already be open source Verilog code out there to do it.

    ===Jac
  • jmgjmg Posts: 15,173
    edited 2017-10-17 01:32
    It looks like it was a DFN package.
    ugh.. bummer...
    I don't have a hot air system and I expect that the majority of the P1V audience also wouldn't want to bother; it's a software project after all. It's much easier to just connect an external I2C EEPROM to the pins and get the problem out of the way. And that's reversible :-)
    Sounds simplest....
    Another option is of course to emulate the EEPROM to read and write some other data source such as an SD card or a Flash ROM.

    EEPROM is more expensive, so more long term useful is probably a SPI loader, and I think someone may already have done that ?
    FT25H04S SPI FLASH parts are now showing stocked at Digikey
Sign In or Register to comment.