Kia Niro BMS

woleg
Posts: 50
Joined: Thu May 05, 2022 6:09 pm
Has thanked: 14 times
Been thanked: 11 times

Re: Kia Niro BMS

Post by woleg »

Here's what the preamble should look like on both MAX17841 TX -> MAX17845 RX (up) and MAX17845 TX -> MAX17841 RX (down) pairs.

Image
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

Today I could work again on the BMS and found the following problems,

I found the problem that my MAX17841B nothing sends and today I can't even read the registers from it. So the chip is broken :( .
While there is nothing on the TX- and RX lines I still have a sinus wave on TX 1.25V and RX 440mV after my transformers (SM91502ALE). Even when all cables are disconnected. Haven't figured it out yet what is causing it.

Should have started looking at the RX and TX pins on the MAX chip on the board for activity :| .

Image: TX, RX
Attachments
TX_BMS.jpg
RX_BMS.jpg
User avatar
manny
Posts: 164
Joined: Sun Jan 23, 2022 4:15 pm
Location: Netherlands
Has thanked: 38 times
Been thanked: 125 times

Re: Kia Niro BMS

Post by manny »

On the scope you see mains frequency.

Did you connector the probe tip TXUP an the ground clip to the TXUN. If you measure after the transformers.

If you measure before the transformers you can connect the ground clip to the board GND
[DRIVING] Citroen Saxo electrique
  • Volvo ERAD motor, XC90 inverter/DCDC (custom OI board)
  • PSA battery (50kWh)
  • Foccci and MG ZS charger 6.6kW
  • Zombie VCU
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

Thankyou Manny,

The probe clip didn't make good contact with GND. I measured it again where the clip was on the board GND and put the probe to RXP, RXN, TXP and TXN and all were stable zero's.

Today i'm getting a freshly Arduino since the one I used didn't make good contact unless there was a lot of solder. I have a back-up PCB with everything assembled and only used it for reading register of the MAX17841B chip on the PCB, so I think that one is still good. Hopefully I can get things working this time. I will keep you guys updated!
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

So these are the signals coming from my TX pins.

When connected with cables with one module and the loopback at the end of the cables, I get the scope from the first image. It is in that image under the 0 line, but keeps alternating under and above the 0 line.

The second scope is from the pins before the transformer and the third scope is the pins after the transformers. Cables not connected.

Connected the GND clip of the probe to GND on the board and put the probe on the TX pins. I don't think this is the right signal. Still no data from the module.

How do I get the right signal? Woleg signals looks completely different than mine.

I uploaded the BMS_test_OI.ino code to the Arduino.
Attachments
20251118_120552.jpg
20251118_114455.jpg
20251118_113846.jpg
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

When connected with cables with one module and the loopback at the end of the cables.
How does your signal on the RX-pins look?
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

These are my scopes on RX.

The first image is the scope I have from the RX line. This was also jumping up and down, so I checked what was going on and found that the signal was in a sinewave with mains frequency.
Attachments
20251118_150308.jpg
20251118_150404.jpg
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

And still same result in SW?

So the output signal is about 1Vp-p and the returning signal is about 50mVp-p so not much of a signal returning.
To measure this correctly one should use a differential probe but they are expensive.

The best one can do with a single ended probe is:
Connect only a probe to one channel on the scope.
Remove any connection on the scope between PE and gnd, if possible?
Connect probe to TXP. Connect ground clip to TXN. Check signal amplitude.
Move probe and clip to RXLP/RXLN of first slave and check amplitude.
Then move to TXUP/TXUN of first slave and check amplitude.
RXUP/RXUN, amplitude?
TXLP/TXLN, amplitude?
RXP/RXN, amplitude?

With TXP/TXN/RXP/RXN I mean on the slave side of the transformer.
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

Can't remove connection on the scope between PE and GND.

Here are my scopes:
Image 1 (BMS): Connected GND clip of probe to TXN and probe on TXP after transformers on my BMS. Max ampl. +4V and -3.5V

Image 2 (slave side): Couldn't connect GND clip of probe to the wire. I used math function and did CH1 (RXP) - CH2 (RXN). That is the purple line you see on the scope with scale on 2V. Max ampl. 4V

Image 3 (slave side): Same problem of image 2. I used math function and did CH1 (TXP) - CH2 (TXN). This time purple line (math function) with scale on 200mV. Max ampl. 0V

These scopes are with the whole setup connected and same result in SW with errorByte 6.
Attachments
TXP_TXN_wCables_BMS.jpg
RXP_RXN_wCables_slaveside_m2V.jpg
TXP_TXN_wCables_slaveside_m200mV.jpg
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

Whats your conclusion from those measurements?
To me it seem like there is a wiring or HW problem. The signal should return (RXP/RXN) to the MAX17841 with close to equal amplitude as it was sent (TXP/TXN).
User avatar
manny
Posts: 164
Joined: Sun Jan 23, 2022 4:15 pm
Location: Netherlands
Has thanked: 38 times
Been thanked: 125 times

Re: Kia Niro BMS

Post by manny »

So just to check I'm understanding.

The TX signals from the master look good and get to the first module.

But there is no signal on the RX to the master?

Can you check with a multi meter that there is continuity between:
  • Green and White
  • Yellow and Brown
At the connector for the first module?
20251111_170232.jpg
So that it matches with this picture of the end of the original wiring-loom.

Image

Another check:
With the module connected the TX of the module should be on the white and brown wire's

And a stupid question is the module not completely dead? like at 0V?
[DRIVING] Citroen Saxo electrique
  • Volvo ERAD motor, XC90 inverter/DCDC (custom OI board)
  • PSA battery (50kWh)
  • Foccci and MG ZS charger 6.6kW
  • Zombie VCU
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

I checked every wire and connection. Also did a recheck on the pinouts and my wiring according to the CMC device document linked earlier. With the pinouts I have from that document, I wired everything correctly. And from my understanding TXP and RXP connect together and TXN and RXN connect together. I also think it is hardware/ wiring problem. I know it isn't probably a big problem, but it is one that is causing the whole system to not work. :roll:
It is not the code because other people have used the codes posted here and it worked.
And the pack came from a crashed E-208. But all the modules were fine apart from one that I don't use. The module I test with is at 21.9V and in perfect condition. I don't know if the system bricks itself if it detects it is in a crash like a pyrofuse, but I don't think the MAX even has a command for that.
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

Indeed no signal from the slave to the master. I don't know the module pinouts. I know the pinout from the connector that connects with the module. I based my pinout on that from the CMC document. Also I did read something about the wiring harness that was wired wrong from the factory. Could be the case here?

There is continuity between green and white and yellow and brown

My pinout:
Grey - TXLP
Red - TXLN
Orange - RXLP
Pink - RXLN
Attachments
20251119_141705.jpg
20251119_141245.jpg
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

System2.png
Refering to picture above. If I understand correctly your measurements are taken at 1, 2 and 4?
Signal is good at 1 and 2 but not good at 4.
What does the signal look like at 3?

Another test idea.
What if you disconnect the slave module and loop the connector i.e connecting RXLN to TXUN, RXLP to TXUP, RXUN to TXLN and RXUP to TXLP. Totally bypassing the slave and then measure signal quality at RXN and RXP at BMS on slave side of transformer. This way you also should have continuity from TXP to RXP and also TXN to RXN at BMS on slave side of transformer.
This way you can verify the total wiring chain.
User avatar
manny
Posts: 164
Joined: Sun Jan 23, 2022 4:15 pm
Location: Netherlands
Has thanked: 38 times
Been thanked: 125 times

Re: Kia Niro BMS

Post by manny »

zuuus wrote: Wed Nov 19, 2025 1:25 pm Also I did read something about the wiring harness that was wired wrong from the factory. Could be the case here?
That is just the twisted pair not being right. Not a big problem.
There is continuity between green and white and yellow and brown
That's good.
20231109_181421.jpg
This is from my testing days. Looks the same.

Is there a short on the Rx on the master?
[DRIVING] Citroen Saxo electrique
  • Volvo ERAD motor, XC90 inverter/DCDC (custom OI board)
  • PSA battery (50kWh)
  • Foccci and MG ZS charger 6.6kW
  • Zombie VCU
User avatar
tom91
Posts: 2753
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 264 times
Been thanked: 717 times

Re: Kia Niro BMS

Post by tom91 »

Scope your SPI and capture it so it can be reviewed. I have reviewed it quite a bit when porting the code to work on the STM32 with the 208E battery modules.

SPI data will show you where things fail.
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

I found something interesting to me. When connecting the loopback I see "transmitQueue WD timeout" when I disconnect loopback "transmitQueue WD timeout" disappears. So that means I see "transmitQueue WD timeout" loopback is working?

There is no short on RX. See image 1.

Image 2: TXN to RXN on the loopback
Image 3: TXP to RXP on the loopback

Im going to connect TXN and RXN, TXP and RXP directly on the BMS and see what happends. I will try to scope my SPI MOSI, MISO and SCK and post it

I also found out that my oscilloscope has a dirty GND and that's why im seeing a 50Hz frequency in my signals, so I don't know how reliable the scopes are that I made.
Attachments
20251119_171637.jpg
TXN_to_RXN_3.jpg
RXP_to_TXP_3.jpg
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

Ok, I'm a bit confused...? I think, I might have missed something here?
From the begining in your serial output you got "UARTSlaveDevicesWakeUp WD timeout" directly after "Daisy chain init" which tells me the slave communication is not working properly and all other faults are irrelevant. That's why I have been so focused on the HW side of things.

Please provide a Serial print out of you current setup.
The first 100 lines or so is enough to start with.
Also provide the SW you are running.

If you don't have this error it is more likely SW or setup error.

EDIT:
Yes, I'm sorry but I have misunderstood my one code... :(

EDIT2:
No, I have not, disregard "EDIT".
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

When connecting on BMS TXP to RXP and TXN to RXN, I also see "transmitQueue WD timeout" in serial monitor. This is with the code already running and then connecting the pins. And keeps looping

Code: Select all

transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
When the pins are already connected I see in serial monitor errorByte 1 wich means initError. And this keeps looping.

Scopes SPI:
Image 1: SCK
Image 2: MISO
Image 3 to 6: MOSI

Scopes BMS connector TX and RX pins:
Image 7: TXN to RXN
Image 8: TXP to RXP
Attachments
SCK.jpg
MISO.jpg
MOSI_5us.jpg
MOSI_5us2.jpg
MOSI_1us.jpg
MOSI_1us2.jpg
TXN_to_RXN_BMS.jpg
TXP_to_RXP_BMS.jpg
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

I use BMS_test_OI.ino for SW. See attachment

When I start it with the TX and RX cables plugged in I get this:

Code: Select all

Entering Configuration Mode Successful!
Setting Baudrate Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Daisy chain init
Set all slaves
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
3 2 20 40 A0 58 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
errorByte cleared
4
errorByte cleared
4
errorByte cleared
WRITEALL fail
STATUS cleared
4
errorByte cleared
3 2 30 0 B0 A6 D3 
4
When starting with only TXN disconnected and when it's running I reconnect it again I get this. You can see when I reconnect TXN where it starts saying "transmitQueue WD timeout" :

Code: Select all

Entering Configuration Mode Successful!
Setting Baudrate Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Daisy chain init
UARTSlaveDevicesWakeUp WD timeout
Set all slaves
2
errorByte cleared
2
errorByte cleared
2
errorByte cleared
READALL fail
2
errorByte cleared
2
errorByte cleared
2
errorByte cleared
READALL fail
2
errorByte cleared
2
errorByte cleared
2
errorByte cleared
WRITEALL fail
2
errorByte cleared
2
errorByte cleared
2
errorByte cleared
WRITEALL fail
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
WRITEALL fail
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
WRITEALL fail
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
WRITEALL fail
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
WRITEALL fail
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
WRITEALL fail
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
READALL fail
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
6
errorByte cleared
6
errorByte cleared
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
READALL fail
measureCellData WD timeout
0.0	0.0	0.0	10
1 0	1 0
0	0	0	0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
WRITEALL fail
Data not ready
1: 0 0 0 0 0 0 0 0 0
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
errorByte cleared
transmitQueue WD timeout
6
Attachments
BMS_test_OI.ino
(45.26 KiB) Downloaded 3 times
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

Please provide a Serial print out of you current setup.
The first 100 lines or so is enough to start with. Meaning directly after power on.

One example:

Code: Select all

Entering Configuration Mode Successful!
Setting Baudrate Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Current sens calib
Current sens calib NOK: 262, 257 (range)
Current sens calib
Current sens calib NOK: 213, 213 (range)
Current sens calib
Current sens calib NOK: 179, 179 (range)
Current sens calib
Current sens calib NOK: 148, 148 (range)
Current sens calib
Current sens calib NOK: 128, 129 (range)
Current sens calib
Current sens calib NOK: 115, 115 (range)
Current sens calib
Current sens calib NOK: 111, 110 (range)
Current sens calib
Current sens calib NOK: 108, 107 (range)
Current sens calib
Current sens calib NOK: 101, 101 (range)
Current sens calib
Current sens calib NOK: 100, 100 (range)
Daisy chain init
UARTSlaveDevicesWakeUp WD timeout
Set all slaves
transmitQueue WD timeout
2
errorByte cleared readAll
transmitQueue WD timeout
2
errorByte cleared readAll
transmitQueue WD timeout
2
errorByte cleared readAll
READALL fail
transmitQueue WD timeout
2
errorByte cleared readAll
transmitQueue WD timeout
2
errorByte cleared readAll
transmitQueue WD timeout
2
errorByte cleared readAll
READALL fail
transmitQueue WD timeout
2
errorByte cleared writeAll
transmitQueue WD timeout
2
errorByte cleared writeAll
transmitQueue WD timeout
2
errorByte cleared writeAll
WRITEALL fail
transmitQueue WD timeout
2
errorByte cleared writeAll
transmitQueue WD timeout
2
errorByte cleared writeAll
transmitQueue WD timeout
2
errorByte cleared writeAll
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared writeAll
transmitQueue WD timeout
6
errorByte cleared writeAll
transmitQueue WD timeout
6
errorByte cleared writeAll
WRITEALL fail
transmitQueue WD timeout
6
errorByte cleared writeAll
transmitQueue WD timeout
6
errorByte cleared writeAll
transmitQueue WD timeout
6
errorByte cleared writeAll
If the "Init" fails, everthing thereafter will fail as well regarding slave communication.
The key here is line 40, "UARTSlaveDevicesWakeUp WD timeout", meaning "// 5, Wait for all UART slave devices to wake up" step have failed in the daisyChainInit() function, and the rest of the function is skipped.

There should be no errors between "Daisy chain init" and "Set all slaves" in order to have a chance of successful slave com.
Until you have reached this state all the other errors are irrelevant.
zuuus
Posts: 19
Joined: Wed Sep 10, 2025 9:27 am
Location: Netherlands
Been thanked: 1 time

Re: Kia Niro BMS

Post by zuuus »

I think I provided the Serial print? The second print in my post is exactly the first 100 lines I get when I start it/press restart button. Also what is exactly SPI supply pin used for? My chips are already powered.
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

I did not see that post when I wrote my answer. I started typing before you posted probably.

Anyway, good news.
In first print out you have successful initiation, meaning slave communication is up and your wiring is correct!
Now lets start finding out why writeall fails.
User avatar
bexander
Posts: 883
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 75 times
Been thanked: 98 times

Re: Kia Niro BMS

Post by bexander »

Try this modified code.
BMS_test_OI_modified2.ino
(46.67 KiB) Downloaded 1 time
EDIT:
Code updated again.
Added clearing more registers at start-up and during fault detection.
Changed setup to take numberOfSlaves, numberOfCellsPerSlave and numberOfTemperatureSensors into account.
Post Reply