Posts

project for checking status of lights very day 12 :11 am

   project for checking status of lights very day 12 :11 am   Descripition : Where it help to save the power in big bulidings it will checking the lights states in very room where according your configure desigined  where you can send meassage to pariticular floor this room turn off lights thorght bluetooth commonds. project code #include<lpc21xx.h> #include "delayheader.h" #include "lcdheader.h" #include<string.h>       void init_rtc(void); void init_rtc() {  lcdstring("Digital timer");  CCR=(1<<0);   // enable  PREINT=456;   // crystel oscillator giving 15Mhz, but rtc will work at 32.768khz  to scle this we are using formula and geting this number   PREFRAC=25024;  HOUR=12;  ALHOUR=12;  ALMIN=10;  MIN=11;  SEC=0; } int main() {    int i;  char *password="check"; char recvpass[5];  ...

ADC (anlog to digital)

Image
                          ANLOG TO DIGITAL  PINSEL1 :  where it is used to change the pin state either input are output state  ADCR : Adddres control register used to enable state of adc block  ADDR: Addres data register program code #include<lpc21xx.h> int main() {  int result;  PINSEL1 |=(1<<24);   //pin configuration  PINSEL1 &= ~(1<<25);  ADCR=(1<<1) | (3<<8)| (1<<16) | (1<<21);              //adc configuration  while(1)  {   while(!(ADDR & (1<<31))); //if addr bit 1 then   result=ADDR & (0x3ff<<6); //read the result   result=result>>6;   //then shift back   lcd_num(result/3.3);  //if we divid result with 3.3 then we will get duty cycle   ...

I2C PROTOCAL

                                 I2C PROTOCAL   Code for I2C to EEPROM  TASK TO WRITE VALUES IN EEPROM AND READ FROM EEPROM ? //I2C #include <LPC21xx.h> #include "delayheader.h" #include "lcdheader.h" #include "i2c_header.h" int main() {  char c;  PINSEL0 |=(1<<4)|(1<<6);   //pin configure  PINSEL0 &=~(1<<5)|(1<<7);  lcdinit();      //lcd initialization  lcdstring("I2C PROGRAM");  lcdcmd(0xc0);  I2CONSET= (1<<6);    //this register 6th bit is ENABLE the I2C Block  I2SCLH=75;        //refer notes given clcok  I2SCLL=75;      I2C_START();  //FOR I2C start funtion  I2C_DATA(0xA0);    // device addres (memory addres)  I2C_DATA(0x00);  I2C_...

CAN BOARD TO BOARD COMMUCTION

Image
              CAN BOARD TO BOARD COMMUCTION CODE FOR RECIVER BOARD #include "prototype.h" unsigned int  MSG[4]; /*  CAN TEST AT STARTING */ unsigned char can_test(void)  {       while(!(RX_in_CAN1()==2));       clear_lcd();       lcd_str("IGNITION ON");       delay(4000);    if(RX_in_CAN1()==3)     {     clear_lcd();     lcd_str("BRAKE TEST PASS");     delay(3000);     clear_lcd();     lcd_str("SEAT BELT PASS");     delay(3000);     return 1;     }       else     {      lcd_cmd(0x80);      delay(1000);      lcd_s...

AUTOMOTIVE

                      AUTOMOTIVE FOR CAN        CAN PROTOCAL CODE FOR LPC2129 ARM7 BOARD #include"header.h"                                                                                                                                      ...

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)) { ...