Other Parts Discussed in Thread: MSP432E401Y
I am having no luck getting a simple response from a Microchip 25LC1024 EEPROM. Code below will successfully write a 32-bit transaction; the command 0xAB, followed by 24 bits of drivel. (0xAB: Release from Deep power-down and read electronic signature). If CS is kept low, the response should be 0x29, the Manufacturer's ID, per this from the DataSheet:
It's clear that the CS bumps high right after the MOSI write; how do I control this in a more granular fashion using the SPI Driver??
(Must admit, I've never tried the SPI Driver approach before). We've done this on a pin-by-pin GPIO basis in other contexts; do I have to go back to that? For that matter, what is the advantage of moving to the EUSCI model? Which approach is optimal on this platform? IE, which should we figure out, then stick with? Really lovin' the MSP432E platform; am doing early experiments.
Following code is based loosely on spi_master, with all the master-slave notification bits removed:
/* Open SPI as master (default) * The 25LC1024 contains an 8-bit instruction register. */ SPI_Params_init(&spiParams); spiParams.frameFormat = SPI_POL0_PHA0; masterSpi = SPI_open(Board_SPI_MASTER, &spiParams); if (masterSpi == NULL) { Display_printf(display, 0, 0, "Error initializing master SPI\n"); while (1); } else { Display_printf(display, 0, 0, "Master SPI initialized\n"); } /* Initialize master SPI transaction structure */ uint8_t masterTxBuffer[32] = SSE_RDID; // 0xAB Release from Deep power-down and read electronic signature uint8_t masterRxBuffer[32]; transaction.count = 4; // LOU MOD: 4 * 8 bits? transaction.txBuf = (void *) masterTxBuffer; transaction.rxBuf = (void *) masterRxBuffer; /* Toggle user LED, indicating a SPI transfer is in progress */ GPIO_toggle(Board_GPIO_LED1); /* Perform SPI transfer */ transferOK = SPI_transfer(masterSpi, &transaction); if (transferOK) { Display_printf(display, 0, 0, "Master received: %s", masterRxBuffer); } else { Display_printf(display, 0, 0, "Unsuccessful master SPI transfer"); }