Skip to content

Netronix MSP430 embedded controller

Jonathan Neuschäfer edited this page Nov 8, 2021 · 29 revisions

In older board designs, such as the Kobo Aura (N514/E606F0B), Netronix uses an MSP430 as an embedded controller (EC) which handles several features including poweron/poweroff of the i.MX SoC. The MSP430 is connected via I²C and responds to address 0x43.

There are two register layouts. The new one is detected by the NEWMSP macro, which checks if the version number is 0xe916. This file documents the old layout.

Known versions

version number found in device features used other remarks
d726 Kobo Aura Power, RTC, PWM Reading the version register appears to be enough to keep the power on
e916 unknown unknown uses the new register layout
f110 Tolino Shine 2 HD PWM I2C messages aren't ACKed

Interrupts

Interrupts are signaled through a GPIO line in falling edge mode.

Command structure

For a register read:

For a register write:

  • write one byte, the register address
  • write two bytes, the register value (also a BE u16 in the original driver)

Even though the driver treats all register accesses as 16 bits wide, only the upper (first) byte is used in many cases. This is the case when this file speaks of 8-bit registers or values.

Reading registers that should be written unfortunately gives bogus results in most cases.

Registers

0x00: Version number

When read as a big-endian u16, this register provides the version number of the EC. A value of 0xe916 indicates the new register layout, which is not described in this document.

0x10-0x15: RTC time (write access)

The time is set by writing 8-bit values into the high bytes of the following registers:

Register Description
0x10 year, zero means 2000
0x11 month, one-based
0x12 day of the month, one-based
0x13 hour, zero-based
0x14 minute, zero-based
0x15 second, zero-based

0x16-0x18: auto power on

Register Type Description
0x16 u8 hour
0x17 u8 minute
0x18 u8 set to 0x01 in msp430_auto_power

0x1b-0x1c: RTC alarm

Register Type Description
0x1b u8 alarm offset in seconds, high byte
0x1c u8 alarm offset in seconds, low byte

0x20-0x23: RTC time (read access)

Register High byte Low byte
0x20 year; zero means 2000 month, one-based
0x21 day of the month, one-based hour, zero-based
0x23 minute, zero-based second, zero-based

0x30: ADC?

0x41: Battery status

This 16-bit register contains the battery voltage, in the range 0-1023.

TODO: provide conversion formula

0x50: Poweroff(?)

0x60: interrupt/wakeup status

This 16-bit register contains different bits that indicate which interrupts have occurred. It can be read and written.

Bit value description
0x0001 Battery is critically low
0x0002 only used in dead code
0x0008 On board E606F0B (Kobo Aura), this bit indicates that the battery is charging (or discharging?)
0x0020 Battery is critically low (in Tolino Shine source code)
0x8000 Alarm triggered

0x70: Powerkeep

0x90: Reset

0xa1-0xa7: PWM

On some versions, two PWM outputs are supported (intended for white and red light).

Register Type Description
0xa1 u8 auto-off timer, high part. set to 0xff when disabling front light auto-off timer
0xa2 u8 auto-off timer, low part. set to 0xff when disabling front light auto-off timer
0xa3 u8 0x01: enable PWM, 0x00: disable PWM; 0x02: enable second PWM
0xa4 u8 period (8MHz/frequency), low byte
0xa5 u8 period (8MHz/frequency), high byte
0xa6 u8 duty cycle, low byte
0xa7 u8 duty cycle, high byte
0xa8 u8 duty cycle of second output, low byte (on boards where FL_PWM=4)
0xa9 u8 duty cycle of second output, high byte

The high bytes should be written first. Changes in period or duty cycle take effect after the low byte is written.

The period and duty cycle can be written in an interleaved fashion (period high, duty cycle high, period low, duty cycle low; tested on firmware version d726).

PWM state can't be read back.

Failure modes

  • Writing a duty cycle of 0 sometimes gets the device into a weird state where writing a higher duty cycle doesn't get a PWM-connected LED back to full brightness.

  • Sometimes disabling and re-enabling the PWM output (via register 0xa3), without reconfiguring period/duty cycle, results in a blinking pattern (at around 2-10 Hz).

  • Disabling/enabling the PWM output multiples times in quick succession seems to upset the EC quite badly, to the point where system reset might not work properly anymore. The EC driver used on the Kobo Aura sleeps after enabling PWM output.