Adjust SMBUS timing
This commit is contained in:
@ -1,15 +1,21 @@
|
|||||||
#include <board/smbus.h>
|
#include <board/smbus.h>
|
||||||
|
|
||||||
void smbus_init(void) {
|
void smbus_init(void) {
|
||||||
SMB4P7USL = 0x2F;
|
// 9.2 MHz * 4.7 us = 43.24
|
||||||
SMB4P0USL = 0x5A;
|
SMB4P7USL = 43;
|
||||||
SMB300NS = 0x03;
|
// 9.2 MHz * 4.0 us = 36.8
|
||||||
SMB250NS = 0x30;
|
SMB4P0USL = 37;
|
||||||
SMB25MS = 0x19;
|
// 9.2 MHz * 300 ns = 2.76
|
||||||
SMB45P3USL = 0x5C;
|
SMB300NS = 3;
|
||||||
|
// 9.2 MHz * 250 ns = 2.3
|
||||||
|
SMB250NS = 2;
|
||||||
|
// 1.024 KHz * 25 ms = 25.6
|
||||||
|
SMB25MS = 26;
|
||||||
|
// 9.2 MHz * 45.3 us = 416.76 (0x01A1)
|
||||||
|
SMB45P3USL = 0xA1;
|
||||||
SMB45P3USH = 0x01;
|
SMB45P3USH = 0x01;
|
||||||
|
|
||||||
// Clock to 50 KHz
|
// Clock set to 50 Hz
|
||||||
SCLKTSA = 1;
|
SCLKTSA = 1;
|
||||||
|
|
||||||
// Enable host interface
|
// Enable host interface
|
||||||
|
Reference in New Issue
Block a user