diff --git a/inc/osc_configuration.h b/inc/osc_configuration.h new file mode 100644 index 0000000..b975c4c --- /dev/null +++ b/inc/osc_configuration.h @@ -0,0 +1,6 @@ +#ifndef _OSC_CONFIGURATION_ +#define _OSC_CONFIGURATION_ + +void osc_init(); + +#endif \ No newline at end of file diff --git a/src/osc_configuration.c b/src/osc_configuration.c new file mode 100644 index 0000000..abc2fa1 --- /dev/null +++ b/src/osc_configuration.c @@ -0,0 +1,23 @@ +#include "BA45F5250.h" +#include "stdint.h" +#include "build-in.h" +#include "osc_configuration.h" +#include "macro_define.h" + +void osc_init() +{ + // Control system clock + _scc = 0b00000000; + + // Control HIRC clock + #if _HIRCC_8M + _hircc = 0b00001001; + #elif _HIRCC_4M + _hircc = 0b00000101; + #else + _hircc = 0b00000001; + #endif + + // Control watchdog timer + _wdtc = 0b01010111; +} \ No newline at end of file