2015-01-10 01:14 AM
Dear All,
I would be grate if any one could advice me that in which page the SPI pin configuration is showing in the ''RM0091Reference manual'' STM32F0I mean, What are the proper Configure GPIO for MOSI, MISO and SCK pins.What is the exact pin configuration in which page is showing above configurationThanks in advance2015-01-10 05:54 AM
You'd configure them in AF mode, the direction of MOSI/MISO is determined by the Master or Slave configuration of the SPI.
MOSI - Master Out - Slave In2015-01-10 10:42 AM
Dear Sir,
Thanks for the reply After correct configuration of SPI1 Can I connect the MOSI pin to USART Level sifter input ( RX of MAX 232) Then can we see the SendData16 out put letter of SPI As per my program it is ( 0XFF)while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
SPI_I2S_SendData16(SPI1,0XFF);
Please advice
2015-01-10 11:49 AM
I'm sure you can do a lot of things, you'll have to experiment and understand the signalling of RS232 vs SPI
2015-01-10 08:57 PM
Dear Sir,
Actually what I need to confirm that the SPI is working or not and the send data is outing from the MOSI pin of MCU, Event ought the RS232 and SPI signal formats are different, I am expecting what ever data will display on the PuTTy serial screen. I tested but nothing in displayPlease advice by wordPlease advice2015-01-10 09:39 PM
Dear Sir,
I connected MOSI pin to MISO by wire the configure following code then the system is working. My next experiment is connect the SD card to MCU Any advicevoid Send_Data(){
while(1) {
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
SPI_I2S_SendData16(SPI1,'B');
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
temp = SPI_I2S_ReceiveData16(SPI1);
for(i=0;i<2;i++){
while (USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, temp);
}
delay();
}
}
PLEASE ADVICE
2015-01-11 04:02 AM
Dear Sir,
I connected my SPI program to SD card (4GB Micro SD card inserted to big SD card socket )while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
SPI_I2S_SendData16(SPI1,0x44);
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
temp = SPI_I2S_ReceiveData16(SPI1);
After sending data as above program ( sent data is 0x44) then I read the sd card using hex editor but hex editor does not show anything
Please advice, Am I on correct track???
2015-01-11 06:23 AM
After sending data as above program ( sent data is 0x44) then I read the sd card using hex editor but hex editor does not show anything. Please advice, Am I on correct track???
The protocol for writing to blocks of data on the SD Card is significantly more complication than that.http://wiki.seabright.co.nz/wiki/SdCardProtocol.html
http://alumni.cs.ucr.edu/~amitra/sdcard/Additional/sdcard_appnote_foust.pdf
2015-01-11 06:36 AM
2015-01-11 08:20 AM
Dear Sir.
I found following youtube link how write to the SD card https://www.youtube.com/watch?v=r9BafZi6VpcI can use above method write to the SD cardIf Writing part such complicate, Can I have the advice for reading part using MCUThanks in advance