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.

TWO Questions about microcontrollers

Status
Not open for further replies.

yasirali

Newbie level 6
Joined
Mar 11, 2009
Messages
14
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,396
hi

All ,answer my two questions.....
which thing start executing hex file on tiny devices like microcontroller?
what all happen before main and can we execute our own code before main?
 

Microcontroller or microprocessors are made in such a way that if we give recommended power and minimum circuit its circuit will start reading code from a pre defined locations. and this location can be different for each microcontroller
like 8051 start reading first code from 0000H location. this is called op-code fetch cycle.
hope this will clear your doubt.
 
hi

All ,answer my two questions.....
which thing start executing hex file on tiny devices like microcontroller?

You need to have a programmer that will be used to download the code to the microcontroller. The code resides in the EPROM of controller from where it is fetched, decoded and executed by those tiny devices.... It is the way they are designed to work.

what all happen before main and can we execute our own code before main?

Before the start of main(), there are some initialization, that include, Interrupt vector, Stack preparation and code for initialization of global variables... there can be other extra steps depending your microcontroller.

You can execute your own code before main(). For this change your Startup or init file. For further information, you need to see the documentation of your compiler manufacturer.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top