Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why MC8051 IP core failed in Endless loop?

Status
Not open for further replies.

junxiu6

Newbie level 4
Joined
Jan 9, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
MC8051 IP core is used in spartan3e, software is ISE 11.1. While running a program like fllowing, the LEDs wink all the time.

Code:
Main() {
        P1=0x55;   // P1 is connected to LEDs.
        delay(30);
        P1=0xaa;
        delay(30); 
	}

Does mc8051 go to the first place and do it again?

What’s the problem?

Thanks for your reply.

Junsoo
 

millwood

Advanced Member level 3
Joined
Jul 2, 2009
Messages
734
Helped
80
Reputation
164
Reaction score
35
Trophy points
1,308
Activity points
5,088
because you don't understand how the compiler deals with a return from the main().
 

junxiu6

Newbie level 4
Joined
Jan 9, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
millwood said:
because you don't understand how the compiler deals with a return from the main().

To millwood

how to do?
 

hock

Advanced Member level 2
Joined
May 28, 2001
Messages
525
Helped
47
Reputation
94
Reaction score
21
Trophy points
1,298
Location
India
Activity points
3,567
Main()
{
while(1)
{
P1=0x55; // P1 is connected to LEDs.
delay(30);
P1=0xaa;
delay(30);
}
}
 

junxiu6

Newbie level 4
Joined
Jan 9, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
hock said:
Main()
{
while(1)
{
P1=0x55; // P1 is connected to LEDs.
delay(30);
P1=0xaa;
delay(30);
}
}

Even if while(1) {} isn't used, the program is failed in endless loop.
 

millwood

Advanced Member level 3
Joined
Jul 2, 2009
Messages
734
Helped
80
Reputation
164
Reaction score
35
Trophy points
1,308
Activity points
5,088
Even if while(1) {} isn't used, the program is failed in endless loop.


because you don't understand how the compiler deals with a return from the main().
 

junxiu6

Newbie level 4
Joined
Jan 9, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
millwood said:
Even if while(1) {} isn't used, the program is failed in endless loop.


because you don't understand how the compiler deals with a return from the main().

Can you tell me what I can do? I'm really appreciated.

The detailed situation is shown in attached.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top