Understanding Microcontroller Port Signals and Memory Storage: A Question

  • Thread starter Thread starter vead
  • Start date Start date
  • Tags Tags
    Microcontroller
Click For Summary

Discussion Overview

The discussion revolves around understanding how microcontrollers process signals from input ports, execute instructions, and utilize memory (RAM and ROM) during these processes. Participants explore the roles of various components in microcontroller operation, including fetching, decoding, and executing instructions, as well as the interaction between RAM and ROM.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • Some participants question whether the statement about the processor taking signals from switches via input ports and sending signals to motors via output ports is correct.
  • There is uncertainty regarding whether results should be stored in RAM or ROM, with some participants suggesting RAM but expressing doubt.
  • One participant explains that a microcontroller with an 8-bit data bus reads an 8-bit value from input ports and writes to output ports, indicating that the program specifies memory locations for fetching and saving data.
  • Another participant seeks clarification on how RAM is utilized during the fetching, decoding, and executing processes of instructions in a microcontroller.
  • A later reply discusses the timing and control signals involved in RAM operations, emphasizing the need for specific information about the RAM module to provide further assistance.
  • One participant presents a conceptual breakdown of instruction processing, including assembly code and binary representation, but does not receive sufficient feedback to continue.
  • Another participant requests clarification on which specific processor architecture is being discussed to provide more targeted assistance regarding assembly instructions and hardware addressing.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the operation of microcontrollers, with some points of confusion and disagreement about the roles of RAM and ROM, as well as the specifics of instruction processing. The discussion remains unresolved with multiple competing views and questions.

Contextual Notes

Participants reference the need for specific details about the microcontroller and RAM modules being discussed, indicating that the answers may depend on the particular architecture or model in question.

vead
Messages
92
Reaction score
0
I don't understand what does mean of following statement

when user presses switch how does processor know that which port pin is high and which port pin is low

processor take signal from switch via the input port and send processor the signal signal to motor via output port

is this correct statement or not ?

instruction should be fetch, decode and execute and result, should be save into memory

tell me only, is this correct statement or not ?
If yes then result should be store in which memory rom or ram?
I think ram memory but I am not sure
 
Engineering news on Phys.org
vead said:
I don't understand what does mean of following statement
processor take signal from switch via the input port and send processor the signal signal to motor via output port

is this correct statement or not ?
tell me only, is this correct statement or not ?
If yes then result should be store in which memory rom or ram?
I think ram memory but I am not sure

Let's say you are using a microcontroller (uC) that has an 8-bit data bus width. Then each register or port will be 1 byte wide. The uC reads from the address of the input port, and gets an 8-bit value. Each of the bits can represent an input, like from a switch or from a sensor, etc.

When the uC writes to an output port, it writes an 8-bit value, and each of those bits can control some output thing, like light an LED or turn on a motor, etc.

The locations that you fetch information from and save results to are specified by your program. If you are writing in C for example, in the first part of your program you will declare your variables and how big they are, and if you want to force them to be located at some particular location in the memory map (like if you want to do reads and writes from the IO ports, for example, as opposed to some variable that is located somewhere in RAM and you don't care where it is).
 
berkeman said:
Let's say you are using a microcontroller (uC) that has an 8-bit data bus width. Then each register or port will be 1 byte wide. The uC reads from the address of the input port, and gets an 8-bit value. Each of the bits can represent an input, like from a switch or from a sensor, etc.

When the uC writes to an output port, it writes an 8-bit value, and each of those bits can control some output thing, like light an LED or turn on a motor, etc.

The locations that you fetch information from and save results to are specified by your program. If you are writing in C for example, in the first part of your program you will declare your variables and how big they are, and if you want to force them to be located at some particular location in the memory map (like if you want to do reads and writes from the IO ports, for example, as opposed to some variable that is located somewhere in RAM and you don't care where it is).


mcro controller contain mainly ALU, control unit ROM , RAM, PORT

Processor take information from ROM, RAM, Input port

fetching - decoder take command from rom memory

decode - decoder decode instruction and tell the cpu what to do like add, sub

execution- alu do the operation like add, sub.. and sand the result into rom memory

we have fetched , decoded and executed instruction but where does we use ram memory
 
It looks like you have been doing some reading about uCs, which is good! :smile:

Can you point us to what you've been reading? That would make it easier to answer your questions about that reading.
 
berkeman said:
It looks like you have been doing some reading about uCs, which is good! :smile:

Can you point us to what you've been reading? That would make it easier to answer your questions about that reading.

yes you are correct I am reading about ram memory , BUT I don't understand how does ram work when instructions fetch, decode, and execute

I just want to ask when does ram work?
when micro controller do work

fetching - decoder take command from rom memory

decode - decoder decode instruction and tell the cpu what to do like add, sub

execution- alu do the operation like add, sub.. and sand the result into rom memory

we have fetched , decoded and executed instruction but where does we use ram memory
there may be done three process
fetching, decode and executing

during all process when does ram work?
 
vead said:
yes you are correct I am reading about ram memory , BUT I don't understand how does ram work when instructions fetch, decode, and execute

I just want to ask when does ram work?
when micro controller do work

fetching - decoder take command from rom memory

decode - decoder decode instruction and tell the cpu what to do like add, sub

execution- alu do the operation like add, sub.. and sand the result into rom memory

we have fetched , decoded and executed instruction but where does we use ram memory
there may be done three process
fetching, decode and executing

during all process when does ram work?

You did not answer my question by posting a link to your reading. Do you understand that it would be *much* easier to answer your question if you gave us a pointer to what you are reading?
 
berkeman said:
You did not answer my question by posting a link to your reading. Do you understand that it would be *much* easier to answer your question if you gave us a pointer to what you are reading?
I have given answer look at my previous post
I am reading about ram memory
I don't understand how does ram work when instruction fetch, decode and execute
 
First off all instructions are timed with a processor clock, when a Ram address is decoded via a decoder addressing circuit. Upon a chip enable instruction, via the CPU clock several signals are generated within a specific timing. the chip enable, the decoded Ram address, which is both a row and column address scheme. then data is written to the specified address location.

whether the RAM reads or writes is also controlled via one or two pins

If you look at a Ram chip and download the data sheet for that chip, it will provide the required signals and timing. Examine also the pin-out scheme. Ram cannot run by itself you need to look at the full circuit necessary to control a RAM module. As well as research the specific signals and timing. The specifics depend on the RAM module itself, so without further information from you we cannot help you further. IE we need to know your reference material

edit forgot to mention each RAM memory bit is essentially a flip flop circuit, you can google that
 
Last edited:
  • #10
everyone say start with basics so I am trying to understand in this way

Instruction + register +address +data ; statement for my understanding (idea)
mov + A + ? +02 ; assembly code ; statement for assembler (assembler)
01 + 10 + 01 + 01 ; binary digit ; statement for controller
off on + on off +off on +of on ; transistor on off
0,5v +5v ,0v +0v , 5v +0v 5v ; voltage level

can anyone help me In this way
 
  • #11
I'm sorry but the above doesn't give me enough to assist you. Which processor are you working on, Intel, PICO, Motorolla. If your looking for the assembly instructions and the hexadecimal conversions, with the correct OP codes we need to know this. We also won't be able to describe how the instructions work with the hardware addressing, such as the ALU addressing of the microprocessor to memory module location without knowing which system your working with
 
  • #12
Mordred said:
I'm sorry but the above doesn't give me enough to assist you. Which processor are you working on, Intel, PICO, Motorolla. If your looking for the assembly instructions and the hexadecimal conversions, with the correct OP codes we need to know this. We also won't be able to describe how the instructions work with the hardware addressing, such as the ALU addressing of the microprocessor to memory module location without knowing which system your working with

Thanks for reply I am talking about 8051
 
  • #13
Now we can work with you, unfortunately I never worked on the 8051, however finding the information is easy enough.

here is the 8051 architecture

http://www.mikroe.com/chapters/view/65/chapter-2-8051-microcontroller-architecture/


here is your much needed manual it has coverage of the architecture, with programming examples including memory.

http://cse.iitkgp.ac.in/~soumya/embcs/the-8051-microcontroller-0314772782.pdf

those will answer your questions, just work through the pdf file if you have further questions include the manual in your related posts, so others can look through it and help you with specific sections
 
Last edited by a moderator:

Similar threads

  • · Replies 14 ·
Replies
14
Views
5K
Replies
37
Views
7K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
4
Views
3K
Replies
6
Views
4K
Replies
1
Views
10K
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 17 ·
Replies
17
Views
4K