I'm trying to set up a simple project that does the following:
Enter sleep mode and in the main loop, it waits for interrupt - __WFI().
Transmits data from a buffer to the PC, via UART.
The second point of the program would ideally be done via DMA, so that the MCU wouldn't wake up from sleep.
To that effect, I was thinking of hooking up a DMA transfer in circular mode. So every time a timer (say timer1) overflows, it automatically triggers a UART transfer. When the DMA transfers the 4th byte of buffer, it would start over from the beginning.
Can I trigger a DMA when the CPU is in sleep mode?