Skip to content

R7FA4M1AB.h GTCR_b.TPCS definition is off by one bit #531

@Skidlz

Description

@Skidlz

The "Timer Prescaler Select" portion of GTCR should be 3 bits [26..24] per the datasheet, but the header file says that it's 4 bits [26..23]:

https://github.com/arduino/ArduinoCore-renesas/blob/00910fde8314e299a737f617a2c7cbd727b3a545/variants/MINIMA/includes/ra/fsp/src/bsp/cmsis/Device/RENESAS/Include/R7FA4M1AB.h#L5219

            __IOM uint32_t TPCS : 4;   /*!< [26..23] Timer Prescaler Select                                           */

Compare to the RA4M1 group datasheet (page 417).

I did some testing and found that the prescaler works as expected if you shift the value to the left by one bit, and that the value written to b23 cannot be read back. More detail in this forum thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions