Shop OBEX P1 Docs P2 Docs Learn Events
AT45DB161D ,,,,,,SOS. interface to prop — Parallax Forums

AT45DB161D ,,,,,,SOS. interface to prop

mikedivmikediv Posts: 825
edited 2010-04-03 02:08 in Propeller 1
Hi guys I hate to be a pain but I have been working on trying to get my prop to read and write to this chip can anyone help me I tired using the DS1620 interface as a sort of guide I even found a driver in Obex but no matter what I try I can not get anything out of it, What I could really use is just a simple program that would tell me if I have it interfaced correctly I am attaching the data sheet and the driver I tried I actually have a few SPI flash rams of different brands so I would really appreciate and knowledge that will help me understand how to read and write to this type of device
even a quick interface circuit would be a huge help
Thanks

Comments

  • pgbpsupgbpsu Posts: 460
    edited 2010-04-02 01:02
    mikedev-

    Attached is a program I wrote to interface with the Atmel DF chips.

    Although I still use the DF chips, I haven't used this program in a while. It was the simplest, most stand alone things I could find easily. There are lots of comments (hopefully some of them correct). The programing style isn't great (it was one of my early spin/asm programs; hopefully I've gotten a bit better since then). There a number of spin methods at the top that cause PASM routines to be run. I suggest you start with RESET_CHIP and READ_STATUS_REGISTER.

    There are constants at the front which control which lines to use. There is also a constant called MY_CHIP. I had 5 of these on one board so that constant allowed me to run this program on one particular chip.

    I'm sure you'll have questions about it. I certainly do. So post back here and I'll try to help.

    Regards,
    Peter

    FYI- DON'T USE THE CHIP ERASE FUNCTION. At least in the version I purchased it doesn't work. There's one line in the errata that says it may not work correctly. Well it doesn't work at ALL.

    I found a spin only version that might be easier to understand (but slower). Both programs use FullDuplexSerial and Numbers.
  • jazzedjazzed Posts: 11,803
    edited 2010-04-02 03:06
    @mikediv, what happens if you try my example? How is your device connected?
  • mikedivmikediv Posts: 825
    edited 2010-04-03 00:31
    pgbpsu thank you very much.. Jazzed I didn't want to pester you about it you were awesome enough to share your hard work with everyone. Anyway I am very lacking in PASM I can not figure out how to interpret what pins are used so I used
    P0-P1-P2
    I connected to the Sram like this see attached I did use a 10K pullup and I also tried running your example and tracing prop pins with my scope but no cigar as they say
  • pgbpsupgbpsu Posts: 460
    edited 2010-04-03 01:19
    mikdev-

    Have you tried the spin code (DataFlashCommands.spin). I think it's all in spin so it should be easier to follow. Let me know if you have questions about it.

    p
  • jazzedjazzed Posts: 11,803
    edited 2010-04-03 02:08
    mikediv said...
    Jazzed I didn't want to pester you about it you were awesome enough to share your hard work with everyone. Anyway I am very lacking in PASM I can not figure out how to interpret what pins are used so I used P0-P1-P2
    You can pester me [noparse]:)[/noparse]

    The example has:

    PUB main ' ...

    start(8,9,0,0) ' this says use P8 for clock, P9 for chip select, and P0 for data in and data out

    PUB start(pck, pcs, pdi, pdo) ' the method is defined like this

    Your pin settings description is not clear.
    If you have P0 for clock, P1 for chip-select, and P2 for data in and data out, use this:

    start(0,1,2,2)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    May the road rise to meet you; may the sun shine on your back.
    May you create something useful, even if it's just a hack.
Sign In or Register to comment.