2012-08-24 08:25 AM
Hi,
i try to read the value from external adc by stm32f407.but i could not get the result from adc.MSP3201 is connected STM32f407 by SPI.MCP 3201does not have MOSI pin.the program runs good atSendChar('b')
; .the control is going towhile (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET); repeatedly.
what i did mistakenly? did i correctly configure the SPI2?i attached my programs.i need any suggestion from you.i have attached hiper terminal result also.please check it out #adc2012-08-24 08:53 AM
RCC_APB2PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);
APB1 surely?2012-08-27 11:45 PM
sorry for late reply.Thank for Your valuable reply. i did mistake in that place.
RCC_APB2PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE); //its Wrong oneRCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE); //its correct one.Again thank for You(clive1).2012-08-29 04:19 AM
after doing the clock correction,i got same result as like previous Result.Any suggestion?
2012-08-29 05:20 AM
MCP 3201does not have MOSI pin ...
It is obviously only a SPI slave device, so it does not have a MOSI pin (Master Out, Slave In). The Dout pin of the ADC thus needs to be connected to the controllers MISO pin. Check if your wiring is correct.2012-08-29 08:15 AM
Thank for your response(fm).But its not my doubt.i knew that external adc has no Din.And i also connected the Dout of the external adc to MISO of stm32f4.MY problem is that i did not get positive result from adc.the control is arrested in this place
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET);
2012-08-29 11:03 AM
i knew that external adc has no Din.And i also connected the Dout of the external adc to MISO of stm32f4
O.k., this was not clear from your first post. That is a good point to bring a scope into play, to observe the signals at the pins. Can you see the clock ? Do you see outgoing data on Dout if you disconnect Dout from MISO ? The result would point to the source of your problems.
2012-08-29 10:24 PM
i do not have Scope,, to observe the signals at the pins.So i can not see.
2012-08-30 04:01 AM
yes. i got a value from external adc(mcp3201, mcp3208).
Thank for your support.(Clive1 and fm):)i learn from mistakes..