1
\$\begingroup\$

For a school project I a got HC-05 bluetooth module and MikroE Clicker2 with STM32 (ARM).

When I connect and use module with Arduino, 9600 BAUD rate and all other settings used with SoftwareSerial work and module properly communicates with my Android device.

Once I connect HC-05 with clicker, on some of UART ports(there are 4 on my board), communication works but data is corrupted. Actually data is always composed of same values (exact value is 192).

Both sending and receiving work, module is properly connected rx/tx tx/rx, but data is always equal to same value.

Any idea what can cause said data corruption? Since it works on Arduino I am sure its not between module and android device.

\$\endgroup\$
  • \$\begingroup\$ The UART settings are exactly the same on the Arduino and the Clicker? \$\endgroup\$ – Bence Kaulics Nov 26 '16 at 11:05
  • \$\begingroup\$ Hey, yes they are: Arduino: SoftwareSerial BTserial(2, 3); BTserial.begin(9600); Clicker2(MikroC) UART3_Init_Advanced(9600, _UART_8_BIT_DATA, _UART_NOPARITY, _UART_ONE_STOPBIT, &_GPIO_MODULE_USART3_PD89); HC-05: AT+UART? returns 9600,0,0 \$\endgroup\$ – nikola-miljkovic Nov 26 '16 at 11:44
1
\$\begingroup\$

I have fixed this problem, solution was to edit project configuration in MikroC IDE, there were few premade schemes that i tried and one of them worked, everything works great now.

Project configuration can be changed from Project -> Edit Project and there will "Load Scheme" button on right. There by default it will show you few premade schemes, select one for your microprocessor.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.