How to delay() by milliseconds / microseconds on the PIC32

First, use MPLab Harmony Configurator 3to enable the CORETIMERmodule for your project. No special configuration is neccessary.

After that, use

example.cpp
CORETIMER_DelayMs(uint32_t delay_ms)

to delay for a given number of milliseconds or use

example.cpp
CORETIMER_DelayUs(uint32_t delay_us)

to delay for a given number of microseconds.


Check out similar posts by category: Electronics, Embedded