Hi,
I am working on a custom board using the LMS7002M and a Zynq SoC and I am currently having trouble programming the MCU. I am using the code pasted below which I believe matches the description here.
However the status register always returns 0x89 indicating that the FIFO is not empty. I can perform a read and the status changes to 0x81 which clears the data ready flag but the empty flag remains not asserted. Does anyone have any pointers to what I could be doing wrong?
Thanks in advance!
Code used:
// reset - toggle reset pin
XGpioPs_WritePin(&mio_emio, RESET_EMIO, 0);
XGpioPs_WritePin(&mio_emio, RESET_EMIO, 1);
// reset - set reset register
data_tx = 0x80020000;
spi_transact(data_tx, &data_rx, 4);
// write 1 to 0x0002 - SRAM write
data_tx = 0x80020002;
spi_transact(data_tx, &data_rx, 4);
// write the data to the device
for(int i=0; i<16384; i=i+32) {
// wait until the programming buffer is empty
data_tx = 0x00030000;
do {
spi_transact(data_tx, &data_rx, 4);
}
while(data_rx & 0x00000001);
}