Shop OBEX P1 Docs P2 Docs Learn Events
Winbond W25X80 SPI flash object posted with easy to understand commented SPI co — Parallax Forums

Winbond W25X80 SPI flash object posted with easy to understand commented SPI co

Bill HenningBill Henning Posts: 6,445
edited 2009-03-26 16:24 in Propeller 1
Hi guys,

I've cleaned up my Spin driver for the flash chip I've been using for extended data storage and posted a brief article on my blog on how to use it - and you can download it there too.

I am working on a PASM version, however this version is already quite useful not only for storage, but as an easy to understand example of SPI code.

mikronauts.com/2009/03/24/winbond-w25x80-flash-chip-spin-object/

I know the code is not very optimized, it was written for small code size and clarity.

Enjoy!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com - a new blog about microcontrollers

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-03-25 03:06
    Excellent Bill - Just what I need for my TriBladeProp pcb. I haven't looked at your code yet. I presume you didn't use the double bit read feature?
    There are also pin compatible (but more $) versions W25X32 (4MByte) and W25X64 (8MByte) versions available also.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-03-25 14:58
    I'm glad it will help smile.gif

    No double bit read yet, I was going to explore that later - initially I just wanted some easy to read (and therefore easy to understand and debug) spin code that did not require dedicating a cog. I am working on a pasm version, and once the single bit read version is finished, I will add double bit read.

    The 2Mx8 is also available in DIP, but I have not found anyone who has the 4Mx8 and 8Mx8 in DIP :-(

    I have some SOIC-16 8Mx8's on the way that appear to be fully compatible smile.gif
    Cluso99 said...
    Excellent Bill - Just what I need for my TriBladeProp pcb. I haven't looked at your code yet. I presume you didn't use the double bit read feature?
    There are also pin compatible (but more $) versions W25X32 (4MByte) and W25X64 (8MByte) versions available also.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • virtuPICvirtuPIC Posts: 193
    edited 2009-03-25 20:08
    Yeah, this is the kind of software we need - the kind which everyone needs! Thank you!

    Oh, and I received a W25X16 today. 2M x 8 bit. Will look at the data sheets and test it with your driver. And yes, it's in DIP package. (Digi-Key)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys

    Post Edited (virtuPIC) : 3/25/2009 8:18:38 PM GMT
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-03-25 20:19
    You are most welcome, and it should just work - the only difference is the capacity of the devices, they use exactly the same protocol.

    Unfortunately the 2Mx8 is the largest capacity DIP that is readily available, but I have some larger SOIC-16's on the way (8Mx8) which should also work.
    virtuPIC said...
    Yeah, this is the kind of software we need - the kind which everyone needs! Thank you!

    Oh, and I received a W25X16 today. 2M x 8 bit. Will look at the data sheets and test it with your driver. And yes, it's in DIP package. (Digi-Key)
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • virtuPICvirtuPIC Posts: 193
    edited 2009-03-25 21:11
    I am still wondering if such an SPI ROM can be used for standard bootloading. Commands are rather different, but maybe the prop is clever enough. Any experience out there?

    Yes, I know That SPI normally needs one more line than I2C, but I remember that you can merge data lines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-03-25 21:38
    Unfortunately not, as the protocols are too different. A fast enough microcontroller could be used to "translate" by placing it between the SPI flash and the propeller, so that it presents an I2C eeprom interface to the propeller, while reading the data from the flash.

    Personally I will keep an eeprom for loading an initial boot image that can select roms to load from the flash.
    virtuPIC said...
    I am still wondering if such an SPI ROM can be used for standard bootloading. Commands are rather different, but maybe the prop is clever enough. Any experience out there?

    Yes, I know That SPI normally needs one more line than I2C, but I remember that you can merge data lines.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • virtuPICvirtuPIC Posts: 193
    edited 2009-03-25 22:04
    Yes Bill, I also had this idea. The fast coprocessor could even have a small cache and parallel to SPI interface for faster access... But it's more complicated and more expensive than a separate boot-Flash. It's easy to write protect this boot Flash and I am still thinking of a time switch that switches access from small boot ROM to large application Flash a short time after booting to safe pins. No, not suited for development where you want to write the boot image...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-03-26 03:39
    Bill, Great work. I created my test program to test the SRAM initially in spin, then rewrote in pasm. While I am much more comfortable with pasm, spin makes it easy to get running first and provides an insight for others to understand what is going on at a simpler level.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-03-26 16:24
    Thank you. That was the idea - to have an easy to understand version that only takes 136 longs (or 123 without jdec_id and get_size) and does not require a dedicated cog!
    Cluso99 said...
    Bill, Great work. I created my test program to test the SRAM initially in spin, then rewrote in pasm. While I am much more comfortable with pasm, spin makes it easy to get running first and provides an insight for others to understand what is going on at a simpler level.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
Sign In or Register to comment.