Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/11/13 08:32
Read: times


 
#189560 - ht 12 decoder interfacing with 89c51
hi
I am trying to read a 4 pin data from ht 12d decoder .
and am giving that data to the first four pins of P1.
the output led and buzzer are interfaced with P2.
the led and buzzer should glow ,when my data read from the decoder is equal to the fixed data which i am programming in the microcontroller.
but how to receive data from the decoder to the controller?????
am writing the code in c lanuage and using it in keil software.
here am attaching my code
so please help me in modification.


#include<reg51.h>
#include<stdio.h>
void delay(unsigned int);
void main()

{
unsigned int readvalue,fixedvalue=0X0F,x,y;
P2=0X00;
P1=0XFF;
while(1)
{
x=P1;
y=x&0X0F;
readvalue=y;
if(readvalue==fixedvalue)
{
P2=0X03;
delay(250);
}

else
P2=0X04;
P2=0X00;
}
}
void delay(unsigned int i)
{
unsigned int j,k;
for(j=0;j<i;j++)
for(k=0;k<=1275;k++);
}


List of 3 messages in thread
TopicAuthorDate
ht 12 decoder interfacing with 89c51            01/01/70 00:00      
   How to...            01/01/70 00:00      
   through driver transistors            01/01/70 00:00      

Back to Subject List