cancel
Showing results for 
Search instead for 
Did you mean: 

STM8L152 I2C base on DMA

ako
Associate II
Posted on May 30, 2017 at 19:35

Hello Everyone.

I have trouble on STM8L152 with I2C through DMA. When receiving 1 data byte its receive 2 bytes 1st: some wrong  (0x1F, 0x1E, 0x0E), and second byte (looks like necessary data).

In case when receive long sequence, around 100 bytes, the same situations. The first byte some 'rubbish', next one is normal data.

I'm try communicate with accelerometer MMA8652.

F_MCU = 2MHz.

F_I2C = 100kHz.

STVD 4.3.10 with Cosmic compiler.

Who have experience in I2C with DMA on STM8L or the same issue, what the workaround for this issue? 

 

#i2c #dma #stm8l
1 REPLY 1
ako
Associate II
Posted on June 01, 2017 at 12:45

Use DMA transfer for data amount greatest than 2 bytes.