micro controller hardware need help?

Status
Not open for further replies.

vead

Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Visit site
Activity points
3,815
l I have micro controller 89c51 ,LED,switch,compiler(keil),programmer (flesh magic)
SWITCH is input device connected port pin P0.1
LED is output device connected port pin P1.1

I have written assembly code in keil software for example
Code:
ORG  OH
ON:
SETB P1.1   ; LED IS ON
OFF:
CLRB P1.1    ; LED IS OFF
LOOP:
JB P0.1         ; SWITCH ON
JNB P0.1        ; SWITCH OFF
SJMP LOOP
END

assembler convert this code into machine code
for example
Code:
:10000000743811221142740F112211427406112208
:100010001142748411221142744E112F1142744FF7
:10002000112FF590C2A0C2A1D2A21142C2A222F504
:1000300090D2A0C2A1D2A21142C2A222741811224F
:0B00400080FA7B647CFFDCFEDBFA2210
:00000001FF

this hexa code burn into the memory of controller

1) I don't know where this hexa code burn into the RAM memory or ROM memory ?

2)I don't know this hexa code contain the data or address of data or both data and address?

3)software side ROM memory is use to write code but what is the work of rom memory on hardware

4)software side RAM memory is used to store address of data but what is work of RAM memory on hardware ?

5)micro controller take input from switch how the signal goes in internal circuit of micro controller throw the ALU , CONTROL unit, RAM, ROM , switch , LED, data register, address register, instruction register

simple controller take input and processor perform the task and LED will blink

how this process done ?


I have searched lot of about microcontroller and waste most of time to find out internal circuitry how they work but still I did not get correct logic please anyone help me to working of microcontroller with internal circuit.
 

Program (hex file contents) are stored in ROM memory of chip. RAM is used during program run. There is not RAM and ROM in software. Compiler only compiles the C / ASM code and convert it to hex file. Hex file contains Program data, RAM data, internal eeprom data and config words data. If there are any global variables in the code then space for it is allocated in RAM during run time before main() function is called. RAM will be empty when MCU is off. RAM gets loaded with global variables and their initial values on MCU startup.
 

thanks for interest
signal come from the port , where it goes I mean controller take input from signal , where this signal goes into microcontroller circuitry ?
 

the signal from the input comes to a register which is related to the port. then cpu reads it.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…