thannara123
Advanced Member level 5
Hello experts ,
I am interfacing 89s52 with 74HC595 shift register .
please help me what is the error the following code written Keil
#include <REGX51.H>
#include<delay.h.>
unsigned char gk,gireesh = 0x18;
unsigned int i;
void main()
{
P0 = 0x00;
P2 = 0x00;
P1 =0x00;
while(1)
{
P1_3 =0; // ST_Cp
delay(10);
P1_3 =1; // ST_cp
for (gk = 0x80; gk; gk>>=1)
{
P1_0 = 1; // SH_CP
delay(10);
P1_0 = 0; // Sh_CP
if (gireesh&gk)
{
P1_2 = 1; // Data
}
else
{
P1_2 = 0; // Data
} }
}
for(i=0; i<9; i++)
{
P2 = (1<<i); // data for scaing
delay(100);
} }
​
I am interfacing 89s52 with 74HC595 shift register .
please help me what is the error the following code written Keil
#include <REGX51.H>
#include<delay.h.>
unsigned char gk,gireesh = 0x18;
unsigned int i;
void main()
{
P0 = 0x00;
P2 = 0x00;
P1 =0x00;
while(1)
{
P1_3 =0; // ST_Cp
delay(10);
P1_3 =1; // ST_cp
for (gk = 0x80; gk; gk>>=1)
{
P1_0 = 1; // SH_CP
delay(10);
P1_0 = 0; // Sh_CP
if (gireesh&gk)
{
P1_2 = 1; // Data
}
else
{
P1_2 = 0; // Data
} }
}
for(i=0; i<9; i++)
{
P2 = (1<<i); // data for scaing
delay(100);
} }
​