massivly reduce canbus speed
This commit is contained in:
@@ -241,7 +241,7 @@ async fn main(spawner: Spawner) {
|
|||||||
p.PB9,
|
p.PB9,
|
||||||
CanFifo::Fifo0,
|
CanFifo::Fifo0,
|
||||||
CanMode::Normal,
|
CanMode::Normal,
|
||||||
125_000,
|
20_000,
|
||||||
config,
|
config,
|
||||||
)
|
)
|
||||||
.expect("Valid");
|
.expect("Valid");
|
||||||
|
|||||||
@@ -33,7 +33,13 @@ use measurements::{Current, Voltage};
|
|||||||
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
|
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
|
||||||
|
|
||||||
const MPPT_CURRENT_SHUNT_OHMS: f64 = 0.05_f64;
|
const MPPT_CURRENT_SHUNT_OHMS: f64 = 0.05_f64;
|
||||||
const TWAI_BAUDRATE: twai::BaudRate = twai::BaudRate::B125K;
|
const TWAI_BAUDRATE: twai::BaudRate = twai::BaudRate::Custom(twai::TimingConfig {
|
||||||
|
baud_rate_prescaler: 200, // 40MHz / 200 * 2 = 100 on C6, 100 * 20 = 2000 divisor, 40MHz / 2000 = 20kHz
|
||||||
|
sync_jump_width: 3, // 4 TQ
|
||||||
|
tseg_1: 15,
|
||||||
|
tseg_2: 4,
|
||||||
|
triple_sample: true,
|
||||||
|
});
|
||||||
|
|
||||||
pub enum Charger<'a> {
|
pub enum Charger<'a> {
|
||||||
SolarMpptV1 {
|
SolarMpptV1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user