Difference between revisions of "Systick Timer On Explore M3"
(Created page with "Category:Explore M3 Bare Metal In this tutorial we will discuss how to configure lpc1768 systick timer for 1ms tick.<br><br> <br><br><br> =Prerequisites= Please check L...") |
|||
Line 4: | Line 4: | ||
=Prerequisites= | =Prerequisites= | ||
− | Please check [[LPC1768: | + | Please check [[LPC1768: SysTick Timer|this tutorial]] for detailed explanation on inbuilt Lpc1768 RTC module.<br> |
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file. | If you are doing it for the first time, then check the below links to setup the project for generating the .bin file. | ||
#[[LPC1768: Keil Project For Bin File|Keil4 Setup]] | #[[LPC1768: Keil Project For Bin File|Keil4 Setup]] | ||
Line 11: | Line 11: | ||
#[[Setting Up ARM GCC And Eclipse For ExploreM3 LPC1768|Eclipse & ARM GCC Setup]] | #[[Setting Up ARM GCC And Eclipse For ExploreM3 LPC1768|Eclipse & ARM GCC Setup]] | ||
<br><br> | <br><br> | ||
− | |||
=Hardware Connection= | =Hardware Connection= |
Latest revision as of 16:06, 29 April 2016
In this tutorial we will discuss how to configure lpc1768 systick timer for 1ms tick.
Contents
[hide]Prerequisites
Please check this tutorial for detailed explanation on inbuilt Lpc1768 RTC module.
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file.
Hardware Connection
LED is Connected to pin 13 on Explore M3 board.
Code
Below is the sample code to blink the LED's with 1ms delay using systick timer.
This file contains hidden or 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
#include "stdutils.h" | |
#include "systick.h" | |
#include "gpio.h" | |
#define LED 13 | |
void myIsr(void) | |
{ | |
GPIO_PinToggle(LED); /* Toggle the LED(13) to measure the time */ | |
} | |
int main() | |
{ | |
SystemInit(); | |
GPIO_PinDirection(LED,OUTPUT); /* Configure the Led Pin as Output */ | |
SysTick_Init(); /* Initialize SysTick for 1ms(default)*/ | |
SysTick_AttachInterrupt(myIsr); /* myIsr will be called by SysTick_Handler every ms */ | |
SysTick_Start(); /* Start SysTick Timer */ | |
while(1) | |
{ | |
/* Do Nothing */ | |
} | |
} |