Record



Comments



Description

SEVEN SEGMENT LED USING 8051 DIGITICKXAIM: To understand the basic formality of LED interface with 8051 using Digitickx. DESCRIPTION: LED displays are packages of many LEDs arranged in a pattern, the most familiar pattern being the 7-segment displays for showing numbers (digits 0-9). PROCEDURE:  Open Digiticx 1.0 program development environment.  Create a new project  Project Name : Any Name  Tool kit: Microc 8051->8052  Debugger: Digitickx 51-> C Debugger  Right Click on Project Files-> Settings-> General->  Debug with: Digitickx 51 C loader  Debug: Digitickx 51 C Debug  Linker: asm  Output: hex  Write a program, save the program, compile the program, Build the program and Download. PROGRAM: #include <8051io.h> #include <8051bit.h> #include <8051reg.h> #include "led.h" main() { delay(100); serinit(SBR_19200); while(1) { SendBuffer(ONE,SEVEN,EIGHT,THREE); delay(1000); SendBuffer(TWO,ONE,ZERO,SEVEN); delay(1000); } while(1); } RESULT: Thus the program was executed and the output was verified using Digitickx. . and easier on the eyes. lightweight. LCDs are more energy efficient and offer safer disposal than CRTs. save the program. aircraft cockpit displays. watches. compile the program. clock. It is an electronically-modulated optical device made up of any number of pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector to produce images in colour or monochrome. less expensive. portable. They are common in consumer devices such as video players. LCDs have displaced cathode ray tube (CRT) displays in most applications. Its low electrical power consumption enables it to be used in batterypowered electronic equipment. and telephones. instrument panels.They are used in a wide range of applications including: computer monitors. etc. They are usually more compact. Build the program and Download. DESCRIPTION: A liquid crystal display (LCD) is a thin. calculators. more reliable.LCD INTERFACE USING 8051 DIGITICKX AIM: To understand the basic formality of LCD interfaces using 8051 Digitickx. television. flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). PROCEDURE:  Open Digiticx 1.0 program development environment.  Create a new project  Project Name : Any Name  Tool kit: Microc 8051->8052  Debugger: Digitickx 51-> C Debugger  Right Click on Project Files-> Settings-> General->  Debug with: Digitickx 51 C loader  Debug: Digitickx 51 C Debug  Linker: asm  Output: hex  Write a program. gaming devices. signage. LCs do not emit light directly. They are available in a wider range of screen sizes than CRT and plasma displays. and since they do not use phosphors. they cannot suffer image burn-in. /* Declare the necessary functions */ void WriteData( unsigned char value ).1 /*READ=SET & WRITE=RESET*/ #define STROBE P0. void WriteCommon( unsigned char value ). void WriteCtrl( unsigned char value ). } WriteData(t[k]).h> #include <8051bit.h> /* Bit set/clear macros */ #include <8051reg.h> #define READ P0. /* Write the message character wise */ k++.0 //#define PRINT(str) (unsigned char t[]=str) void InitLCD(). while(t[k]) { if(k==20) { WriteCtrl(12).PROGRAM: #include <8051io. void CursorHome(). WriteCtrl(0). } delay(2000). static int k. /* Write to control word */ delay(1). /* Move to next line */ delay(1). CursorHome(). void CursorSet( unsigned char pos ).2 /*DATA STROBE (ENABLE)*/ #define CTRL P0. k=0.} void InitLCD() { . InitLCD(). main() { static unsigned char t[]="WELCOME TO “ TIFAC – CORE” . delay(10). delay(10). delay(10). WriteCtrl(0). WriteCtrl(2). WriteCtrl(0)./* Wait a bit after power-up */ delay(200). WriteCtrl(3). WriteCtrl(2). delay(100). delay(10). WriteCtrl(8). WriteCtrl(0). WriteCtrl(4). WriteCtrl(3). WriteCtrl(0). WriteCtrl(3). delay(10). delay(10). WriteCtrl(1). delay(10).} void CursorSet( unsigned char pos ) { WriteCtrl(8). delay(10). delay(10). delay(10). delay(10).*/ WriteCtrl(0). delay(10). delay(10). WriteCtrl(12). WriteCtrl(8). delay(100). delay(50). WriteCtrl(2). . value = value & 0x0F. value = value << 4. } void WriteCommon( unsigned char value ) { clrbit(READ). } void CursorHome() { WriteCtrl(0). WriteCommon( value ). delay(1). setbit(STROBE). P0 = P0 & 0x0F. WriteCommon( value >> 4 ). P0 = P0 | value. } void WriteCtrl( unsigned char value ) { clrbit(CTRL). } . WriteCtrl(2).delay(1). delay(1). } void WriteData( unsigned char value ) { setbit(CTRL). clrbit(STROBE). delay(1). delay(1). WriteCommon( value ). setbit(READ). delay(1). WriteCtrl(pos). RESULT: Thus the program was executed and the output was verified using 8051 Digitickx. . a row and column make a connect. In such systems it is the function of programs stored in the EPROM of microcontroller to scan the keys continuously. therefore. DESCRIPTION: Keypads are organized in a matrix of rows and columns. Build the program and Download. and present it to the motherboard. an 8*8 matrix of keys can be connected to a microprocessor. there is no connection between row and column. The CPU accesses both rows and column through ports. and several ports all on a single chip) takes care of software and hardware interfacing of keyboard.0 program development environment.  Create a new project  Project Name : Any Name  Tool kit: Microc 8051->8052  Debugger: Digitickx 51-> C Debugger  Right Click on Project Files-> Settings-> General->  Debug with: Digitickx 51 C loader  Debug: Digitickx 51 C Debug  Linker: asm  Output: hex  Write a program. a single microcontroller (consisting of microprocessor.KEYPAD INTERFACE USING 8051 DIGITICKX AIM: To understand the basic formality of keypad interface with 8051 using Digitickx. . save the program. RAM and EPROM. compile the program. In IBM PC keyboards. otherwise. with two 8-bit ports. In this section we look at the mechanism by which the 8051 scans and identifies the key. When a key pressed. identify which one has been activated. PROCEDURE:  Open Digiticx 1. 0xe3.'5'. void led(). unsigned int e.0xe6.0xf6. 'C'.0xb3.0xfe }.2 /*DATA STROBE (ENABLE)*/ /* General I/O definitions */ /* Bit set/clear macros */ /* 8051 register definitions */ #define CTRL P0.'*'. int row=0.0xd4.h> #include "led.0xfd.0xf5.'0'.h> #include <8051reg.c. // for keypad data static char table[4][4]={'D'. /* Store .0xb6.0x34.0 x63.f.'9'.1 /*READ=SET & WRITE=RESET*/ #define STROBE P0.0xf7. message to be displayed */ int k.column.'3'. 'B'.'6'. unsigned int i.PROGRAM: #include <8051io.h" #define READ P0. static unsigned char t[50]="jenni muthu deepa".'1' }. static unsigned char r1[5]={ 0xf7.'7'.h> #include <8051bit.'2'.0xe7. 'A'.'4'.0xc7.0x14.'#'.d.0xfb.'8'. 0xe1}.0x97.0 /*CONTROL BIT (CONTROL=RESET & DATA=SET)*/ //for 7 segment data charnum[]={0x77. void WriteData( unsigned char value ). row=0. main() { serinit(9600). while(1) { led(). i++. void keypad(). void WriteCommon( unsigned char value ). keypad(). void lcd( ). lcd(). void CursorHome(). i=0.void display(unsigned int value). if(i==9) { i=0. void WriteCtrl( unsigned char value ). void CursorSet( unsigned char pos ). void InitLCD(). } } } . val=val/10. while(t[k]) { if(k==24) { . val=val/10. SendBuffer(num[d].num[c]. f=val%10. delay(1). /* Set the location of cursor at first position*/ k=0. } void lcd() { InitLCD().void led() { display(i). d=val%10.num[e]). c=val%10. /* Initialize the LCD */ CursorHome().num[f]. } void display(unsigned int val) { e=val%10. val=val/10. } void InitLCD() { /* Wait a bit after power-up */ delay(20). } delay(500). WriteCtrl(3). delay(1). delay(10). /* Initialize the LCD to 4-bit mode */ WriteCtrl(3). delay(10). delay(1). . delay(10).WriteCtrl(12). /* Write the message character wise */ k++. delay(50). WriteCtrl(3). /*DISPLAY OFF*/ WriteCtrl(0). WriteCtrl(0). WriteCtrl(2). delay(10). } /* Write to control word */ /* Move to next line */ WriteData(t[k]). WriteCtrl(8). WriteCtrl(12). . WriteCtrl(4). /*clear screen*/ WriteCtrl(0). delay(10). WriteCtrl(2). delay(10). /*cursor at home*/ WriteCtrl(0). delay(10). /*entry mode*/ WriteCtrl(0). WriteCtrl(1). delay(10).delay(10). delay(10). delay(1). delay(10). /*display ON*/ WriteCtrl(0). delay(10). delay(10). WriteCtrl(pos). } void CursorSet( unsigned char pos ) { WriteCtrl(8). } void WriteCtrl( unsigned char value ) { clrbit(CTRL). P0 = P0 & 0x0F. value = value << 4. WriteCtrl(2). } void WriteData( unsigned char value ) { setbit(CTRL). WriteCommon( value ). WriteCommon( value >> 4 ). P0 = P0 | value. delay(1).delay(1). delay(1). WriteCommon( value ). } void WriteCommon( unsigned char value ) { clrbit(READ). . } void CursorHome() { WriteCtrl(0). value = value & 0x0F. setbit( READ). if((P2 & 0xf0) != 0xf0) { if((P2 & 0xf0)==0x70) { printf("key no %c\n". WriteData(table[row][0]). t[k]=table[row][0]. } void keypad() { k=0. k++. SendBuffer(num[d]. t[k]='\0'. InitLCD(). P2=0xf0. clrbit(STROBE). delay(500).num[e]). CursorHome(). P2=r1[row].table[row][0]). display(table[row][0]-48). delay(1).num[f]. . delay(20).num[c].setbit(STROBE). delay(1). num[e]). SendBuffer(num[d].num[c]. k++. WriteData(table[row][1]). InitLCD(). WriteData(table[row][2]).delay(3). CursorHome().table[row][1]).num[c].num[f]. delay(500). InitLCD(). delay(500). } else if((P2 & 0xf0)==0xb0) { printf("key no %c\n". display(table[row][2]-48).num[f]. } else if((P2 & 0xf0)==0xd0) { printf("key no %c\n". t[k]=table[row][1]. . SendBuffer(num[d]. t[k]=table[row][2].table[row][2]). delay(3). display(table[row][1]-48). t[k]='\0'. k++.num[e]). SendBuffer(num[d]. InitLCD(). if(row==4)row=0. } else if((P2 & 0xf0)==0xe0) { printf("key no %c\n". CursorHome(). } RESULT: Thus the program was executed and the output was verified using Digitickx. delay(3). .num[c].t[k]='\0'.num[e]). k++. delay(500). delay(3). t[k]='\0'. display(table[row][3]-48). } } row++.table[row][3]).num[f]. t[k]=table[row][3]. WriteData(table[row][3]). TRAFFIC LIGHT INTERFACE USING 8051 DIGITICKX AIM: To understand the basic formality of traffic light with 8051 using digitickx.Right Click on Project Files-> Settings-> General->  Debug with: Digitickx 51 C loader  Debug: Digitickx 51 C Debug  Linker: asm  Output: hex . and Yellow LED’s. and reset circuit. Microcontroller and IC’s requires 5V regulated power supply. which is obtained from 230V AC by using step down transformer .0 program development environment. In order to do all the activities a program (sequence of instruction) must be written for the microcontroller. hence drivers are used. The purpose of microcontroller is to switch on the signal lamps with proper timing and to read the timer on/off switch and to dip switches for pass time delay. Led show the status of operation. In order to execute the program. Green. clock. filter and regulators. PROCEDURE: 1. Create a new project  Project Name : Any Name  Tool kit: Micro c 8051->8052  Debugger: Digitickx 51-> C Debugger 3. rectifier. This program is called firmware. 2. Open Digiticx 1. By configuring jumpers. the pass time delay can be changed. Microcontroller requires basic configuration like 5V regulated power supply. DESCRIPTION: Signal lamp consists of cluster of Red. These lamps requires current of 60mA which microcontroller doesn’t capable to deliver this current. south_side(). P3=0x00. east_side(). void east_side(void). void main(void) { while(1) { portinitialize().Write a program. } } void portinitialize(void) { P1=0x20. void south_side(void). .h> void portinitialize(void). void north_side(void). void west_side(void). Build the program and Download PROGRAM: #include <8051io.h> #include <8051reg.4.h> #include <8051bit. north_side(). west_side(). save the program. compile the program. . delay(5000). portinitialize(). P3=0xD2. P3=0x70. P3=0xE0.} void south_side(void) { P1=0x22. delay(5000). portinitialize(). P3=0x70. } void north_side(void) { P1=0x31. portinitialize(). P3=0x78. } void west_side(void) { P1=0xA8. portinitialize(). P3=0xD0. delay(10000). delay(10000). P3=0xE0. P3=0xE1. delay(5000). portinitialize(). delay(5000). P3=0xB4. P3=0xD0. portinitialize(). } . P3=0xB0. } void east_side(void) { P1=0x64. portinitialize(). P3=0xB0. portinitialize(). delay(10000).delay(10000). .RESULT: Thus the program was executed and the output was verified using Digitickx. step motors. Open IAR workbench MSP 430 2.Switch Selection:4th PIN .STEPPER MOTOR USING MSP 430 AIM: To understand the basic formality of stepper motor with 8051 using MSP430. The lower nibble of 8051 is used to generate excitation signals in the proper sequence. Debug-> Go 10. Create new folder and save the corresponding file name (Desktop Folder) 4. C+ main) 3. Inherent in this concept is open loop control. with each revolution requiring a given number of pulses. Go to Project-> Create new project (ASM+. Go to project-> Rebuild all -> Download and debug 9. 5. or step sequence. PROCEDURE: 1. Right click of your project-> Option-> General-> Device selection-> MSP 430 2xx-> 20143 and debugger-> FET Debugger 7. Select-> Ok 8. Motor can be rotated in steps by giving proper excitation sequence to these windings. Each pulse equals one rotary increment. 6. which is only a portion of one complete rotation. DESCRIPTION: Stepper motors are electrical motor that are driven by digital pulse rather than a continuously applied voltage. Display the IAR main and delete the previous file. Program copied and pasted it and then save it. wherein a train of pulses translates. unsigned char data[]={0x01. P2SEL=0X00. int i.j++).i++) { P1OUT=data[i].j.h" #include<stdio. } void DELAY1 (int k ) { /*do { int j.0x04.i<4. */ } RESULT: Thus the program was executed and the output was verified using MSP430. DELAY(2). for(j=0. void main(void) { WDTCTL = WDTPW + WDTHOLD. . k--. P1DIR =0XFF.PROGRAM: #include "msp430x20x3. }while(k!=0).j<1000.h> void DELAY ().0x08}. do { for(i=0.k++) for(j=0.j<1400. } void DELAY (unsigned int d ) { unsigned int k. } }while(1).0x02.k<d.j++). for(k=0. PID logic. The principle is opto-coupler senses the speed of the motor in the form of TTL pulses. The output of the F/V converter voltage is fed to an inbuilt 12-bit ADC of cygnal microcontroller. Microcontroller is applied for PID control action to correct error in the form of voltage to the motor through built-in 12-bit D/A converter. The present study discusses the design. Software is developed in 'C' language using Si-Lab IDE C-cross compiler. Go to Project-> Create new project (ASM+. DESCRIPTION: Embedded based DC motor speed control system using cygnal microcontroller (C8051F020) has been designed and developed. Go to project-> Rebuild all -> Download and debug 9. C+ main) 3. Create new folder and save the corresponding file name (Desktop Folder) 4. It is based on frequency domain technique. The paper deals with the hardware and software details. Select-> Ok 8. Debug-> Go 10. Right click of your project-> Option-> General-> Device selection-> MSP 430 2xx-> 20143 and debugger-> FET Debugger 7. Open IAR workbench MSP 430 2. Keyword: Speed control. Display the IAR main and delete the previous file. Copyright © 2010 IFSA. 5. PWM circuit. which is given to F/V (frequency to voltage) converter. The converted digital value applied in Liner equitation for converting back to frequency and speed is displayed on two lines LCD in RPM.DC MOTOR USING MSP 430 AIM: To understand the basic formality of DC motor with 8051 using MSP430. and analysis of cygnal microcontroller based PID logic controller for DC motor speed control systems. 6. development. fabrication. Frequency to voltage converter PROCEDURE: 1.Switch Selection: DC Motor 5th Pin . Program copied and pasted it and then save it. and actuator. for(j=delay.h> void delay(unsigned int).j>0. P1OUT=~P1OUT. WDTCTL = WDTPW + WDTHOLD. P1DIR =0xff.j. int main() { int i=0xff.i++).PROGRAM: /* INTERFACING THE DC MOTOR TO MSP430 DIP SWITCH # 5 ON */ #include<msp430x20x3. for(i=0. } } void delay(unsigned int delay) { unsigned int i.i<200.j--). P1OUT = i. . while(1) { delay(1000). } RESULT: Thus the program was executed and the output was verified using MSP430.
Copyright © 2024 DOKUMEN.SITE Inc.