I am using MSP430F5529 controller , I am configuring MSP430 as single Master and using SPI interface for external one slave device.
- I observe that CLK,MOSI generating properly, for my application chip select (CS) is active low, and I am controlling this CS using one GPIO, state of this GPIO is controll based on status of TX buffer. I obsevrd that (Using Oscilloscope) this CS pin not remian active low for entire duration of 8 bit.Please check below code and please suggest what is wroung?
/* ensure previous data has sent */
adc_setup ( ) {
while (!SPI_getInterruptStatus(__MSP430_BASEADDRESS_USCI_B0__,SPI_TRANSMIT_INTERRUPT));
/* Active low CS */
output_low(P2OUT,ADC_CS);
/* transmit 8 bit data */
SPI_transmitData(__MSP430_BASEADDRESS_USCI_B0__,cData);
While (!SPI_getInterruptStatus(__MSP430_BASEADDRESS_USCI_B0__,SPI_TRANSMIT_INTERRUPT));
/* disable serial interface ensure Chip select High */
output_high(P2OUT,ADC_CS);
}