Other Parts Discussed in Thread: MSPM0G3507
Dear TI Team,
I have ZD25WQ16CTIGT NOR Flash( SPI enabled) and trying to read and write operation with the same.
I have done the above setup with STM32 MCU below I attached the code as well ( Reading manufacture ID of NOR flash after reset).
void ZD25WQ16_RESET(void)
{
uint8_t Txdata[2];
Txdata[0] = 0x66; // Enable reset command
Txdata[1] = 0x99; // Reset command
CS_LOW();
HAL_SPI_Transmit(&ZD25WQ16_SPI, Txdata, 2, 1000);
CS_HIGH();
HAL_Delay(100);
}
void ZD25WQ16_ID(void)
{
uint8_t Txdata= 0x9f; //Send command for Reading manufacture ID [ (MID7-MID0) , (ID15 - ID8) ,(ID7 - ID0)]
//Expected result should be [MID7-MID0 -> BA], [ID15 - ID8 -> 60] [ID7 - ID0 -> 15]
CS_LOW();
HAL_SPI_Transmit(&ZD25WQ16_SPI, &Txdata, 1, 1000);
HAL_SPI_Receive(&ZD25WQ16_SPI, Rxtdata, 3, 3000);
CS_HIGH();
}
Same thing I try to do with MSPM0G3507 MCU , I am getting only garbage value , even I check the clock on oscilloscope that is getting fine , Below i attached the code for the same as well (first reset then Reading manufacture ID of NOR flash)
I am little bit confused about the driver library of MSPM0 MCU,I took the example code form the MSPM0 SDK for spi_fifo_multibyte and start my project over the same.
uint8_t Txdata[SPI_PACKET_SIZE] = {0x66,0x99}; // Reset command;
uint8_t Txdata1[2]= {0x9f}; //Send command for Reading manufacture ID
uint8_t Rxtdata[3];
int main(void)
{
SYSCFG_DL_init();
/* Fill TX FIFO with data and transmit to SPI Peripheral */
DL_SPI_fillTXFIFO8(SPI_0_INST, &Txdata[0], SPI_PACKET_SIZE);
while (DL_SPI_isBusy(SPI_0_INST));
/* Wait until all bytes have been transmitted and the TX FIFO is empty */
DL_SPI_fillTXFIFO8(SPI_0_INST, &Txdata1[0], 1);
while (DL_SPI_isBusy(SPI_0_INST));
// Wait to receive the SPI data
for (uint8_t i = 0; i < 3; i++) {
Rxtdata[i] = DL_SPI_receiveDataBlocking8(SPI_0_INST); //Expected result should be [MID7-MID0 -> BA], [ID15 - ID8 -> 60] [ID7 - ID0 -> 15]
}
while (1) {
}
}
apart from that one thing I could not understand the Chip select pin as I did the ST code , should I have to do the same manually or that is mux with the SPI pin??
Thanks & Regards
Arjun singh