Skip to content

Please check SPI_MODE1 and SPI_MODE2 - they appear to be swapped #379

@PaulZC

Description

@PaulZC

Hi gang,
I'm testing some existing SPI code on v2.0.6 of the core. It uses SPI_MODE1 (CPOL=0 and CPHA=1) and is failing... I can see on the 'scope that CPOL is 1, not 0.
If I use SPI_MODE2 instead, it works.
I suspect modes 1 and 2 are swapped?
Looking at am_hal_iom.h, the mode ordering (0,2,1,3) matches the ordering of the SPHA and SPOL bits in the IOM.MSPICFG register.
I'm wondering if we need to swap modes 1 and 2 when using the modes as defined in HardwareSPI.h?
Thanks,
Paul

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions