Contents
What is DMA in I2C?
If it’s IIC, then all it really needs is IIC being implemented over two pins. DMA is a means inside the processor of dealing with I/O data, which has nothing directly to do with how that peripheral does signalling to the outside world.
What is I2C in STM32?
I2C Hardware In STM32 2.1 STM32 I2C Hardware Overview. I2C (inter-integrated circuit) bus Interface serves as an interface between the microcontroller and the serial I2C bus. It provides multi-master capability and controls all I2C bus-specific sequencing, protocol, arbitration, and timing.
How I2C works in STM32?
The connections for demonstrating the use of I2C in STM32F103C8T6 is very simple. Connect the SDA pin of STM32 i.e. PB7 with corresponding SDA pin of Arduino i.e. A4. Similarly, connect the SCL pin of STM32 i.e. PB6 to corresponding SCL pin of Arduino i.e. A5. Pull the SDA and SCL pins HIGH using two 4.7KΩ resistors.
How many I2C devices can be connected to STM32?
I2C Device Addressing This means that you can have up to 128 devices on the I2C bus, since a 7bit number can be from 0 to 127. When sending out the 7 bit address, we still always send 8 bits. The extra bit is used to inform the slave if the master is writing to it or reading from it.
How to use DMA and I2C to read data?
Noted the define “USE I2C DMA” I used to choose between regular way and DMA way of reading. Here the INT pin is connected to GPIO Pin 4 of GPIOB so EXTI4 is activated. Then the I2C DMA Read function is presented:
How is the i2c1 RX connected to the memory buffer?
The purpose of this configuration is to connect the I2C1 RX with the memory buffer directly using the corresponding DMA channel. We have some important points to notice here in order for you to be able to edit the code yourself in the future if you use a another I2C peripheral or different type of sensor with different byte to transfer through DMA:
When to use regular reading and DMA reading?
Following figures show the timing consume of two method: regular reading and DMA reading. Channel 3 in both figures shows the timing period when CPU is dealing with I2C reading. With the normal way of reading I2C data, CPU is busy for the whole period and cannot do anything else.