Skip to main content
ako
Associate
May 30, 2017
Question

STM8L152 I2C base on DMA

  • May 30, 2017
  • 1 reply
  • 1802 views
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
This topic has been closed for replies.

1 reply

ako
akoAuthor
Associate
June 1, 2017
Posted on June 01, 2017 at 12:45

Use DMA transfer for data amount greatest than 2 bytes.