Aug 16, 2010 #1 J 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
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
Aug 16, 2010 #2 M millwood Advanced Member level 3 Joined Jul 2, 2009 Messages 733 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().
Aug 17, 2010 #3 J 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(). Click to expand... To millwood how to do?
millwood said: because you don't understand how the compiler deals with a return from the main(). Click to expand... To millwood how to do?
Aug 17, 2010 #4 H hock Advanced Member level 2 Joined May 28, 2001 Messages 524 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); } }
Aug 17, 2010 #5 J 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); } } Click to expand... Even if while(1) {} isn't used, the program is failed in endless loop.
hock said: Main() { while(1) { P1=0x55; // P1 is connected to LEDs. delay(30); P1=0xaa; delay(30); } } Click to expand... Even if while(1) {} isn't used, the program is failed in endless loop.
Aug 17, 2010 #6 M millwood Advanced Member level 3 Joined Jul 2, 2009 Messages 733 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. Click to expand... because you don't understand how the compiler deals with a return from the main().
Even if while(1) {} isn't used, the program is failed in endless loop. Click to expand... because you don't understand how the compiler deals with a return from the main().
Aug 18, 2010 #7 J 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. Click to expand... because you don't understand how the compiler deals with a return from the main(). Click to expand... Can you tell me what I can do? I'm really appreciated. The detailed situation is shown in attached.
millwood said: Even if while(1) {} isn't used, the program is failed in endless loop. Click to expand... because you don't understand how the compiler deals with a return from the main(). Click to expand... Can you tell me what I can do? I'm really appreciated. The detailed situation is shown in attached.