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.

8051 Serial Programming Help Required

Status
Not open for further replies.

saqib.j

Newbie level 3
Joined
Dec 20, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
hi, i'm very new to electronics and microcontrollers. i have to use 8051 for my project that includes sending data to 8051 via PC and control relays. i used serial port, compiled my C code in Keil and burned it on 8051. used hyper terminal to control LEDs and it worked. the problem i'm facing is that i need to send data through a C program i.e. using exe. i tried to compile C code on Visual studio but it did not find reg51.h file. Keil produces .HEX file. how can i get exe file to double click it and read data from file and send it to 8051 serially??? any help please???
 

hi, i'm very new to electronics and microcontrollers. i have to use 8051 for my project that includes sending data to 8051 via PC and control relays. i used serial port, compiled my C code in Keil and burned it on 8051. used hyper terminal to control LEDs and it worked. the problem i'm facing is that i need to send data through a C program i.e. using exe. i tried to compile C code on Visual studio but it did not find reg51.h file. Keil produces .HEX file. how can i get exe file to double click it and read data from file and send it to 8051 serially??? any help please???

Maybe I misunderstood, but you need to compiler two separate programs, one will be the firmware for the 8051 compiler with KEIL and the other an application for windows compiled with Visual Studio. There should not be an reference to a reg51.h header file in any of the source code for the PC side application.

Checkout: **broken link removed**

There are examines of PIC to PC with a Visual Basic and Visual C# .NET application.

BigDog
 

so that means i just need to send data to serial port from my C program and 8051 will receive it as it did from hyper terminal??? and the boad rate etc will be set in the C program???
 

Correct.

The Serial Port parameters such as the BAUD rate with be determined by the firmware of 8051. One issue to consider is sending numerical values between the 8051 and the PC application usually requires the numerical values to be converted to character strings then transmitted.

BigDog
 

thanx :) ill come back if i face any issue :) is there any site where i can get reference C code for PC application??
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top