Continue to Site

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.

Newbie on C programming with 8051

Status
Not open for further replies.

PA80

Newbie level 1
Joined
Jul 31, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Denmark
Activity points
1,289
8051 c programming

Hi

I am new in C programming, but have done a lot of 8051 assembler programming before.

I am using SDCC as compiler.

I am trying to make a "Hello world" program.... with difficulties!

Take a look:

#include <8051.h>

void pause()
{
unsigned int x;
for(x=0; x<33000; x++);
}

main() {

for(;;)
{
P3_6=0;
pause();
P3_6=1;
pause();
}
}
.....

I have a LED connected to P3.6 on my board and the LED is constantly off when the program is running.

Why is it not flashing?

Peter

Added after 53 minutes:

Well.... the problem is solved! The LED is flashing.

That port on my development board was used to another funkcion that that was blocking the state.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top