Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

ThisisGoogle'scacheofhttp://www.justexecuteit.com/interfacinga7segmentdisplayandkeypadwithatmega16/.

Itisasnapshotofthe
pageasitappearedon19Nov201519:39:32GMT.
Thecurrentpagecouldhavechangedinthemeantime.Learnmore
Fullversion

Textonlyversion

Viewsource

Tip:Toquicklyfindyoursearchtermonthispage,pressCtrl+ForF(Mac)andusethefindbar.

Facebook

Twitter

YouTube

GooglePlus

Searchfor:
WhatyouwannaExecute?

Search

Skiptocontent
HOME
8051
AVR
BASICELECTRONICS
TECHTREND
CREATIVECORNER
PRODUCT
ARM7LPC2148
ARDUINOUNOR3
8051&AVRDEVELOPMENTBOARD
8051DEVELOPMENTBOARD
8051&AVRPROGRAMMERPRO
8051&AVRPROGRAMMERBASIC
CONTACTUS
ABOUT

AVRInterfacinga7SegmentDisplayandKeypadwithAtmega16

MoreRelatedPost

Interfacinga7SegmentDisplay
andKeypadwithAtmega16

8051interfacingwithRTC

Circuit
Code
8051interfacingwithRTC
8051Interfacingwith
LCD,EEPROM,KEYPAD

8051Interfacingwith
LCD,EEPROM,KEYPAD

8051interfacingwithEEPROM

8051interfacingwithEEPROM
InterfaceLDRusingADC0808to
8051

InterfaceLDRusingADC0808to8051
ElectronicLock

ElectronicLock
LCDBasedVotingMachineUsing
8051
#include<avr\io.h>
//Mostbasicinclude
files
1 #include<avr\io.h>//Mostbasicincludefiles
2 #include<avr\interrupt.h>//Addthenecessaryones
3 #include<avr\signal.h>//here
4
5 //Defineheretheglobalstaticvariables
6 //
7 intMy_global;
8
9 //InterrupthandlerexampleforINT0
10 //
11 SIGNAL(SIG_INTERRUPT0){
12
13 }
14
15 //Itisrecommendedtousethiscodingstyleto
16 //followbetterthemixedCassemblycodeinthe
17 //ProgramMemorywindow
18 //
19 voidmy_function(void){//Puttheopenbrace'{'here
20
21 asm("nop");//Inlineassemblyexample
22 }
23
24 //***********************************************************
25 //Mainprogram
26 //
27 intmain(void){
28 DDRC=0X00;
29 PORTC=0XFF;
30 DDRD=0XFF;
31 PORTD=0XFE;
32 DDRA=0XFF;
33 PORTA=0X0F;
34
35 while(1){//Infiniteloop;defineherethe
36

LCDBasedVotingMachineUsing8051

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

switch(PORTD)
{
case0XFE:PORTD=0XFD;
break;
case0XFD:PORTD=0XFB;
break;
case0XFB:PORTD=0XF7;
break;
case0XF7:PORTD=0XFE;
break;
}
if(PINC!=255)
{
switch(PINC)
{
case254:
switch(PORTD)
{
case0XFE:PORTA=0X01;
break;
case0XFD:PORTA=0X04;
break;
case0XFB:PORTA=0X07;
break;
case0XF7:PORTA=0X0A;
break;
}//switchend
break;
case253:
switch(PORTD)
{
case0XFE:PORTA=0X02;
break;
case0XFD:PORTA=0X05;
break;
case0XFB:PORTA=0X08;
break;
case0XF7:PORTA=0X00;
break;
}//switchend
break;
case251:
switch(PORTD){
case0XFE:PORTA=0X03;
break;
case0XFD:PORTA=0X06;
break;
case0XFB:PORTA=0X09;
break;
case0XF7:PORTA=0X0B;
break;
}//switchend
break;
}
}

PWMusingAVRAtmega8
InterfacingofDCMotorsusingDrierIC
Facebook Twitter YouTube GooglePlus
PRIVACYPOLICY
TERMSOFUSE
ABOUT

CONTACTUS

You might also like