Posts

serial peripheral interface

         Serial peripheral interface     #include <LPC21xx.H> void spi_data(int data) {  IOCLR0 = (1 << 7);    // CLEARING GPIO PIN  S0SPDR = data ;  while(!(S0SPSR & (1 << 7))); //CHECK STATUS , MONITOR FLAG   (AFTER DATA TRANSFER THE 7TH BIT SET)  IOSET0 = (1 << 7); } int main() {  PINSEL0 |= (1 << 8)|(1<<10)|(1 << 12); //MISO,MOSI,SCK  PINSEL0 &= ~(1 << 9)|(1<<11)|(1 << 13); //MISO,MOSI,SCK  IODIR0 |= (1 << 7);      //SS we are taking GPIO  S0SPCR = (1 << 2)|(1 <<  5); //enabling the SPI and 5 bit for master mode  S0SPCCR = 8;     //8,10,12,14 we can give given by manufacture (refer notes formula)  while(1)  {     //7 SEGMENT DISPLAY CMDS   spi_data(0x0C01);   // 0XC00-OFF,0XC01-...

READING VALUES FROM SENSOR AND THAT WRITING TO EEPROM

READING VALUES FROM SENSOR AND THAT WRITING TO EEPROM code for above tittle project  #include <LPC21xx.H> #include "lcdheader.h" static int count_num=0; void i2c_start(void) {   I2CONCLR=(1<<3);     //CLEARING SI FLAG I2CONSET=(1<<5);     //Start communication while(!(I2CONSET & (1<<3))){}   //wait for SI to go high   I2CONCLR=(1<<5); I2CONCLR=(1<<3); //CLEARING SI FLAG } void i2c_stop(void) { I2CONSET = (1<<4);//STOPPING DATA TRANSFER } char i2c_recv(void) {   int  r; I2CONCLR=(1<<3); while(!(I2CONSET & (1<<3))); r = I2DAT; //lcd_cmd(0xc0); //lcd_data(r);   return(r); } void i2c_data(unsigned char data) {   I2CONCLR=(1<<3);    //clearing SI Flag I2DAT=data;         //Sending SLAVE ADDRESS + READ/WRITE // lcd_data(data); while(!(I2CONSET ...
  Avoided accidents using can protocol through the smartwatch    Protocols: CAN, LCD Brief:     In this project, we checking initial conditions like seat belt etc after that if any case gets to sleep, increase or decrease blood pressure that will sense by smartwatch that information shares can protocol and giving a different indication to outside people and sending a message to 108 and their family members.    Hardware Used: lpc2129 development board (ARM7), Bluetooth, pulse measure sensor. Software Used: Keil µVision 4, Flash Magic code for the above project #include "header.h"                                                         ...

Smart Power management system in any management system

         Smart Power management system in any management system Protocols:    UART, RTC, LCD Brief:     We are doing this project to controlling lighting, fans etc by using mobile Bluetooth pairing to arm device HC-05 Bluetooth here working automatic particular time it will check the status of lights etc then that will send to mobile phone will you feel turn off or on that operation will be done by requested small commands from mobile. Hardware Used: lpc2129 development board (ARM7), Bluetooth module HC-05, relay, Ac bulb. Software Used: Keil µVision 4, Flash Magic code for the above project //same as 1st prg but simplyfing code we are using funtions                 #include<lpc21xx.h> #include<string.h>  void uart_tx_string(char *str);    void delay(int count) { int i,j; for(i=0;i<count;i++) { ...

Locker Security Sytem Using Humun Detect Sensor and OTP Throuhgt Bluettoth

Locker Security System Using Human Detect Sensor and OTP Through    Bluetooth Protocols :    UART, RTC   Brief:     We are providing locker security system using human detect sensor will detect a particular person will match then it will generate random OTP that send to whatever device connected to locker Bluetooth then whatever received OTP again enter correctly in particular time if any you do not enter or incorrect OTP    locker will not open and again new OTP generated after particular time(1 min). Hardware Used: lpc2129 development board (ARM7), Bluetooth module HC-05, human detect sensor. Software Used: Keil µVision 4, Flash Magic code for the above project                #include<lpc21xx.h> #include<string.h> #include<stdlib.h>    void delay(int count) { int i,j; for(i=0;i<count;i++) { for(j=0;j<3000;j...

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