cancel
Showing results for 
Search instead for 
Did you mean: 

Why STM32F103C8 is not sending the right data to Slave I2C device? this issue happened when HAL_I2C_Master_Transmit is used and send just one bye.

ERABALF
Associate III

Hi ST community.

I am trying to control a 7 seven

segments display (HT16K33), it has I2C as interface.

If the Display is connected to Arduino

2560 board, it works, but when STM32F103C8 is controlling it, the display is

not working.

after i tested all commands sent to

HT16K33 by I2C, I try to do same from STM32, but it did not work.

So I decide to connected STM32 with

Arduino, running an small scketch written by (Nicholas Zambetti <http://www.zambetti.com) i saw that:

·        when STM32 send data, more than bye per Start/Stop procedure, Arduino received and showed the right informacion (TX and RX are the same).

·        when STM32 send justa one byte per Start/Stop procedure, the information received on Arduino side, it is not the same send from STM32

·        As HT16K33 needs to receive configuration commands byte per byte and Data to be displays can be send one or more bytes per start/stop procedure, so as STM32 looks like is not sending one byte correctly, the display is not working (this is my assumption)

Pictures 1 and 2:

 0693W000008zhnAQAQ.jpg 

0693W000008zhnFQAQ.jpg 

I am using an STM32F103C8 BluePill board,

HT16K33 breakout board and for testing purpose arduino 2560 board.

STM32Cube is used too (Version: 1.6.0)

I have 2 STM32F103c8 bluePill boards and

both are working in the same way

Resume:

STM32f103C8 send data using i2C, if more

than Byte is send using HAL_I2C_Master_Transmit, Data is sent and received

correctly in remote Device (my tester is Arduino), please see picture N°1.

if HAL_I2C_Master_Transmit send one

byte, Arduino ( and HT16K33 too) are not getting the right data sent, please

see picture N°2

Some can help/drive me to solve this

issue, please.

Any comments/recommendations are

welcome.

I apologize for my basic English

Best regards

Alfredo (from Argentina)

1 REPLY 1
ERABALF
Associate III

One more comment:

if HAL_I2C_Master_Transmit_IT is used (instead HAL_I2C_Master_Transmit), same behavior......if HAL_I2C_Master_Transmit_IT send one byte, it failed, if HAL_I2C_Master_Transmit_IT send several bytes, it works ok.

br

Alfredo