Hot!SPI not getting data from SST25 with just SPI configured.

Author
jtzeng
Super Member
  • Total Posts : 248
  • Reward points : 0
  • Joined: 2003/11/07 12:42:20
  • Status: offline
2017/12/05 23:47:26 (permalink)
0

SPI not getting data from SST25 with just SPI configured.

I am using an SST25FV016B with a PIC32MK1024GPE100 and Harmony 2.04.
I have the SPI working but am getting no data back from the SPI SST25.
SST25.pin2 -> RG9  as SDI6  or MISO
SST25.pin4 <- RB0  as SDO6  or MOSI
SST35.pin5 <- RA1  as SCK6   or SCK6
SST25.pin1 <- RC0 as EEPROM_CS
Clock is 1MHZ.
I have tried a Read(0x03) and GetID(0x90), both return no data on the MISO line.
Images are attached.
If I short the MOSI to MISO without the memory I can see it move.
 

Attached Image(s)


John Zigrang
JTZ Engineering, Inc.
#1

17 Replies Related Threads

    Jim Nickerson
    User 452 _
    • Total Posts : 4362
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/06 08:56:56 (permalink)
    0
    same http://www.microchip.com/forums/FindPost/1028496
    post edited by Jim Nickerson - 2017/12/06 08:59:01
    #2
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/06 09:05:28 (permalink)
    0
    I posted in two places as memory get very little traffic.

    John Zigrang
    JTZ Engineering, Inc.
    #3
    Jim Nickerson
    User 452 _
    • Total Posts : 4362
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/06 09:12:30 (permalink)
    5 (1)
    Many of us see the main forum page showing "Unread Posts"
    #4
    bosco
    Super Member
    • Total Posts : 2105
    • Reward points : 0
    • Joined: 2004/07/24 10:17:53
    • Location: Idaho
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/07 11:13:34 (permalink)
    0
    status of other pins HOLD, WP?
    the part will do SPI mode 0, or mode 3, depending upon the initial level of SCLK.  Your SCLK is low so it is going to think it is in mode 0.  if harmony did not set it up as mode 0, then you have a problem.
     
    I have used this family of parts without harmony, so I know harmony is the problem.
    post edited by bosco - 2017/12/07 11:15:12
    #5
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/07 11:49:46 (permalink)
    0
    The Hold and WP are tied to 3.3VDC.
    I would not be supersized at more Harmony issues as the SPI support for the MK is poor.
    Hope it is fixed in 2.05...
     
    At this point I am just trying to get any signal out of the memory.
    My next step is to skip Harmony and do my own driver.
     

    John Zigrang
    JTZ Engineering, Inc.
    #6
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/10 21:33:23 (permalink)
    0
    I switched to MODE3 for the SPI and set it up without Harmony Driver.
    I get data back on the MISO line, but it is not what I was expecting.
    I am issuing the Read ID command.
    I should get 0xBF, 0x41, but get 0xBC, 0x0B.
    This happen on two parts.
    See attachment

    Attached Image(s)


    John Zigrang
    JTZ Engineering, Inc.
    #7
    qɥb
    Monolothic Member
    • Total Posts : 171
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/10 22:09:59 (permalink)
    0
    That does not look like MODE3.
    Your MOSI signal is changing on the rising edge of SCK, precisely when the slave device is sampling the signal.
    i.e. it is changing half a clock cycle too early.
    What are the peripheral bit settings you are using?
     
     
    #8
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/10 22:53:05 (permalink)
    0
    CKE = 1
    CKP = 1
    SMP = 1
     
    I thought the CKE/CKP = 1 is mode 3.  Am I wrong on that?
    The memory only works with MODE 0 or MODE 3.
    It was not working in Mode 0 as the MK was not putting data out soon enough.
     
    It all seams to line up with the SST25VF016B datasheet.
     

    John Zigrang
    JTZ Engineering, Inc.
    #9
    qɥb
    Monolothic Member
    • Total Posts : 171
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/10 23:05:15 (permalink)
    0
    CKE should be low for MODE 3 (and CKP high)
     
    Look at https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Mode_numbers
    but make sure you look at the CKP and CKE columns, NOT CPOL & CPHA.
     
     
     
     
    post edited by qɥb - 2017/12/10 23:06:46
    #10
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/11 07:13:26 (permalink)
    0
    Thanks for pointing my error on Mode values.
    Even with the correct setting of CKP=1, CKE=0 and SMP = 0 I still get the wrong ID.
    I get a MFG = 0xBC and ID = 0x0B.
    It should be 0xBF and ID = 0x41.
     
    This is for a SST25VF016B with date codes in 2016.
    The ID is required to get the SST25 drive to work in Harmony 2.04
     

    Attached Image(s)


    John Zigrang
    JTZ Engineering, Inc.
    #11
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/11 22:09:43 (permalink)
    0
    I have been working with the SST25VF016B
    Now I have tried the SST25VF080B with a MFG = 0xBF and ID = 8E.
    I send out the Read ID = 0x90, 0x00, 0x00, 0x00
    The return should be MFG, ID
     
    With CKP = 1 and SMP = 0 I get 0x73, 0x33
    With CKP = 1 and SMP = 1 I get 0x00, 0x73..... shifted.
    My PCLK = 120MHZ and Baudrate = 59 which should put me close to 1MHZ.
     
    It is clear with both parts I am not getting any from of a BF output.
    Not sure why.
     

    John Zigrang
    JTZ Engineering, Inc.
    #12
    qɥb
    Monolothic Member
    • Total Posts : 171
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/11 22:14:16 (permalink)
    0
    Is CKE still 0?
    #13
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/11 22:26:44 (permalink)
    0
    Yes, CKE = 0.
    The main concern I have at this point is if the 0x90 is being accepted then why cant I see a pattern that is 0xBF.
     
    I should see a 10111111 but don't for either byte that comes out.
    And the 0x8E should be 10001100.
    It is clean that both patterns are not being seen on the output of the SST25.
     
     

    John Zigrang
    JTZ Engineering, Inc.
    #14
    qɥb
    Monolothic Member
    • Total Posts : 171
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/11 22:43:41 (permalink)
    0
    That would imply that the 0x90 is not getting clocked in correctly.
     
    #15
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/12 07:24:34 (permalink)
    0
    I have put together the timing from the capture and compared it to the datasheet.
    Image attached.
    There is also an image that shows what happens when you try and get the MFG/ID 3 times.
    The data coming out is the same (0xBC) but shifted by a number of clocks.
    This is getting more strange....
     

    Attached Image(s)


    John Zigrang
    JTZ Engineering, Inc.
    #16
    DavidBLit
    Super Member
    • Total Posts : 1454
    • Reward points : 0
    • Joined: 2012/02/18 13:08:48
    • Location: The Land of Confusion
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/12 07:51:31 (permalink)
    0
    Two thoughts:
    1. Do you know for certain that SCK is clean (no ringing/reflections/knees)?
    2. Can you adjust the sample rate of your logic analyzer to get a better-looking trace?  Even with those tiny pictures it looks like your analyzer is trimming some of the clocks, possibly resulting in a bad decode.

    Yeah, "//Code and stuff".
    #17
    jtzeng
    Super Member
    • Total Posts : 248
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: SPI not getting data from SST25 with just SPI configured. 2017/12/12 09:13:34 (permalink)
    0
    That was a good request.
    I am working remote right now, so can only use the logic analyzer.
    I have changed the sample to 500MHZ and measured the bit time.
    When I get back I will do the same with a scope on the clock and incoming data.

    Attached Image(s)


    John Zigrang
    JTZ Engineering, Inc.
    #18
    Jump to:
    © 2017 APG vNext Commercial Version 4.5