Discussion in "Project Help" started by    akshayylr    Jan 28, 2018.
Sun Jan 28 2018, 04:53 AM
this is my code, this piece gets to work well in software simulation but not on the board.how can i get it working on the board??

#include<reg51.h>
sbit party1=P1^0;
sbit party2=P1^1;
sbit result1=P1^2;
sbit result2=P1^3;
sbit display1=P1^4;
sbit display2=P1^5;
sbit display3=P1^6;
sbit display4=P1^7;
void delay(int max)
{
int i=0,j=0;
for(i=0;i<max;i++)
{
for(j=0;j<12345;j++);
}
}
void main()
{
unsigned int temp1=0,temp2=0,count11=0,count12=0,count13=0,count14=0,count21=0,count22=0,count23=0,count24=0;
int a[]={0x3f,0x06,0x5b,0x4f,0xe6,0xed,0x7d,0x07,0xff,0xef};
while(1)
{
// party1=party2=result1=result2=1;
while(party1==0&&party2==1&&result1==1&&result2==1 )
{
temp1++;
}
while(party2==0&&party1==1&&result1==1&&result2==1 )
{
temp2++;
}
count11=count11+(temp1/temp1);
if(count11==9)
{
count12++;
count11=0;
if(count12==9)
{
count13++;
count12=0;
if(count13==9)
{
count14++;
count13=0;
}
}
}
count21=count21+(temp2/temp2);
if(count21==9)
{
count22++;
count21=0;
if(count22==9)
{
count23++;
count22=0;
if(count23==9)
{
count24++;
count23=0;
}
}
}

temp1=0;
temp2=0;
P2=0X00;
while(result1==0&&party2==1&&party1==1&&result2==1)
{
display1=1;
P2=a[count11];
delay(5);

display2=1;
P2=a[count12];
delay(5);

display3=1;
P2=a[count13];
delay(5);

display4=1;
P2=a[count14];
delay(5);

}
while(result2==0&&party2==1&&party1==1&&result1==1)
{
display1=1;
P2=a[count21];
delay(5);

display2=1;
P2=a[count22];
delay(5);

display3=1;
P2=a[count23];
delay(5);

display4=1;
P2=a[count24];
delay(5);

}
}
}

[ Edited Sun Jan 28 2018, 04:55 AM ]
Wed Jan 31 2018, 08:57 PM
You will have to post your full code and the Proteus file.
Most likely you have a hardware problem, such as a pin not connected.
Thu Feb 01 2018, 09:57 AM

You will have to post your full code and the Proteus file.
Most likely you have a hardware problem, such as a pin not connected.

ExperimenterUK

This is the full program and can I know what are this Proteus file
Thu Feb 01 2018, 06:00 PM
Zip it before posting.

"can I know what are this Proteus file"
I assumed you were using Proteus software for your simulation.
Post what you can of your simulation so we can try to recreate what you are doing.
Again ,zip it before posting.

### Information

#### Conversation

Mon Nov 12 2018, 05:58 AM
Pavan_user
i have seen your replica of I2C programming using AT89C51 but i am unable to understand the "ack_bit" variable usage ...looks like it is always 1...can you elaborate how acknowledgment is working....
Tue Nov 06 2018, 02:36 PM
kindly any one give solution for my problem
Mon Nov 05 2018, 09:48 PM
Pins high is the normal state. You need a program to set them low
Sun Nov 04 2018, 05:41 PM
hello, i am niranjoy, alll the port of my 8051 is always high, even i erase all the program. why is it so happen and what is the problem. any one please help me!
Sun Nov 04 2018, 02:16 PM
BASAVARAJ g kudamble
hi I am interfacing GSM 300 to 8051 microcontroller to receive message from mobile
Sat Sep 29 2018, 06:28 PM
Please post questions in the forum.
Sat Sep 29 2018, 11:26 AM
Ashfaq Ch
hi i have some AT89C51RC microcontrollers already programed. some one help us to how to download from AT89C51RC and after study and edit all corractions reload to AT89C51RC controller
Wed Sep 12 2018, 10:58 PM
hii!! some1 please let me know how i ll get rfid code to 8051 by WEIGAND mode
Tue Sep 11 2018, 08:09 PM
is there anyone here?
Mon Aug 27 2018, 07:30 AM
bun
Hello everyone！

### Recent

atalnet
Fri Nov 16 2018, 07:44 AM
genius784
Wed Nov 14 2018, 09:25 AM
katherineamt
Mon Nov 12 2018, 03:14 PM
wimac
Sun Nov 11 2018, 03:36 PM
suryanspn
Sat Nov 10 2018, 02:52 AM
RubenMarques
Tue Nov 06 2018, 06:35 PM
mayengbam
Sun Nov 04 2018, 05:36 PM
bgk3678
Sun Nov 04 2018, 02:27 PM

#### Online

Guests: 43, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38021

#### Trending Topics

Forum Activity
##### Posted By ExperimenterUK
Mon Nov 19 2018, 01:11 AM
I used your code in a Proteus simulation that can ...
##### Posted By ExperimenterUK
Thu Nov 15 2018, 06:48 PM
Unfortunately I have no experience of LabView,but ...
##### Posted By katherineamt
Mon Nov 12 2018, 03:22 PM
I have never used LabView and I have to implement ...
##### Posted By ExperimenterUK
Mon Nov 12 2018, 01:21 AM
2) In main() the code uses "i1" as the variable in...
##### Posted By wimac
Sun Nov 11 2018, 04:03 PM
I was just passing through looking for something e...
##### Posted By bgk3678
Sun Nov 11 2018, 07:25 AM
sir,Thank you for your response .The bgk GSM i...
##### Posted By ExperimenterUK
Tue Nov 06 2018, 06:10 PM
I got this output in Proteus.What are you expecti...
##### Posted By bgk3678
Sun Nov 04 2018, 02:52 PM
sir ,as I have posted the code ,it is not displa...
##### Posted By bgk3678
Sun Nov 04 2018, 02:48 PM
#include<reg51.h> unsigned int data_out,comman...
##### Posted By Xuenan
Sat Nov 03 2018, 01:08 PM
Make the 8051 frequency exactly 11.0592 MHz in pro...