Posts

Showing posts from December, 2018

RTC PROGRAM FOR ARM7LPC2129

                    RTC PROGRAM FOR ARM7LPC2129                PROGRAM FOR DISPLAYING CLOCK TIME?       #include<lpc21xx.h> #define RS (1<<10) #define RW (1<<12) #define EN (1<<13) #define DATA_PINS (0xff<<15)        void lcdcmd(int cmd);  void lcddata(char data);  void lcdstring(char *str); void lcdstring1(char *str1); void lcd_num(int num); void delay(int count); void lcdinit(void); void delay(int count) {  int i,j;  for(i=0;i<count;i++)  {   for(j=0;j<5000;j++)   {   }  } } void lcdcmd(int cmd) {  IOCLR0=RS;  IOCLR0=RW;  IOCLR0=(DATA_PINS);  IOSET0=(cmd<<15);  IOSET0=EN;  delay(30);  IOCLR0=EN; }                 void lcddata(char d...

TIMER PROGRAMS FOR LPC2129

                 TIMER PROGRAMS FOR LPC2129 program for creating interpret using match registers? #include<lpc21xx.h> void delay(int count) { int i,j; for(i=0;i<count;i++) { for(j=0;j<1000;j++) { } } } int main()            {  IODIR1|=(0xff<<17); T0TCR=1<<0; T0PR=14; T0MR0=5000000; T0MR1=10000000; T0MR2=15000000; T0MR3=20000000; T0MCR=(1<<0)|(1<<3)|(1<<6)|(1<<9)|(1<<10);// only interpet ,reset and set while(1) { if(T0IR&(1<<0)) { IOSET1=(1<<17); delay(500); IOCLR1=(1<<17); delay(500); } T0IR=(1<<0); if(T0IR&(1<<1)) { IOSET1=(3<<17); delay(500);       IOCLR1=(3<<17); delay(500); } T0IR=(1<<1); if(T0IR&(1<<2)) { IOSET1=(7<<17); delay(500); IOCLR1=(7<<17); delay(500); } T0IR=(1<<2); if(T0IR&(1<<3)) { ...

KEYPAD PROGRAM FOR ARM7 LPC2129

                    KEYPAD PROGRAM FOR ARM7 LPC2129 PROFGRAM FOR PRINTING PHONE KEY-PAD  #include<lpc21xx.h> #define ROW (0Xf<<17)//r1 r2 r3 r4  #define COL (0Xf<<21)//c1 c2 c3 c4 void delay(int count) { int i,j; for(i=0;i<count;i++) { for(j=0;j<5000;j++) { } } } void lcdcmd(int cmd) { IOCLR0=(0xff<<15); IOSET0=(cmd<<15); IOCLR0=(1<<10);//rs IOCLR0=(1<<12); //RW IOSET0=(1<<13);//EN delay(30); IOCLR0=(1<<13);//EN } void lcddata(char data)   {   IOCLR0=(0xff<<15);  IOSET0=(data<<15); IOSET0=(1<<10);//rs IOCLR0=(1<<12); //RW IOSET0=(1<<13);//EN delay(30); IOCLR0=(1<<13);//EN   } void lcdstr(char *str) {  while(*str)  {  lcddata(*str);  str++;  }  }   void row() { int C_VAL; IODIR1 |=COL; IOCLR1 =COL; IODIR1&=~(ROW); C_VAL=IOPIN1&(ROW); C_VAL>>=1...

LCD PROGRAM FOR ARM7 LPC2129

Image
          LCD PROGRAM FOR ARM7 LPC2129  program for displaying the number in lcd ? #include<lpc21xx.h> void delay(int count) { int i,j; for(i=0;i<count;i++) { for(j=0;j<5000;j++) { } } } void lcdcmd(int cmd) { IOCLR0=(0Xff<<15); IOSET0=(cmd<<15); IOCLR0=(1<<10); IOCLR0=(1<<12); IOSET0=(1<<13); delay(100); IOCLR0=(1<<13); }  void lcddata(int data) { IOCLR0=(0Xff<<15); IOSET0=(data&0xff<<15); IOSET0=(1<<10); IOCLR0=(1<<12); IOSET0=(1<<13); delay(100); IOCLR0=(1<<13); } void lcdnum(int num) { int sum; while(num!=0) { num=num%10;  sum=sum+num; lcddata(sum+0x30); } } void lcdstr(int *str) { while(*str) { lcddata(*str); str++; } } void main() { IODIR0|=(1<<10)|(1<<12)|(1<<13)|(0Xff<<15); lcdcmd(0x38); lcdcmd(0x0E); lcdcmd(0x01); lcdcmd(0x08); lcdstr("now displaying number"); lcdnum(11234); }

BLINKING LED PROGRAM IN LPC2129

          BLINKING LED PROGRAM IN LPC2129 program for push-button input and making on and off led other wise blink another led ? #include<lpc21xx.h>       //include libray void delay(int count)      //user delay funcation { int i,j; for(i=0;i<count;i++) { for(j=0;j<5000;j++)      //delay = count*5000 { } } } int main() { IODIR0=IODIR0|(1<<17)|(1<<24);  //direction to led pins IODIR0=IODIR0&~(1<<25);          // direction to input while(1)                                            // it will be for repeat loop { if(IOPIN0&(1<<25))                      // iopin for checking input iopin default is zero { IOSET0=(1<<17) ;       ...