Line 6: Line 6:
 
[[File:Lpc1768_Keil_01.png]]
 
[[File:Lpc1768_Keil_01.png]]
  
[[File:LPC1768_Keil_02.png]]
+
[[File:Lpc1768_Keil_02.png]]
  
[[File:LPC1768_Keil_03.png]]
+
[[File:Lpc1768_Keil_03.png]]
  
[[File:LPC1768_Keil_04.png]]
+
[[File:Lpc1768_Keil_04.png]]
  
[[File:LPC1768_Keil_05.png]]
+
[[File:Lpc1768_Keil_05.png]]
  
[[File:LPC1768_Keil_06.png]]
+
[[File:Lpc1768_Keil_06.png]]
  
[[File:LPC1768_Keil_07.png]]
+
[[File:Lpc1768_Keil_07.png]]
  
[[File:LPC1768_Keil_08.png]]
+
[[File:Lpc1768_Keil_08.png]]
  
[[File:LPC1768_Keil_09.png]]
+
[[File:Lpc1768_Keil_09.png]]
  
[[File:LPC1768_Keil_10.png]]
+
[[File:Lpc1768_Keil_10.png]]
  
[[File:LPC1768_Keil_11.png]]
+
[[File:Lpc1768_Keil_11.png]]
  
[[File:LPC1768_Keil_12.png]]
+
[[File:Lpc1768_Keil_12.png]]
  
[[File:LPC1768_Keil_13.png]]
+
[[File:Lpc1768_Keil_13.png]]
  
[[File:LPC1768_Keil_14.png]]
+
[[File:Lpc1768_Keil_14.png]]
  
[[File:LPC1768_Keil_15.png]]
+
[[File:Lpc1768_Keil_15.png]]
  
[[File:LPC1768_Keil_16.png]]
+
[[File:Lpc1768_Keil_16.png]]
  
[[File:LPC1768_Keil_17.png]]
+
[[File:Lpc1768_Keil_17.png]]
  
  

Revision as of 23:42, 25 March 2016


Objective

LPC1768 Keil Setup


Lpc1768 Keil 01.png

Lpc1768 Keil 02.png

Lpc1768 Keil 03.png

Lpc1768 Keil 04.png

Lpc1768 Keil 05.png

Lpc1768 Keil 06.png

Lpc1768 Keil 07.png

Lpc1768 Keil 08.png

Lpc1768 Keil 09.png

Lpc1768 Keil 10.png

Lpc1768 Keil 11.png

Lpc1768 Keil 12.png

Lpc1768 Keil 13.png

Lpc1768 Keil 14.png

Lpc1768 Keil 15.png

Lpc1768 Keil 16.png

Lpc1768 Keil 17.png


#include "LPC17xx.h"
#include "rtc.h"
#include "lcd.h"
int main()
{
rtc_t rtc;
SystemInit();
/*Connect RS, RW, EN and data bus to PORT0.4 to PORT0.7*/
LCD_SetUp(P2_0,P2_1,P2_2,P_NC,P_NC,P_NC,P_NC,P1_24,P1_25,P1_26,P1_27);
LCD_Init(2,16);
RTC_Init();
rtc.hour = 10; // 10:40:20 am
rtc.min = 40;
rtc.sec = 0;
rtc.date = 1; //1st Jan 2016
rtc.month = 1;
rtc.year = 16;
rtc.weekDay = 5; // Friday: 5th day of week considering monday as first day.
/*##### Set the time and Date only once. Once the Time and Date is set, comment these lines
and reflash the code. Else the time will be set every time the controller is reset*/
RTC_SetDateTime(&rtc); // 10:40:20 am, 1st Jan 2016
/* Display the Time and Date continuously */
while(1)
{
RTC_GetDateTime(&rtc);
LCD_GoToLine(0);
LCD_Printf("time:%2d:%2d:%2d \nDate:%2d/%2d/%2d",(uint16_t)rtc.hour,(uint16_t)rtc.min,(uint16_t)rtc.sec,(uint16_t)rtc.date,(uint16_t)rtc.month,(uint16_t)rtc.year);
}
}