This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CMSIS_BITPOSITIONS | |
#include <__cross_studio_io.h> | |
#include "lpc43xx.h" | |
// | |
// Configure LPC43xx ARM Cortex M4 microcontroller to 204 MHz using 12 MHz crystal | |
// | |
void Configure_Main_Clock_And_Busses() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Configure LPC43xx ARM Cortex M4 microcontroller to 204 MHz using 12 MHz crystal | |
// | |
#define CMSIS_BITPOSITIONS | |
#include "lpc43xx.h" | |
void Configure_Clocks() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize SysTick timer | |
uint32_t* p_systick = (uint32_t*) 0xE000E010; // SysTick memory address | |
p_systick[1] = 0x00FFFFFF; // This value will be loaded automatically into p_systick[2] everytime the counter hits zero | |
p_systick[2] = 0x00000000; // Set from which value we start counting down | |
p_systick[0] |= 1; // Start the SysTick timer | |
// Reset the SysTick counter to ANY 24bit value WHENEVER you want | |
// The timer instantly starts counting down from that value | |
// Here we reset it to its max value of 0x00FFFFFF | |
p_systick[2] = 0x00FFFFFF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Clock STM32F37x to 72 MHz using 8 MHz crystal | |
// | |
#include <stm32f37x.h> | |
/* | |
AHB = max 72 MHz | |
APB2 = max 72 MHz | |
APB1 = max 36 MHz |