free-pdk / pdk-includes

Device Include files for Padauk MCUs
GNU General Public License v2.0
10 stars 8 forks source link

Discrepency with PFS154 fuses versus current datasheet #16

Closed basilhussain closed 10 months ago

basilhussain commented 10 months ago

There seems to be a discrepancy regarding what fuses are supported by the PFS154 between current information on the Free-PDK website, device headers, and currently published datasheet by Padauk.

The website asserts that the PFS154 does not support LVR fuse settings (instead using MISCLVR register), and the pfs154.h device header correspondingly does not include definitions for the LVR fuses. However, according to the datasheet available from Padauk (dated Mar 23, 2023) the PFS154 does feature LVR fuses.

pfs154-fuses

The datasheet also contains no mention of a MISCLVR register.

Is the Free-PDK information incorrect, or has Padauk changed the PFS154?

serisman commented 10 months ago

The Free-PDK information is correct.

The Padauk datasheet is misleading and incomplete. The 'Code Options' table from the datasheet does not correspond 1:1 to a device's fuse-able options.

The real source of truth is actually the PFS154.INC file from the Padauk_Tool. In this file you will see 3 lines that start with .Assembly OPTION [x] inside the .Assembly ASM_INSTR section. These are the actual fuse-able options, where [x] is the start bit of the option. The .Assembly OPTION_VIRTUAL and .Assembly OPTION_MISC2 lines are not part of the fuse-able options, but are configured elsewhere in the MISC, MISC2 and/or MISC_LVR registers found further down in the .INC file.

serisman commented 10 months ago

Here's the relevant (cleaned-up) sections from the PFS154.INC file:

.Assembly   ASM_INSTR   SYM_85A
    .Assembly   OPTION_VIRTUAL:4    LVR 4.0V    3.5V    3.0V    2.75V   2.5V    1.8V    2.2V    2.0V
    .Assembly   OPTION_VIRTUAL  LCD2    Disable PB0_A034
    .Assembly   OPTION  0   Security    Enable  Disable
    .Assembly   OPTION  8   Drive   Low Normal
    .Assembly   OPTION  10  Bootup_Time Slow    X   X   Fast
    .Assembly   OPTION_MISC2        5   Comparator_Edge     All_Edge    Rising_Edge     Falling_Edge
    .Assembly   OPTION_MISC2_SKIP   4   INTRQ_7 TM3 PWMG2
    .Assembly   OPTION_MISC2_SKIP   3   INTRQ_4 COMP PWMG1
    .Assembly   OPTION_LOW  1, 9, 14 ~ 15
    .Assembly   OPTION_DEFAULT  0x3DFD
    .Assembly   OTHER_HIGH

...

    MISC        IO_WO       0x08
        $ 5 :   X, Fast_Wake_Up         //    2048 ILRC / 32 ILRC : IC
        $ 4 :   X, LCD_Enable
        $ 2 :   X, LVR_Disable
        $ 1 ~ 0 :   WT_T32 | WDT_8K, WT_T64 | WDT_16K, WT_T256 | WDT_64K, WT_T1K | WDT_256K

    MISC2       IO_WO:OP        0x0F (0x2B, 0x66)
        $ 6 ~ 5 :   Both, Rising, Falling
        $ 4 :   TM3, PWMG2
        $ 3 :   COMP, PWMG1

    MISC_LVR        IO_WO:OP    0x1B
        $ 7 ~ 5 :   4V, 3V5, 3V, 2V75, 2V5, 1V8, 2V2, 2V
basilhussain commented 10 months ago

I see, thanks. Not very helpful for the datasheet to describe only how things are presented by the manufacturer development tools, instead of how the chip actually works.

And I was hoping to have a common code base shared between PMS150G and PFS154, without any #ifdef. A foolish aspiration! 😄