Hi Jose,
Glad GPIO clocks enabled OK.
Yes a large current draw could cause the K20 (which K20 device are you using?) to reset.
The Kinetis devices have a low-voltage detect (LVD) capability. When voltage gets below specific value, the device will reset.
In the reference manual there is a Reset and Boot chapter. It details what registers to look at.
6.2.2.2 Low-voltage detect (LVD)
The chip includes a system for managing low voltage conditions to protect memory
contents and control MCU system states during supply voltage variations. The system
consists of a power-on reset (POR) circuit and an LVD circuit with a user-selectable trip
voltage. The LVD system is always enabled in normal run, wait, or stop mode. The LVD
system is disabled when entering VLPx, LLS, or VLLSx modes.
The LVD can be configured to generate a reset upon detection of a low voltage condition
by setting the PMC's LVDSC1[LVDRE] bit to 1. The low voltage detection threshold is
determined by the PMC's LVDSC1[LVDV] field. After an LVD reset has occurred, the
LVD system holds the MCU in reset until the supply voltage has risen above the low
voltage detection threshold. The RCM's SRS0[LVD] bit is set following either an LVD
reset or POR.
Also chapter on Power Management Controller:
15.3 Low-voltage detect (LVD) system
This device includes a system to guard against low-voltage conditions. This protects
memory contents and controls MCU system states during supply voltage variations.
....
Regards,
David