Nano

Here is a summary of the registers available in the Nano microcontroller.

Modules

GPIO

In depth information about the GPIO module can be found here.

GPIOPV (Pin Value Registers)

There are 64 GPIOPV registers, each representing the value of a pin. Only the first 4 are used.

  • Read: Returns the redstone signal strength of the pin.
  • Write: Sets the redstone signal strength of the pin (if it is an output).

Register Table

AddressNameDescriptionRead/Write
0x7000GPIOPV0Pin 0 / Front pinR/W
0x7001GPIOPV1Pin 1 / Right pinR/W
0x7002GPIOPV2Pin 2 / Back pinR/W
0x7003GPIOPV3Pin 3 / Left pinR/W

GPIODIR (Pin Direction Registers)

There are 8 GPIODIR registers, each bit representing the direction of a pin. Only 1 register is used.

  • Read: Returns the value of the register.
  • Write: Sets the value of the register.

Register Table

AddressNameDescriptionRead/Write
0x7040GPIODIR0Pins (0 - 7) directionR/W

GPIODIR0 (N/U - Not Used)

Bit 76543210
N/UN/UN/UN/UPin 3 dirPin 2 dirPin 1 dirPin 0 dir

GPIOINT (Pin Interrupt Type Registers)

There are 32 GPIOINT registers, each nibble representing the interrupt type of a pin. Only the first 4 are used.

  • Read: Returns the value of the register.
  • Write: Sets the value of the register.

Register Table

AddressNameDescriptionRead/Write
0x7048GPIOINT0Pins (0 - 1) interrupt typesR/W
0x7049GPIOINT1Pins (2 - 3) interrupt typesR/W

Interrupt types

ValueNameDescription
0x0NO_INTERRUPTDisable interrupts
0x1LOWTrigger while low
0x2HIGHTrigger while high
0x3RISINGOn rising edge
0x4FALLINGOn falling edge
0x5CHANGEOn digital rise or fall edge
0x6ANALOG_CHANGEOn pin value change
0x7ANALOG_RISINGOn pin value increasing
0x8ANALOG_FALLINGOn pin value decreasing
0x9NO_CHANGETrigger while no change

GPIOINT0 (N/U - Not Used)

Bits 7 - 4Bits 3 - 0
Pin 1 interrupt typePin 0 interrupt type

GPIOINT1 (N/U - Not Used)

Bits 7 - 4Bits 3 - 0
Pin 3 interrupt typePin 2 interrupt type

GPIOIFL (Pin Interrupt Flag Registers)

There are 8 GPIOIFL registers, each bit representing the interrupt flag of a pin. Only 1 register is used. If any flag is set, the IRQ line is held LOW. The flag must be cleared after the interrupt is serviced.

  • Read: Returns the value of the register.
  • Write: Clears bits of the register.

Register Table

AddressNameDescriptionRead/Write
0x7068GPIOIFL0Pins (0 - 7) interrupt flagsR/W

GPIOIFL0 (N/U - Not Used)

Bit 76543210
N/UN/UN/UN/UPin 3 flagPin 2 flagPin 1 flagPin 0 flag

EL (Event Listener)

In depth information about the EL module can be found here.

ELICL (Interrupt Control Buffer)

This module has a buffer of 8 bytes to store interrupt control data. Each bit in this buffer corresponds to an event (not all are used). If the bit is set, the interrupt for that event is enabled. If the bit is cleared, the interrupt for that event is disabled.

  • Read: Returns the value of the register.
  • Write: Sets the value of the register.

Register Table

AddressNameDescriptionRead/Write
0x7100ELICL0Events (0 - 7) interrupt controlR/W

ELICL0 (N/U - Not Used)

Bit 76543210
N/UN/UN/UN/UN/UN/UN/UGame Tick

ELIFL (Interrupt Flags Buffer)

This module has a buffer of 8 bytes to store interrupt flags. Each bit in this buffer corresponds to an event (not all are used). If the bit is set, the interrupt for that event has occurred. If the bit is cleared, the interrupt for that event has not occurred.

  • Read: Returns the value of the register.
  • Write: Clears bits of the register.

Register Table

AddressNameDescriptionRead/Write
0x7108ELIFL0Events (0 - 7) interrupt flagsR/W

ELIFL0 (N/U - Not Used)

Bit 76543210
N/UN/UN/UN/UN/UN/UN/UGame Tick

UART

In depth information about the UART module can be found here.

There are 7 registers in the UART module.

Register Table

AddressNameDescriptionRead/Write
0x7200UARTSTSStatusR
0x7201UARTCTLControlR/W
0x7202UARTCMDCommandR/W
0x7203UARTTXDTransmit DataR/W
0x7204UARTRXDReceive DataR
0x7205UARTTXPTransmit PinR/W
0x7206UARTRXPReceive PinR/W
0x7207UART_InternalR

UARTSTS (Status Register)

The UARTSTS register is used to check the status of the UART module. Here are the list of status flags (N/U means Not Used):

BitFlag
7IRQ
6N/U
5N/U
4TX_BUFFER_EMPTY
3RX_BUFFER_FULL
2OVERRUN_ERROR
1FRAME_ERROR
0PARITY_ERROR

Reading this register will return the status of the UART module and clear the IRQ, OVERRUN_ERROR, FRAME_ERROR, and PARITY_ERROR flags.

Writing to this register will trigger a software reset, which will clear all flags and reset the module's configuration to default.

UARTCTL (Control Register)

The UARTCTL register is used to configure the module's baud rate, word length, and stop bit.

Bit 7Bits 6-4Bits 3-0
STOP_BITS (1 or 2 bits)WRDLEN (1 or 8 bits)BAUD_RATE

Stop Bits

ValueBits
01 stop bit
12 stop bits

Word Length

The word length is the number of bits in a data frame. The word length can be set to 1 or 8 bits. WRDLEN is a 3-bit field, so the resulting number of data bits follows this formula: WRDLEN + 1.

Baud Rate

The baud rate is the number of bits per second that the module can transmit or receive. BAUD_RATE is a 4-bit field, so the resulting baud rate follows this table:

ValueBaud Rate
0x01
0x12
0x25
0x310
0x420
0x550
0x6150
0x7300
0x8600
0x91200
0xA1800
0xB2400
0xC3600
0xD4800
0xE7200
0xF9600

By default, it is set to 1 stop bit, 8 data bits, and a baud rate of 10. This is set every hard/software reset.

UARTCMD (Command Register)

The UARTCMD register is used to configure how the module deals with received and transmitted data. Here are the list of command flags (N/U means Not Used):

BitFlag
7N/U
6TX_PIN_ENABLE
5RX_PIN_ENABLE
4PARITY_TYPE
3PARITY_ENABLE
2ECHO_ENABLE
1TX_INTERRUPT_ENABLE
0RX_INTERRUPT_ENABLE

UARTTXD (Transmit Data Register)

The UARTTXD register is used to write data to the UART module. Writing to this register will transmit the data.

UARTRXD (Receive Data Register)

The UARTRXD register is used to read data from the UART module. Reading this register will return the received data.

UARTTXP (Transmit Pin Register)

The UARTTXP register is used to set the transmit pin. Writing to this register will set the transmit pin.

UARTRXP (Receive Pin Register)

The UARTRXP register is used to set the receive pin. Writing to this register will set the receive pin.

UART_ (Internal Register)

The UART_ register is an internal register that is not meant to be used by the user. Reading from this register will return undisclosed data.