Skip to content

Standard System Initialization

MathiasBeckius edited this page Oct 20, 2014 · 3 revisions

When the system boots, some things must be initialized. To make a "standard" initialization, this code must be executed before anything else:

/*
* Set Flash Wait State, by defining the number of cycles
* for read and write operations: FWS + 1
*/
eefc_set_flash_wait_state(EEFC0, 4);
eefc_set_flash_wait_state(EEFC1, 4);

// initialize system clock
pmc_init_system_clock();

// disable the watchdog timer
wdt_disable();

Don't forget to include the header files for the API's!

Clone this wiki locally