spansion 32Mbit quad mode... errors / close but no cigar

As at today still can’t get quad mode working as per advertised after like 3+ days… sent spansion an email.

Now got the time for 64K for serial to 88ms and quad to 34ms.

What I do not like is the 1st 10+ bytes are correct (ie 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, …) and then they either lose sync or become garbage. I’ve gone over the datasheets too many times for this command (0xEB) so must be something other than the code that they have failed to mention or is hidden among other stuff.

Serial fast mode that also requires dummy cycles works fine and correctly reads all the values 0…255 so I know the data it’s reading is correct.

I might look at some different chips as some have much clearer datasheets.

Also, to eliminate chip problems I have 2 identical chips to verify functionality and they both have the same problem.

The 88ms and 34ms is down from 250ms and 110ms before I optimized :o , which is no good if I can’t get the desired results.

This is the output of the page I’m reading via quad mode on a Due @84Mhz with latency = 15 using http://www.farnell.com/datasheets/1756776.pdf. The cell is “blank” if the read value is equal to the expected value. From below you can see it started ok… then lost the plot and loses sync as it seems to skip a nybble/4 bits occasionally.

READ (256->BUFFER) - QUAD SERIAL MODE
Address     0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F ASCII
---------  -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----------------
00000d:00                                               00 ................
00000d:10  11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 11 f2 ...e.ò
00000d:20  12 22 32 42 52 62 72 82 92 a2 b2 c2 d2 e2 f3 03 ."2BRbr‚’¢²ÂÒâó.
00000d:30  13 23 33 43 53 63 73 83 93 a3 b3 c3 d3 e3 f4 04 .#3CScsƒ“£³ÃÓãô.
00000d:40  14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f5 05 $4DTdt„”¤´ÄÔäõ.
00000d:50  15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f6 06 %5EUeu…•¥µÅÕåö.
00000d:60  16 26 36 46 56 66 76 86 96 a6 b6 c6 d6 e6 f7 07 &6FVfv†–¦¶ÆÖæ÷.
00000d:70  17 27 37 47 57 67 77 87 97 a7 b7 c7 d7 e7 f8 08 '7GWgw‡—§·Ç×çø.
00000d:80  18 28 38 48 58 68 78 88 98 a8 b8 c8 d8 e8 f9 09 (8HXhxˆ˜¨¸ÈØèù.
00000d:90  19 29 39 49 59 69 79 89 99 a9 b9 c9 d9 e9 fa 0a )9IYiy‰™©¹ÉÙéú.
00000d:a0  1a 2a 3a 4a 5a 6a 7a 8a 9a aa ba ca da ea fb 0b *:JZjzŠšªºÊÚêû.
00000d:b0  1b 2b 3b 4b 5b 6b 7b 8b 9b ab bb cb db eb fc 0c e+;K[k{‹›«»ËÛëü.
00000d:c0  1c 2c 3c 4c 5c 6c 7c 8c 9c ac bc cc dc ec fd 0d ,<L\l|Œœ¬¼ÌÜìý.
00000d:d0  1d 2d 3d 4d 5d 6d 7d 8d 9d ad bd cd dd ed fe 0e -=M]m}­½ÍÝíþ.
00000d:e0  1e 2e 3e 4e 5e 6e 7e 8e 9e ae be ce de ee ff 01 .>N^n~Žž®¾ÎÞîÿ.
00000d:f0  f2 ff 4f 5f 6f 7f 8f 9f af bf cf df ef ff ff    òÿO_oŸ¯¿Ïßïÿÿÿ

Snippet of code below for the routine that attempts to read a buffer full of bytes using quad mode (command = 0xeb)

void cSPIFLASHNOR::readByteQuad_IO(uint32_t addr, uint8_t *buffer, uint32_t len)
{
 _chipEnable();

 _pins_quad_read(); // io1-io3 high impedance (input mode)
 _pins_io0_output();
 
 _send_8_io0(0xeb); // 9.3.6 Fast Read Quad I/O (EBh)
 
 _pins_quad_write(); // need to send commands now on quad bus io0 - io3

 if (m_32bit_address)
 {
 _send_8_quad(addr >> 24);
 }
 
 _send_8_quad(addr >> 16);
 _send_8_quad(addr >> 8);
 _send_8_quad(addr);
 
 _send_8_quad(B00000000); // mode only m[5-4] mean anything

 _pins_quad_read(); // io1-io3 high impedance (input mode)
 
 _dummy_x(m_latency); // depends on latency control... 1 cycle per m_latency 
 
 for (int i = len; i--; )
 {
 _chipClick();
 _chipClickLatch();
 *buffer = _fl_read_quad_high;
 
 _chipClick();
 _chipClickLatch();
 *buffer |= _fl_read_quad_low;
 
 buffer++;
 }
 
 _chipDisable();

 _pins_io0_output(); // restore
}