• AVR Freaks

SST26VF032 write issue

Page: 12 > Showing page 1 of 2
Author
BumpSplat
Senior Member
  • Total Posts : 163
  • Reward points : 0
  • Joined: 2017/11/06 13:23:11
  • Location: Bend, OR
  • Status: offline
2018/05/08 19:30:41 (permalink)
0

SST26VF032 write issue

I'm having some trouble I was hoping someone might be able to help.  I can't seem to program and read back a byte.  i know my connection is correct as I am able to read the JEDEC-ID (last section).  I'm resetting, erasing, and writing in a way that looks like it matches the datasheet.  Any help would be greatly appreciated.
 
///////////////////////////////////////////// reset
CS_FLASH_SetLow();
__delay_us(1); // CE# Active Setup Time
temp = SPI2_Exchange8bit(RESET_ENABLE); //0x66
CS_FLASH_SetHigh();
__delay_us(1); // - high time - Tchp - 25nS
CS_FLASH_SetLow();
__delay_us(1); // CE# Active Setup Time
temp = SPI2_Exchange8bit(RESET_MEMORY); //0x99
CS_FLASH_SetHigh();
///////////////////////////////////////////// bulk erase
CS_FLASH_SetLow();
__delay_us(1); // CE# Active Setup Time Tces 12nS
temp = SPI2_Exchange8bit(WRITE_ENABLE); //0x06
temp = SPI2_Exchange8bit(ERASE_ARRAY); //0xC7
__delay_ms(50); // Tsce 50mS
CS_FLASH_SetHigh();
///////////////////////////////////////////// program
// The Write Block Locking Register command is a two cycle command requiring
// Write-Enable (WREN) to be executed prior to the Write Block-Protection Register command.
CS_FLASH_SetHigh();
///////////////////////////////////////////// Program
CS_FLASH_SetLow();
temp = SPI2_Exchange8bit(WRITE_ENABLE); // 0x06
temp = SPI2_Exchange8bit(PAGE_PROGRAM); // 0x02
temp = SPI2_Exchange8bit(0x00);                 // 
temp = SPI2_Exchange8bit(0x00);                 // 000000H - 001FFFH
temp = SPI2_Exchange8bit(0x00);
temp = SPI2_Exchange8bit(0x00); // data write
temp = SPI2_Exchange8bit(0x00); // data write
temp = SPI2_Exchange8bit(0x00); // data write
temp = SPI2_Exchange8bit(0x00); // data write
CS_FLASH_SetHigh();
__delay_ms(50);
///////////////////////////////////////////// Read
CS_FLASH_SetLow();
temp = SPI2_Exchange8bit(READ_MEMORY); //0x03
temp = SPI2_Exchange8bit(0x00); // 
temp = SPI2_Exchange8bit(0x00); //
temp = SPI2_Exchange8bit(0x00); //
////////
temp = SPI2_Exchange8bit(0x00);
temp = SPI2_Exchange8bit(0x00); // data read
temp = SPI2_Exchange8bit(0x00); // data read
temp = SPI2_Exchange8bit(0x00); // data read
CS_FLASH_SetHigh(); //100us
///////////////////////////////////////////// JEDEC-ID Read
CS_FLASH_SetLow();
temp = SPI2_Exchange8bit(0x9f);
temp = SPI2_Exchange8bit(NOP);
temp = SPI2_Exchange8bit(NOP);
temp = SPI2_Exchange8bit(NOP);
CS_FLASH_SetHigh();
 
Thanks,
 
T
post edited by BumpSplat - 2018/05/08 19:31:45
#1

21 Replies Related Threads

    RISC
    Super Member
    • Total Posts : 5379
    • Reward points : 0
    • Status: offline
    Re: SST26VF032 write issue 2018/05/09 00:10:28 (permalink)
    0
    Hi,
    Have you checked the SST26VF032 driver which is provided under the documents tab > Device documentation :
    http://www.microchip.com/wwwproducts/en/SST26VF032
     
    There are also SPI memory driver examples in Harmony :
    c:\microchip\harmony\v2_05_01\apps\driver\spi\ 
    #2
    RISC
    Super Member
    • Total Posts : 5379
    • Reward points : 0
    • Status: offline
    Re: SST26VF032 write issue 2018/05/09 00:10:28 (permalink)
    0
    dual post
    #3
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/09 06:42:37 (permalink)
    0
    I sure did.  That's were I got the flow and instructions.  Duel post?  Did I miss someone else asking the same question?
    #4
    mbrowning
    USNA79
    • Total Posts : 1556
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: offline
    Re: SST26VF032 write issue 2018/05/09 06:58:12 (permalink)
    5 (2)
    It was an accidental duplicate posting by RISC, not an invitation to a sword fight :)

    Go Navy! Beat Army!
    #5
    Jim Nickerson
    User 452
    • Total Posts : 6333
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: SST26VF032 write issue 2018/05/09 07:08:57 (permalink)
    0
    I wonder what happens when you try the command
    CMD_WBPR        =       0x42, /**< Write Block-Protection Register */

    And fetch the contents ?
    #6
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/09 13:07:44 (permalink)
    0
    I've written to the write control registers (WREN/WRDI) and read back the status register contents seeing a change in the WEL bit.  I've also now written to the entire array of block protection registers 0x00 and 0xff followed by a program read operation with no change.  I don't see a way to read the block protection status contents.  This is a great example of why I write my routines to send something back to say what happened.  It's like flying in the fog over here. :)
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6333
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: SST26VF032 write issue 2018/05/10 06:00:51 (permalink)
    0
    In the pdf for this chip I see this section which details how the data in the register is obtained, at the bottom of table 5-6 the default power on values for this register are detailed

    Attached Image(s)

    #8
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/10 14:08:19 (permalink)
    0
    What document number is that?  I have the datasheet but the section looks slightly different.  http://ww1.microchip.com/downloads/en/DeviceDoc/25017A.pdf
     
    #9
    qɥb
    Monolothic Member
    • Total Posts : 3332
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: SST26VF032 write issue 2018/05/10 15:32:00 (permalink)
    0
    That appears to be from the datasheet for the SST26VF032B part.
    http://ww1.microchip.com/downloads/en/DeviceDoc/SST26VF032B-SST26VF032BA-3.0V-Serial-Quad-IO-(SQI)-Flash-Memory-DS20005218F.pdf
     
    The version without the "B" suffix is not recommended for new designs.
    Are you actually using the older part?
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #10
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/13 19:10:26 (permalink)
    0
    No, I'm not.  I was sent the link by a co-worker and ran with it.  The datasheet you sent was much more comprehensive, I'm digesting now.  I'm going to bet I'll find the issue by simply reading through it.  thanks.
    #11
    NorthGuy
    Super Member
    • Total Posts : 5761
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: SST26VF032 write issue 2018/05/13 21:25:49 (permalink)
    0
    If I remember correctly, CS must be driven high for some period (50 ns or so) after the write enable (0x06) command.
    #12
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/23 12:37:12 (permalink)
    0
    Solid input.  i injected a time delay and things started working consistently.  
     
    Here's my next noodler, I can write and readback only 127 words at a time.  This is an edit.  Ignore the double write/read I attached.  I can see something happening I need to investigate.  The 127 words boundary is real and reproducible... 
     
    I'd show a pic. of the failure but it simply starts reading back 1's past the 128th word (16b).  I attempted to write to another address ( 0x00030000) and wasn't able to readback anything.  It did send back a one during the second read operation.
    At one step past a word in length, the data stops being read back (0xffff).  Weather this is due to a write or read issue, I have no visibility.  I've lined up on the page boundary, see code.  Has anyone ever seen this before? 
     
     
    ///////////////
    write_address  = 0x00010000;
     
    flash_address.full = write_address;
    test1 = flash_address.byte[0];
    test2 = flash_address.byte[1];
    test3 = flash_address.byte[2];
    test4 = flash_address.byte[3];
    CS_FLASH_SetLow();
    //////////////////////////////////////////////////////////
    // Address setup for verification
    command_word_upper_address = cmd<<8 | flash_address.byte[2];
    combine_lower_address = flash_address.byte[1]<<8 | flash_address.byte[0];
    rx_array[0] = SPI2_Exchange16bit(command_word_upper_address); // 0x02 16b 8 command 8 address
    rx_array[1] = SPI2_Exchange16bit(combine_lower_address);

    if (cmd == 0x02) // write stuff
    for (byte_counter=2; byte_counter < number_of_bytes; byte_counter++)
    rx_array[byte_counter] = SPI2_Exchange16bit(tx_array[byte_counter]);
    else // read stuff
    for (byte_counter=2; byte_counter < number_of_bytes; byte_counter++)
    rx_array[byte_counter] = SPI2_Exchange16bit(NOP);

    CS_FLASH_SetHigh();
    if (cmd == 0x02) // write stuff
    __delay_ms(2);
     
     
    post edited by BumpSplat - 2018/05/23 17:55:31

    Attached Image(s)

    #13
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/23 12:42:37 (permalink)
    0
    Disregard, I believe I've fixed it. 
    post edited by BumpSplat - 2018/05/23 14:06:01
    #14
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/23 18:25:08 (permalink)
    0
    I'm now able to write and program a full page but that's it.  The fact that I'm able to write at all tells me I've successfully configured the memory.  When I attempt to write another page, it only programs another 127Bytes.  Very strange.  here's my procedure, any hel would be greatly appreciated.
     
    RESET_ENABLE
    RESET_MEMORY
     
    WRITE_ENABLE
    ERASE_ARRAY
     
    WRITE_ENABLE
    GLOBAL_PROT_UNLOCK
     
    Is it fair to say that a page write success means all of the above command were successful?
     
    Reading the Block protection register:
    55FFH
    FFFFH
    FFFFH
    FF00H
     
    Status Register
    01H
     
    Configuration Register
    00H
     
    Writing/reading address 0x00010000H
     
    I've captures all these on a logic analyzer.  The address and offset don't come anywhere close to a page boundary.  I've a logic shot of writing to address 0x01FF00 for Reference.  This address doesn't work att all.  The formatting looks correct(?).
    post edited by BumpSplat - 2018/05/23 18:26:26

    Attached Image(s)

    #15
    BumpSplat
    Senior Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/11/06 13:23:11
    • Location: Bend, OR
    • Status: offline
    Re: SST26VF032 write issue 2018/05/30 12:48:36 (permalink)
    0
    Has anyone seen this?  I'm seeing 8 and 10b clocking on a 16b configured SPI port?  I'm using MCC drivers.
     

    post edited by BumpSplat - 2018/05/30 12:50:28

    Attached Image(s)

    #16
    henrylaredo
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2014/09/17 06:31:58
    • Location: 0
    • Status: offline
    Re: SST26VF032 write issue 2018/06/25 16:44:10 (permalink)
    0
    the issue could have a lot of causes, you must upload current implementation of the device like an schematic and photo of the board, maybe you are too far from the device. Also mention what library are you using and the SPI configuration for that compilation.
    #17
    yessine
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2018/10/03 09:24:10
    • Location: 0
    • Status: offline
    Re: SST26VF032 write issue 2018/10/04 09:03:26 (permalink)
    0
    I used the SST25PF040C to write some data in this flash memory , 
    I try to write on the status register to disable the protection for the memory , I try to write 0x00, 
    but the problem was when I want to read the value of the status , the result equal = 0x12 !!
    have someone any idea for this problem because i can't do any page program to this memory !
    #18
    yessine
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2018/10/03 09:24:10
    • Location: 0
    • Status: offline
    Re: SST26VF032 write issue 2018/10/04 09:04:41 (permalink)
    0
      I can't seem to program and read back a byte. my connection is correct as I am able to read the JEDEC-ID and the ID .   Any help would be greatly appreciated.
    I used the SST25PF040C to write some data in this flash memory , 
    I try to write on the status register to disable the protection for the memory , I try to write 0x00, 
    but the problem was when I want to read the value of the status , the result equal = 0x12 !!
    have someone any idea for this problem because i can't do any page program to this memory !
    #19
    yessine
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2018/10/03 09:24:10
    • Location: 0
    • Status: offline
    Re: SST26VF032 write issue 2018/10/04 09:07:39 (permalink)
    0
      I can't seem to program and read back a byte. my connection is correct as I am able to read the JEDEC-ID and the ID .   Any help would be greatly appreciated.
    I used the SST25PF040C to write some data in this flash memory , 
    I try to write on the status register to disable the protection for the memory , I try to write 0x00, 
    but the problem was when I want to read the value of the status , the result equal = 0x12 !!
    have someone any idea for this problem because i can't do any page program to this memory !
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5