Question
STM32F4 8bit DMA to GPIO
Posted on April 16, 2015 at 17:05
Hello,
I'm relatively new to the STM32F4 family but have worked with other microcontrollers in the the past. I'm trying to use DMA to send 8bits of data at a time from a memory array to a GPIO (GPIO_C) using DMA with TIM4 as a trigger. I've played around with the DMA MEM to DAC example. What I'm confused by is: 1) Peripheral (GPIO_C) address. According to the datasheet GPIOC base addr = 0x40020800. GPIOx_ODR has offset of 0x So the peripheral address is0x40020814? 2) How do I DMA 8bits at a time to a 32bit GPIOC_ODR register? GPIOC_ODR is a 32 bit register with only the lower 16 being used. How do I write to lowest 8bits? Or bits 8..15? DMA Init has settings for chunk size.DMA_InitStructure.DMA_PeripheralDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; But how do I define which portion of the 32bit register will receive the 8bits?
Thank you,
Boris.