Hi guys,
I've just attempted to hash together some basic SPI test code, however, the module doesn't appear to be shifting data out to transmit. The Transmit Complete flag isn't triggering and my Logic Analyser isn't picking anything up on the relevant pins.
My code is as follows:
#define CMSIS_BITPOSITIONS 1 #include <LPC43xx.h> int main( void ) { // Update the System Core Clock SystemCoreClockUpdate(); // Configure pins for SPI LPC_SCU->SFSP3_6 = 1; // MISO LPC_SCU->SFSP3_7 = 1; // MOSI LPC_SCU->SFSP3_3 = 1; // SCK LPC_SCU->SFSP3_8 = 1; // SSEL // Configure the SPI Master Clock (PCLK_SPI / SPCCR) LPC_SPI->CCR = 16; // Configure the SPI Module for Master Mode LPC_SPI->CR |= SPI_CR_MSTR_Msk; while( 1 ) { LPC_SPI->DR = 0xA1; while( !(LPC_SPI->SR & SPI_SR_SPIF_Msk) ); } }
The unit appears to be powered, as I'm able to to set values in LPC_SPI->CR and LPC_SPI->CCR, however there's no evidence that data being inserted into LPC_SPI->DR is being shifted out.
I'm new to the 4357 and so perhaps I'm missing a step in clock setup? It's my understanding that SPI is enabled by default with a default base clock from the IRC.
Greatly appreciate any help, Many thanks