2015-03-18 03:59 AM
2015-03-19 02:21 AM
Hi,
Like Clive said before, you can either check it as '!=RESET' or '==SET'. But '==RESET' is exactly where you started from, so it will definitely not help.2015-03-19 03:46 AM
Hi Kumar,
I have checked it as '!=RESET' or '==SET. By this it is not entering inside any of the case itself.2015-03-19 04:12 AM
Yes, it wouldn't enter the IF loop because Master has not yet sent any data over SPI. Did you check already if it doesn't work at all, irrespective of Master sending data or not?
2015-03-19 04:38 AM
Hi Kumar,
Now I have tried to test either master is sending via SPI or not, for that testing I have used small logic using leds that as belowGPIOE->BSRRH |= GPIO_Pin_7; // set PE7 (CS) lowSPI1_send(i); // transmit data
GPIOD->BSRRL = 0x1000; //Set LED1 (Green)
received_val = SPI1_send(0x00); // transmit dummy byte and receive data
GPIOD->BSRRL = 0x4000; //Set LED3 (Red)
GPIOE->BSRRL |= GPIO_Pin_7; // set PE7 (CS) high By testing like this both the green and red leds glowing its mean that master is sending and receiving that data right ? Please correct me if i'm wrong anywhere.
2015-03-19 07:47 AM
I wouldn't rely on the glowing LED's to test if the data has been sent by the Master, as it does not check the timings and the actual data being sent. It could also happen that the data is not going out from the pins, but your LED will glow anyway.
If you have an oscilloscope, then you can simply check if the signals are being sent and if the timings are correct.2015-03-19 07:49 AM
Use an oscilloscope to confirm you have an SPI signal coming out of the Master. If you have a logic analyzer even better. Use a debugger, SWV or USART to provide information about what you see at the SPI interface, both status and data registers.