Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Hardware connections for MMIO


Hi,

I am just learning Embedded, For IO i can connect to IO Ports,
OR I can use Memory Mapped I/O. I don't know how to connect IO to Processor
And what are Hardware Registers, I have seen only some theoretical explanation on this. Can any one give me detailed explanation this please.

Thanks in advance..

Comments

  • IDKIDK Posts: 1,784Member
    :
    : Hi,
    :
    : I am just learning Embedded, For IO i can connect to IO Ports,
    : OR I can use Memory Mapped I/O. I don't know how to connect IO to Processor
    : And what are Hardware Registers, I have seen only some theoretical explanation on this. Can any one give me detailed explanation this please.
    :
    : Thanks in advance..
    :

    Hardware registers are like registers in the proccessor, but not in the proccessor, isntead it's in the hardware...

    This is how you interface it in C code (I think):
    [code]
    char*a = 100; //point to address 100
    in(10, *a); //read from port 10 and put it in *a;
    out(11, *a); //put it back at port 11
    [/code]

    Don't use the code, it'll probbably crash your comp...

    In asm I think the instructions are called in and out.

    Happy coding wishes
    the one and only
    [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • NareshgenieNareshgenie Posts: 3Member
    : :
    : : Hi,
    : :
    : : I am just learning Embedded, For IO i can connect to IO Ports,
    : : OR I can use Memory Mapped I/O. I don't know how to connect IO to Processor
    : : And what are Hardware Registers, I have seen only some theoretical explanation on this. Can any one give me detailed explanation this please.
    : :
    : : Thanks in advance..
    : :
    :
    : Hardware registers are like registers in the proccessor, but not in the proccessor, isntead it's in the hardware...
    :
    : This is how you interface it in C code (I think):
    : [code]
    : char*a = 100; //point to address 100
    : in(10, *a); //read from port 10 and put it in *a;
    : out(11, *a); //put it back at port 11
    : [/code]
    :
    : Don't use the code, it'll probbably crash your comp...
    :
    : In asm I think the instructions are called in and out.
    :
    : Happy coding wishes
    : the one and only
    : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :
    :
    OK,How would be the connections, i mean
    for IO port connections we connect to any Port of processors,
    For Memory mapped IO where should we connect our peripheral.
    And Do we need to initialize any registers of Processors...
  • IDKIDK Posts: 1,784Member
    : : :
    : : : Hi,
    : : :
    : : : I am just learning Embedded, For IO i can connect to IO Ports,
    : : : OR I can use Memory Mapped I/O. I don't know how to connect IO to Processor
    : : : And what are Hardware Registers, I have seen only some theoretical explanation on this. Can any one give me detailed explanation this please.
    : : :
    : : : Thanks in advance..
    : : :
    : :
    : : Hardware registers are like registers in the proccessor, but not in the proccessor, isntead it's in the hardware...
    : :
    : : This is how you interface it in C code (I think):
    : : [code]
    : : char*a = 100; //point to address 100
    : : in(10, *a); //read from port 10 and put it in *a;
    : : out(11, *a); //put it back at port 11
    : : [/code]
    : :
    : : Don't use the code, it'll probbably crash your comp...
    : :
    : : In asm I think the instructions are called in and out.
    : :
    : : Happy coding wishes
    : : the one and only
    : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : :
    : :
    : OK,How would be the connections, i mean
    : for IO port connections we connect to any Port of processors,
    : For Memory mapped IO where should we connect our peripheral.
    : And Do we need to initialize any registers of Processors...
    :

    Register initialition is hardware dependent, and oould be doen with drivers.

    The physical connection for a io port is different from a memmory mapped io.

    They theoreticly use separate buses.

    " Physically, the I/O address bus is the same as the memory address bus, but additional control lines determine whether the address on the bus is accessing memory or and I/O device. "

    I got the above qoute from a site I got from a quick google search:
    http://webster.cs.ucr.edu/AoA/Windows/HTML/IO.html
  • LundinLundin Posts: 3,711Member
    : : : :
    : : : : Hi,
    : : : :
    : : : : I am just learning Embedded, For IO i can connect to IO Ports,
    : : : : OR I can use Memory Mapped I/O. I don't know how to connect IO to Processor
    : : : : And what are Hardware Registers, I have seen only some theoretical explanation on this. Can any one give me detailed explanation this please.
    : : : :
    : : : : Thanks in advance..
    : : : :
    : : :
    : : : Hardware registers are like registers in the proccessor, but not in the proccessor, isntead it's in the hardware...
    : : :
    : : : This is how you interface it in C code (I think):
    : : : [code]
    : : : char*a = 100; //point to address 100
    : : : in(10, *a); //read from port 10 and put it in *a;
    : : : out(11, *a); //put it back at port 11
    : : : [/code]
    : : :
    : : : Don't use the code, it'll probbably crash your comp...
    : : :
    : : : In asm I think the instructions are called in and out.
    : : :
    : : : Happy coding wishes
    : : : the one and only
    : : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : :
    : : :
    : : OK,How would be the connections, i mean
    : : for IO port connections we connect to any Port of processors,
    : : For Memory mapped IO where should we connect our peripheral.
    : : And Do we need to initialize any registers of Processors...
    : :
    :
    : Register initialition is hardware dependent, and oould be doen with drivers.
    :
    : The physical connection for a io port is different from a memmory mapped io.
    :
    : They theoreticly use separate buses.
    :
    : " Physically, the I/O address bus is the same as the memory address bus, but additional control lines determine whether the address on the bus is accessing memory or and I/O device. "
    :
    : I got the above qoute from a site I got from a quick google search:
    : http://webster.cs.ucr.edu/AoA/Windows/HTML/IO.html
    :


    MMIO is just yet another fancy word you don't need to learn, all modern processors I can think of use it. A hardware register is typically the interface between the CPU and the hardware, which is usually implemented as a RAM cell mapped at a specific address on the bus.

    The common ANSI C way of accessing hardware registers is as follows:

    [code]#define MYREG (*(unsigned char*)0x1234)

    ...

    /* use the register just as a variable */
    MYREG = something;
    something = MYREG;[/code]

  • NareshgenieNareshgenie Posts: 3Member
    : : : :
    : : : : Hi,
    : : : :
    : : : : I am just learning Embedded, For IO i can connect to IO Ports,
    : : : : OR I can use Memory Mapped I/O. I don't know how to connect IO to Processor
    : : : : And what are Hardware Registers, I have seen only some theoretical explanation on this. Can any one give me detailed explanation this please.
    : : : :
    : : : : Thanks in advance..
    : : : :
    : : :
    : : : Hardware registers are like registers in the proccessor, but not in the proccessor, isntead it's in the hardware...
    : : :
    : : : This is how you interface it in C code (I think):
    : : : [code]
    : : : char*a = 100; //point to address 100
    : : : in(10, *a); //read from port 10 and put it in *a;
    : : : out(11, *a); //put it back at port 11
    : : : [/code]
    : : :
    : : : Don't use the code, it'll probbably crash your comp...
    : : :
    : : : In asm I think the instructions are called in and out.
    : : :
    : : : Happy coding wishes
    : : : the one and only
    : : : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : :
    : : :
    : : OK,How would be the connections, i mean
    : : for IO port connections we connect to any Port of processors,
    : : For Memory mapped IO where should we connect our peripheral.
    : : And Do we need to initialize any registers of Processors...
    : :
    :
    : Register initialition is hardware dependent, and oould be doen with drivers.
    :
    : The physical connection for a io port is different from a memmory mapped io.
    :
    : They theoreticly use separate buses.
    :
    : " Physically, the I/O address bus is the same as the memory address bus, but additional control lines determine whether the address on the bus is accessing memory or and I/O device. "
    :
    : I got the above qoute from a site I got from a quick google search:
    : http://webster.cs.ucr.edu/AoA/Windows/HTML/IO.html
    :

    Thank you very much, You have given me such a good material. I gotto know something, Till now i was thinking some thing else about this, now i came to know the clear cut picture of MMIO And Port I/O.

    Once again Thank you very much.

Sign In or Register to comment.