Skip to content

Timing issue in configuration. #9

@nraynaud

Description

@nraynaud

When using a DMA SPI peripheral, there is no delay between the write and the reads, this leads to some configuration error. The MPU basically never goes into running mode and never sends the interrupt.

I could not pinpoint the exact problem, so I resorted to adding a delay before every write:

    fn write(&mut self, reg: Register, val: u8, spi: &mut SPI) -> Result<(), E> {
        self.ncs.set_low();
        asm::delay(72_000_000 / 100 * 1);
        spi.write(&[reg.write_address(), val])?;
        self.ncs.set_high();
        Ok(())
    }

This happens wether the SPI clock is a 200kHz or at 500kHz.

I am struggling to find which exact timing condition is violated in the datasheet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions