Skip to content

Commit 1dffab8

Browse files
Tweak bus setup time.
The BMC is happier if we give it a bit longer to process the chip select interrupt.
1 parent fd746e7 commit 1dffab8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,12 @@ impl Hardware {
370370
/// MCP23S17 CS pin disable time (between transactions). At least 50ns, we give 100ns.
371371
const CS_IO_DISABLE_CPU_CLOCKS: u32 = 100 / Self::NS_PER_CLOCK_CYCLE;
372372

373-
/// Give the device 2us (2 clocks @ 1 MHz) to get ready.
374-
const CS_BUS_SETUP_CPU_CLOCKS: u32 = 2000 / Self::NS_PER_CLOCK_CYCLE;
373+
/// Give the device 10us to get ready.
374+
///
375+
/// This seems to reduce the error rate on the BMC link to an acceptable level.
376+
const CS_BUS_SETUP_CPU_CLOCKS: u32 = 10_000 / Self::NS_PER_CLOCK_CYCLE;
375377

376-
/// Give the device 2us (2 clocks @ 1 MHz) before we take away CS.
378+
/// Give the device 2000ns before we take away CS.
377379
const CS_BUS_HOLD_CPU_CLOCKS: u32 = 2000 / Self::NS_PER_CLOCK_CYCLE;
378380

379381
/// Give the device 10us when we do a retry.

0 commit comments

Comments
 (0)