mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
Use Supply Controller to avoid running SAM3 on voltages lower than 3.0V
Sometimes there is some leakage current via some I/O that's sufficient to power up the SAM3S. Use the supply monitor to make sure the CPU will be reset (and kept in reset) if the supply voltage is below 3.0V.
This commit is contained in:
@@ -119,6 +119,13 @@ extern WEAK void LowLevelInit( void )
|
||||
{
|
||||
uint32_t timeout = 0;
|
||||
|
||||
/* Configure the Supply Monitor to reset the CPU in case VDDIO is
|
||||
* lower than 3.0V. As we run the board on 3.3V, any lower voltage
|
||||
* might be some kind of leakage that creeps in some way, but is not
|
||||
* the "official" power supply */
|
||||
SUPC->SUPC_SMMR = SUPC_SMMR_SMTH_3_0V | SUPC_SMMR_SMSMPL_CSM |
|
||||
SUPC_SMMR_SMRSTEN_ENABLE;
|
||||
|
||||
/* enable both LED and green LED */
|
||||
PIOA->PIO_PER |= LED_RED | LED_GREEN;
|
||||
PIOA->PIO_OER |= LED_RED | LED_GREEN;
|
||||
|
||||
Reference in New Issue
Block a user