lpc-rs / lpc-pac

Peripheral Access Crates for LPC microcontrollers
9 stars 9 forks source link

MRT registers have wrong bit range for timer value #18

Closed hannobraun closed 5 years ago

hannobraun commented 5 years ago

Original issue: https://github.com/lpc-rs/lpc82x-pac/issues/16


The MRT timer has a resolution of 31 bits, but the following registers only specify a width of of 24 bits:

  1. INTVAL (IVALUE field)
  2. TIMER (VALUE field)

This needs to be fixed by patching the SVD file, as it causes incorrect behavior. The timer value is truncated when reading to or writing from these fields. To remind me to add that patch, I'm not adding the "upstream" tag until that has been done.

A workaround for this is to bypass the field API by reading/writing the bits directly using the bits method on the register (not the ones in the field API).


I've reported this issue to NXP: https://community.nxp.com/thread/465465