I'm using an STM32F407ZET6 with the Arduino core support in PlatformIO. CPU has an external 8MHz crystal running at 168MHz. I have a project where I'm already using UART1, I2C1, SPI2 and SDIO (1Hz rate using this example as the basis of my code) as well as 14 analogue inputs. I have 14 output pins that I want to PWM at a frequency of 200Hz to drive some HSDs.
Since I don't have any PWM enabled pins available, I have tried to achieve this by using a hardware timer with a 50us interval to give a PWM resolution of 100. This works in principal but I think the frequent interrupts are causing havoc with the other peripherals, especially SDIO which seems to stop writing to the SD. I have tried several different timers in an attempt to resolve issues with SDIO. Without the timer enabled, SD logging at 1Hz seems to be robust.
The other approach I think may work is using a hardware timer with DMA to write to the port registers in the hope that this won't upset the other peripherals. Is this feasible and can anyone give me guidance? How do I achieve this? I have spent several hours trying to implement GPIO updates to port F and G without any success.