massivly reduce canbus speed

This commit is contained in:
2026-03-31 18:24:23 +02:00
parent 7121dd0fae
commit f1dadd7e6e
2 changed files with 8 additions and 2 deletions

View File

@@ -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");

View File

@@ -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 {