2014-11-19 03:50 PM
Hello i want to test my BT on Discovery board. I connected all pins correctly and build easy code for recive data and turn on the light.In my code i use this function to recive data on STM.
if
(USART_GetFlagStatus(USART3, USART_FLAG_RXNE)!=RESET)
i=USART_ReceiveData(USART3);
I send numbers 1,2,3,6,8 (i is integer) from RealTerm terminal from my laptop to STM. In Debugger i see under ''i'' place random numbers like 252, 244, 252, 255 . What is wrong with my code ? or problem happens in other side ?
2014-11-19 04:16 PM
Stick a scope on it an confirm the baud rates by observing the data patterns and bit timings, both from the bluetooth side, and by transmitting from the STM32 side.
It's important that the code is compiled with the code configured for using the 8 MHz on the STM32F4-DISCO, and that HSE_VALUE within the project also reflects this.2014-11-19 04:51 PM
i have STM32F4 Discovery and using CooCox :) HSE_Value is 8Mhz like my external oscilator on board but i cant switch them to use HSE, only can change to HSI 16Mhz or 168Mhz (i watch variable SystemCoreClock();
in datasheet HC-05 are 9600 , 8n1 so i use it in usart configuration in STM. it is possible my HC got diferrent setup than datasheet ?2014-11-20 09:02 AM
it is possible my HC got different setup than datasheet ?
I didn't configure or sell you the parts, I have no idea how they might be configured for the parts you have. I'd start with the scope, or by attaching to a PC, and confirm what is and isn't functioning, and at what speeds.2014-11-20 01:45 PM
ouuhhh now is everything working ok ...
i have to change HSE Value to 8000000 and PLL_N to 8