NOR Flash MX29LV800 + LPC1788 writing problems

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by FlySnake on Tue Sep 03 03:36:53 MST 2013
Hi everyone!

I'm trying to access NOR Flash MX29LV800. As a starting point I've got SST39VF320 example from lpcopen.
Base address 0x80000000 (CS0 is used). Address shifting in SCS disabled (1). A0 flash -> A1 MCU and so on with 1 bit shift.

config.CSn = 0;
config.AddressMirror = 0;
config.ByteLane = 1;
config.DataWidth = 16;
config.ExtendedWait = 1;//0;
config.PageMode = 0;
config.WaitWEn = 2;
config.WaitOEn = 2;
config.WaitWr = 0x1f;
config.WaitPage = 0x1f;
config.WaitRd = 0x1f;
config.WaitTurn = 0x1f;

Trying to read ID:

ip  = GET_ADDR(0x0555);
*ip = 0x00AA;
ip  = GET_ADDR(0x02AA);
*ip = 0x0055;
ip  = GET_ADDR(0x0555);
*ip = 0x0090;

ip  = GET_ADDR(0x0000);
id1 = *ip;
ip  = GET_ADDR(0x0001);
id2 = *ip;

Yields to 0xD3A1 and 0xC280. It seems like these words are located in 0 and 1 address because if I just read these addresses:
for(unsigned long i = 0; i < 10u; i++)
    ip  = GET_ADDR(i);
    xprintf("== 0x%X\n", *ip);

I get 0xd3A1, 0xC280 and so on.

It ignores write commands completely.

I tried to switch to CS1. Nothing changed.
With oscilloscope I see impulses on OE, WE and CE pins and they seems to be OK. RY/BY is always high.

Also I don't understand this:

Quote: "MX29LV800's datasheet"
The MX29LV800C T/B also features the chip unprotected
mode, so that all sectors are unprotected after chip un-
protected is completed to incorporate any changes in the
code. It is recommended to protect all sectors before
activating chip unprotected mode.
To activate this mode, the programming equipment must
force VID on control pin OE# and address pin A9. The
CE# pins must be set at VIL. Pins A6 must be set to
VIH. Refer to chip unprotected algorithm and waveform
for the chip unprotected algorithm. The unprotection
mechanism begins on the falling edge of the WE# pulse
and is terminated on the rising edge.
It is also possible to determine if the chip is unprotected
in the system by writing the Read Silicon ID command.
Performing a read operation with A1=VIH, it will produce
00H at data outputs (Q0-Q7) for an unprotected sector.
It is noted that all sectors are unprotected after the chip
unprotected algorithm is completed.

So if this chip is unprotected what should I get on Q0-Q7? And if protected?

This chip is not new, I've got it from old notebook, so it might be protected, but I can't understand how this protection works.
Also, why in lpcopen example commands are 0x5555, 0x2AAA where they must be 0x555, 0x2AA ? I tried both, nothing changed.