keyboardcowboy
Member level 2
I am trying to interface AT45DB161E chip with LPC1758. I want to read the first 528 bytes from page 0. According to the datasheet if I want to directly read a page from the chip then I have to issue the opcode 0xD2 followed by 24bits which includes page address and byte address
In my code this is what I am doing
The problem is I get some valid output only if I sent 1 address byte after the page read command instead of 3 which is the number mentioned in the datasheet
which is the right output, and why do I get all zeroes if I send the commands according to the datasheet
In my code this is what I am doing
Code:
ssp_exchange(0xD2); //issue page read command
ssp_exchange(0x00); //24bit page address for page 0 and byte0
ssp_exchange(0x00);
ssp_exchange(0x00);
ssp_exchange(0xFF); // four dummy bytes (according to datasheet)
ssp_exchange(0xFF);
ssp_exchange(0xFF);
ssp_exchange(0xFF);
char extra[528];
for (int a = 0; a <= 527; a++) { //a for loop to read 528 bytes
extra[a] = ssp_exchange(0xFF);
vTaskDelay(50);
}
The problem is I get some valid output only if I sent 1 address byte after the page read command instead of 3 which is the number mentioned in the datasheet
which is the right output, and why do I get all zeroes if I send the commands according to the datasheet