Hardware

Head devices

The nine chips on the head's I2C bus, their addresses, what one bus cycle sends, and the LoLA quirks nao-rs keeps on the wire.

On the NAO6, LoLA (not HAL) drives the head. Its devices sit behind a USB-I2C bridge in the head, which Linux exposes as an I2C bus; udev links it as /dev/i2c-head (it is /dev/i2c-9 on our robot). nao-rs drives the same nine chips with the same bytes, one transaction per cycle.

The chips

Address (7-bit)Address (8-bit)ChipRole
0x660xCCTLC59116Eye LEDs, blue
0x640xC8TLC59116Eye LEDs, green
0x620xC4TLC59116Eye LEDs, red
0x610xC2TLC59116Left ear LEDs
0x600xC0TLC59116Right ear LEDs
0x650xCATLC59116Skull LEDs
0x280x50CAP1203The three head touch pads
0x400x80INA230Head power monitor: voltage, current, power
0x480x90TMP100Face board temperature

The LED drivers' channel mapping is on the LEDs page.

Start-up

The devices are created in the order of the table. Each LED driver starts with its register image only, without bus traffic. The touch controller, the power monitor and the temperature sensor get their register settings in 2-byte writes, one transfer each. The start-up takes about 70 ms, most of it the touch controller's calibration.

One bus cycle

One cycle is one I2C_RDWR transfer with 16 messages, or 18 when the temperature is due:

DeviceMessages
6 LED driversOne 30-byte write each: the auto-increment register byte, then all 29 registers from MODE1 to IREF. Only the PWM bytes change
Touch controllerRead the sensor input status (1 byte), then write 0 to the main control register, which clears the latched status
Power monitorThree register reads (bus voltage, power, current), then the configuration write
Temperature sensorOne read, when more than 300 ms have passed since the last one (about every 20th to 25th cycle)

A transfer takes about 6 ms on the bus (5.8 ms measured with nao-rs). The state a cycle returns is decoded from the previous transfer, as in LoLA. After a failed transfer, the next transfers are split into smaller ones for a while.

LED current

Each LED driver's output current comes from its IREF register:

ChipCurrentIREF
Eyes (3 chips)5 mA0x30
Ears (2 chips)12 mA0xF3
Skull6 mA0x22

LoLA quirks kept on the wire

nao-rs sends what LoLA sends, including two mistakes, because changing bytes the chips have always received is a change we'd have to test separately:

  • The power monitor's reset value is written in the wrong byte order, so the chip receives 0x0080 and is never reset.
  • Its configuration word shifts the averaging and conversion-time fields by 11, 8 and 5 bits instead of the data sheet's 9, 6 and 3. The robot receives 0x1487.

Touch pads

The touch controller reports three channels. The runtime's state lists them as front, middle and rear (touch indices 1, 2 and 3), which are the controller's channels 2, 1 and 0. A touch reads 1, no touch 0. All three at once trip the death switch. The physical order still needs one touch of each pad to confirm.

Checked live

naoctl head on the robot: eyes cycling red, green and blue (seen by eye), 24.8 V, 10.7 W, 43 to 47 °C, 5.8 ms per transfer.

On this page