Posts

Showing posts from January, 2019

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"                                                                                                                                      ...