1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Question on microcontroller

  1. Apr 1, 2014 #1
    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
     
  2. jcsd
  3. Apr 1, 2014 #2

    berkeman

    User Avatar

    Staff: Mentor

    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).
     
  4. Apr 1, 2014 #3

    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
     
  5. Apr 1, 2014 #4

    berkeman

    User Avatar

    Staff: Mentor

    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.
     
  6. Apr 1, 2014 #5
    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?
     
  7. Apr 1, 2014 #6

    berkeman

    User Avatar

    Staff: Mentor

    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?
     
  8. Apr 1, 2014 #7

    berkeman

    User Avatar

    Staff: Mentor

  9. Apr 2, 2014 #8
    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
     
  10. Apr 18, 2014 #9
    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: Apr 18, 2014
  11. Apr 26, 2014 #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
     
  12. Apr 26, 2014 #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
     
  13. Apr 26, 2014 #12
    Thanks for reply I am talking about 8051
     
  14. Apr 26, 2014 #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 [Broken]

    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: May 6, 2017
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Question on microcontroller
Loading...