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.

[51] 2 or more codes in keil with 8051

Status
Not open for further replies.

thexplanet

Newbie level 3
Joined
Aug 17, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,312
Hello All,

I am newbie, and learning 8051 with embeeded C,

i have a query to ask,

lets say, i have 3 different programs
1> LCD 16X2
2>ADC 0808 temperature measurement
3>Heart beat monitoring.

now i know they can be written in keil microvision software, but
I am confused, that when normally when we compile+link+obj+hex and burn the microcontroller with one HEX file,
now how to deal with 3 or more different programs.
each program is using different ports of 8051 (0,1,2 and 3)

can anyone pls clear my doubts.
Thanks,
 

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,318
Helped
1,166
Reputation
2,351
Reaction score
1,152
Trophy points
1,403
Location
Brazil
Activity points
54,319
You can load into core only one at a time.


+++
 

thexplanet

Newbie level 3
Joined
Aug 17, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,312
Thanks Andre_teprom,

Sir, which means, i will have to burn the same microcontroller chip, with 3 different HEX files 3 times, and it will function as the program is designed.
my 1st program is for display LCD 16X2 initialize and display, 2nd program is for reading temprature using ADC0808 via LM35, and 3rd is for heart beat using LDR and LED,
so in this case,
first i burn the hex file for 1st,
then burn the 2nd hex file
and then finally 3rd hex file, onto the same microcontroller 8051

is it right, am i interpreting it correctly?
Pls reply,
Thanks
 

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,318
Helped
1,166
Reputation
2,351
Reaction score
1,152
Trophy points
1,403
Location
Brazil
Activity points
54,319
No, unless you compile them into a Real Time embedded OS, just one is allowable to run at a time, due you have just one core inside 8051.


+++
 

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,318
Helped
1,166
Reputation
2,351
Reaction score
1,152
Trophy points
1,403
Location
Brazil
Activity points
54,319
You need have a minimal knowledge about programing on C language to merge each piece on a unique main program.
The feature you are asking for is quite usual to achieve, but requires some time to perform simulations prior to run at core.

In other words, it´s simple, but tiresome.



+++
 

richardlaishram

Member level 4
Joined
Jan 6, 2013
Messages
77
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Location
Planet Earth
Activity points
1,804
From what I can understand is that, you have an LCD code, an ADC code and a Heart Beat Monitoring code which you want to load it as a whole program in the microcontroller, right?
I'm not sure if this is what you wanted: Make a new project, and in that save the LCD and ADC code as LCD.h and ADC.h and make the Heart Beat Monitoring code as the main function. And include the custom header files as shown below.
Code:
#include<reg51.h>
#include"LCD.h" // for custom header files <> cannot be used instead we've to use ""
#include"ADC.h"
Now you can all any functions declared in the ADC or LCD in your main function.
 

thexplanet

Newbie level 3
Joined
Aug 17, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,312
From what I can understand is that, you have an LCD code, an ADC code and a Heart Beat Monitoring code which you want to load it as a whole program in the microcontroller, right?
I'm not sure if this is what you wanted: Make a new project, and in that save the LCD and ADC code as LCD.h and ADC.h and make the Heart Beat Monitoring code as the main function. And include the custom header files as shown below.
Code:
#include<reg51.h>
#include"LCD.h" // for custom header files <> cannot be used instead we've to use ""
#include"ADC.h"
Now you can all any functions declared in the ADC or LCD in your main function.

Thanks richardlaishram :)
Thats Exactly I was looking for.

Thanks Andre_teprom
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top