Help me find capacity bars in 0x5BC

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Dala

Well-known member
Leaf Supporting Member
Joined
Oct 28, 2018
Messages
464
Location
Finland
Could someone give me a helping pointer towards where to get the outer capacity bars in 0x5BC?

Two example frames from a 2015 Leaf (with 3 as mux).
0x17 c0 f0 64 c9 03 02 d0

0x17 c0 50 64 c8 03 03 fc

The excel sheet says:
"The battery capacity gauge (the bars outside the fuel gauge) is controlled by a muxed field, when 0x5BC bits 32-35 (ie the low nibble of the 5th byte) is 0x3, 0x5BC bits 16-19 (ie the low nibble of the 3rd byte) contains the capacity bars."

This doesn't make any sense to me. If I assume the Byte goes from 0-7, here is where the muxed is
0x17 c0 f0 64 c9 03 02 d0

Then the capacity bars should be in
0x17 c0 f0 64 c9 03 02 d0

The high nibble of this section is HEX: F == DEC = 15, which makes no sense since it's at 12/12 capacity bars. What am I missing?!
 
Is it nibble or bit swapped?

Based on your description I'm assuming the 0x17 is the message number, as you are not counting the 17 as message bytes? (see at the end)

Bits indeed start at zero but if I say the 16th bit is would actually be bit location 15.
Starting at the 16th bit (bit 15) I see 0011 in "c0f064", ignoring the "17"
But if its swapped it would then be 1100. That happens to be 12. But......

But if we include the 17 as part of the message, hence "17c0f0", then wouldn't you need to include the 17 in the muxed message as well?
The 5th byte of the original message "17 c0 50 64 c8 03 " is actually "c8"
Or from "17 c0 f0 64 c9 03 02 d0" the 5th byte is "c9"

That's the way I always learned it - in other words your first byte is bit 0-7 and so on.
 
Dala said:
The excel sheet says:
"The battery capacity gauge (the bars outside the fuel gauge) is controlled by a muxed field...

Where do you get this excel sheet?
Cannot find it. Only seemingly older versions without that info
 
I did it!

Turns out there are some major differences in 0x5BC between the ZE0 and AZE0-1
1. The 2011 LBC sends this message at 500ms interval. On the 2015 LBC, this message is sent much quicker, at an 100ms interval.
2. The location for capacity bars is not what the Excel suggested. On the 2015 LBC, the capacity (and charge bars) are set in frame[2]4-7. The multiplex signal is also different, it is controlled by frame[4]0-3, which alternates between 8/9
s7CXiNF.png

3. The LBC achieves some sort of backwardscompatible mode by writing charge bars for 5 messages (5x100ms), and then switches to capacity bars for 5 messages (5x100ms)
4. Here is a picture of the success 100% Soh, manipulated to 9cap, 51% battery, manipulated to 10/12bars
ZX38pvh.png


For some reason, the capacity bars are "15" when 12/12. If you write 11, it seems to do (11/15)*12=8,8=9 bars shown.
Also the charge bars have an 1-offset, here in the picture I've written it to 11, but it shows 10.

I will update the excel, it is in github, I have made some commits in my own branch, and will push to the master soon.
https://github.com/dalathegreat/leaf_can_bus_messages
 
Back
Top