Registers

    In a nutshell, it just writes to some special memory regions. Go into the 07-registers directoryand let’s run the starter code statement by statement.

    What’s this magic?

    This particular register controls General Purpose Input/Output (GPIO) pins (GPIO is aperipheral) and can be used to drive each of those pins low or high.

    Drive? Pin? Low? High?

    Luckily for us, the microcontroller’s pins are connected to the LEDs with the right polarity. Allthat we have to do is output some non-zero voltage through the pin to turn the LED on. The pinsattached to the LEDs are configured as digital outputs and can only output two different voltagelevels: “low”, 0 Volts, or “high”, 3 Volts. A “high” (voltage) level will turn the LED on whereasa “low” (voltage) level will turn it off.


    OK. But how can one find out what this register does? Time to RTRM (Read the Reference Manual)!