I'm aware that memory mapped addresses that point to registers are sometimes used to control hardware devices. Is that the only way they're controlled? I started asking about how software talks to hardware and most people told me about using registers and memory addresses to talk to devices. Is that the only way software and hardware interact? Thanks!
most people told me about using registers and memory addresses to talk to devices
Shortly, that is the correct answer - if you are interested how software will (ultimately) talk to hardware. How hardware can have an impact on software, things get a lot more complicated.
If you want to understand deeply how things happen, you should study how micro-controllers are implemented. Studying the famous 8051 is a very good start, and there are countless books and articles about it. You will have the chance to understand timers, interrupts, ports, buses...
No. You are talking about memory-mapped I/O. It means that the CPU see the hardware as if it would be some like a memory module.
All the robots have these three components:
- a controlling mechanism. It means a collection of chips.
- sensors (to know the world around them).
- and motors (or, more generally, end-effectors. For example, a robot capable to heat its arms has a non-mechanical end-effector).
(1) gets the data from the sensors (2), and using the collected data, says to (3) what to do.
All the chips have a set of pins. They can send voltage to them, or they can read the voltage on them send by others. The sensors and the end-effectors use electronical (or physical, chemical, anything) means to convert between the voltage on the pins and the external world. This might be quite complex, for example until the $\mu A$, 5V current becomes a regulated 3-phase, 50Hz, 380V current on a large industry robot, the steps are not trivial.
But this all is not important. The only important thing is that the CPU has to communicate somehow with the other chips/devices of the robot, and the only question is, how do we call the pins and what type of pins are on which the communication is going on.
A simple way, with some disadvantages, if the CPU see the hardware, as if it would be a memory block. If you write a data to a specific memory address, you send data to a device.
Another possibility is to have dedicated pins for I/O, it is the port-mapped I/O.
Mainly large mainframes had also specific I/O coprocessors, i.e. mediating chips only for I/O tasks.