This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLPDLCR2000EVM: Difficulty reading spi flash data using the described procedure in DLP2607 software developer guide

Part Number: DLPDLCR2000EVM
Other Parts Discussed in Thread: DLPC2607

Hi Team,

I am trying to read the SPI flash data using the DLPC2607 flash controller and following the steps as discribed in DLP2607 software developer guide.

2.3.2.3.3

Flash Read Command Sequence • I 2C write to configuration registers: “flash start address (address 0x79)”, flash ADDR BYTES (address: 0x74), “flash opcode (address 0x78)”, “flash dummy bytes (address 0x75)”, “flash read data byte quantity (address 0x77)”, “flash write data byte quantity (address 0x76)” • I 2C write to “flash mode control (address 0x08)” to select to select flash read mode (data = 3) and give control of configuration space to the flash interface • I 2C read of the flash read data register (address 0x07) (I2C read returns contents of 32 bits flash data per address) • Repeat I 2C reads until the pre-defined byte count is reached. If more I 2C reads were performed than defined in the DMA length, then the last data is repeated • I 2C poll of main status register (address 0x03) to check if the flash transactions is complete – No other configuration access shall be performed via I 2C until the DMA completes, or it aborts • I 2C write to “flash mode control (address 0x08)” to place the flash controller back in idle mode (data = 0)

below is the python code i have written for this

def DPP2607_Read_FlashData();

#Set flash start address
i2c.write([0x79, 0x00, 0x00, 0x00, 0x00])
#Set flash address bytes (winbond 16M as 24bit(3 bytes) address)
i2c.write([0x74, 0x00, 0x00, 0x00, 0x03])
#set flash Opcode (0x0B for fast read)
i2c.write([0x78, 0x00, 0x00, 0x00, 0x0B])
#set flash dummy bytes (1 byte)
i2c.write([0x75, 0x00, 0x00, 0x00, 0x01])
#set flash read data byte quantity(4 bytes as 0x07 register can hold 4 bytes data)
i2c.write([0x77, 0x00, 0x00, 0x00, 0x04])
#set flash write data byte quantity(4 bytes as 0x07 register can hold 4 bytes data)
i2c.write([0x76, 0x00, 0x00, 0x00, 0x04])
#set flash mode control to read 0x03
i2c.write([0x08, 0x00, 0x00, 0x00, 0x03])


#Read flash data register 0x07
i2c.write([0x15, 0x07])
payload = i2c.read(4)
print(payload)

#Read flash data register 0x07
i2c.write([0x15, 0x07])
payload = i2c.read(4)
print(payload)

#Read flash data register 0x07
i2c.write([0x15, 0x07])
payload = i2c.read(4)
print(payload)
i2c.write([0x08, 0x00, 0x00, 0x00, 0x03])

return 0
Output
[0x00, 0x10, 0x00, 0xC8]
[0x00, 0x10, 0x00, 0xC8]
[0x00, 0x10, 0x00, 0xC8]
The data returned by the flash data register 0x07 is always 
[0x00, 0x10, 0x00, 0xC8]
Is their anything missing from my side. ?