Honda Insight Forum banner

561 - 580 of 1004 Posts

·
Moderator
Joined
·
7,200 Posts
Thanks for that. I wasn't aware that it was a non standard pinout.

I bought a bunch of headers and single pin jumper wires also, so the LCD and backpack can be separated from each other. I did this because as you can see, the 20x2 LCD has a DIP header instead of the normal SIP.

I'll hopefully be able to work on things next week/weekend. I'm having my mom over for Mother's day this weekend, so no time for projects. ;) In fact, I should be cleaning, not posting.... :rolleyes:

Edit:

I would be okay with dropping the data logging. If I wanted to do that, I could just capture the raw RS-485 data.
 

·
Premium Member
Joined
·
1,631 Posts

Attachments

·
Administrator
Joined
·
12,142 Posts
Discussion Starter #563 (Edited)
Joe. It looks like data logging has gone from 5e? Is that correct?

If so you could remove

include "modedefs.bas" 'Allows the use of the standard serin/serout command
Which will save a few bytes of variable Ram.

Did you try removing the debug 1ms delay?
DEFINE DEBUG_PACING 1000 'Set Debug Character Pacing mode to 1ms between bytes
I note you have split several of the calculations over several separate lines does that save space? You can combine these two is it smaller?

Read 0,Config 'Read config from EEPROM

Read 1,InitXsoc 'Read config First Powerup or XSOC setting from EEPROM
Read 0,Config,InitXsoc

Thanks for your continuing efforts.

Another look at the IR calculation to give a battery fitness score :) might be a very useful addition. It could combine actual AH counted in/out with temp and IR etc. Not easy but interesting. As we know the BCM adapts itself to the changing capacity of the oem battery as it ages. Once the capacity has dropped to <1ah or so you get a P1447. If we counted ah in out on a single trip between full/empty we might be able to work out the current capacity of our particular battery :) A def selling point if seller could say battery has IR of X and X ah useable capacity.
 

·
Premium Member
Joined
·
1,631 Posts
Joe. It looks like data logging has gone from 5e? Is that correct? If so you could remove

include "modedefs.bas" 'Allows the use of the standard serin/serout command

Which will save a few bytes of variable Ram.
Hi Peter, data logging is still enabled in rev 5e within the 16x2 layout coding but it is already removed from the 20x2 code so I guess I could remove the modedefs.bas in that code.

Did you try removing the debug 1ms delay?
No I haven't tried that yet.....but the LCD seems to look ok with data change.

I note you have split several of the calculations over several separate lines does that save space?
I was just doing that this morning to save more space. For some math calculations, complex one line calculations do actually take more space. I commented out the original and spread the calculation over several lines and you can gain 2-3 words back for each calculation and over several calculations, it all adds up so I can add more functions.

Also, it is also amazing how much space you can save by changing:

if (a = b) and (x = y ) then ..... to
if a = b then
if x = y then....

It seems like it should be the opposite but once a line becomes complex, it needs to take more space overall to perform the task. The only exception is when the equation being broken apart requires word instead of byte....If the result of the completed equation can always fit into a byte variable but when split apart requires the use of word variables, then the original byte variable complex calculation is smaller....I ran into this in the morning trying to save so much space that I broke down the typical Celcuis to Fahrenheit equation into three steps:

Oringal: F = ((C * 9) / 5) + 32
Became (as a test):
F = C * 9
F = F / 5
F = F - 32
This would normally work but if the first line exceeds the byte limit....the rest is all bad....If you start using word variables for that stuff, the overal space ends up more than the original equation.....This is why you will see some caculations broken up into several lines and some will remain as one complex line....It is amazing when space is tight what you are willing to do to gain more space.....That is the most time consuming part for me when adding more functions....Even with reve 5a, I was reaching the limits of code space until I found out what ends up saving more space overall. As each rev changed, I had to find more code space but I think that it would be hard to squeeze anymore stuff in there....I am trying to save some room if there is a simple calculation for SOC that can be adjusted by the user for 2nd battery setups.

You can combine these two is it smaller?

Read 0,Config,InitXsoc
That method is only supported in PBP 2.6 and I am using 2.5 by default whereas they have to be one liners....(I have tried to combine them and it will not compile on rev 2.5....It says syntax error)....Also, compiling earlier revs (like 5a and 5b etc) with 2.6 takes more word space.....Say if I compile something taking 2046 words on 2.5 , if I take that very same code and compile on 2.6, there is not enough space even if I combine the read statements (there are a couple of them).....It seems that overall, 2.5 was more efficient even though I have to separate the read statements. Although, I just went back to try it again with today's code having less complex equations and it took 1992 whereas BPB 2.5 compiles at 1969....Combining 6 read statements to 2 read statements did reduce the overall code to 8 words less but as you add more of the other code, I think 2.5 will take in more code overall and use less words....It seems strange....I wonder if I get an even older rev, will I have even more room :) (as long as I don't get syntax errors).....

Thanks for your continuing efforts.

Another look at the IR calculation to give a battery fitness score :) might be a very useful addition. It could combine actual AH counted in/out with temp and IR etc. Not easy but interesting. As we know the BCM adapts itself to the changing capacity of the oem battery as it ages. Once the capacity has dropped to <1ah or so you get a P1447. If we counted ah in out on a single trip between full/empty we might be able to work out the current capacity of our particular battery :) A def selling point if seller could say battery has IR of X and X ah useable capacity.
I did look at that for a bit....but with the current stuff in there right now with all of the extra formatting to insure not character overlaps and such, there is not enough space.....Too bad they don't make an 8 pin 4096 chip (although I guess 2048 and several I/O pins on a tiny 8 pin isn't too shabby :) )

JoeCVT = Just your average CVT owner
 

·
Moderator
Joined
·
7,200 Posts
*eyes glaze over*

I hope to one day understand what you just said.

LOL. Nah.. I kinda did, but not really. The farthest I ever got with coding was simple IF, AND, THEN, WHEN type of stuff.

I've started reading through the PICAXE manuals, but it seems so overwhelming, and its hundreds and hundreds of pages. I guess I need the actual starter kit to follow along with...
 

·
Administrator
Joined
·
12,142 Posts
Discussion Starter #566
Thanks for that useful info for me as well. I'll watch that with my new IMA control project but it doesn't do any fancy maths. I had been looking at your 20x2 code and saw the logging was missing. Interesting about ver 2.5 and ver 2.6 size differences.

This 8 pin pic has 4096 words of memory :)

PIC12F1840

Ask them for a few samples, I'm going to. With a few config tweaks it would be a drop in replacement I'm sure, and with a new pcb could be a much neater solution not requiring the Rs485 chip or the voltage reg section for instance :) It has a hardware usart for a start!
 

·
Moderator
Joined
·
7,200 Posts
Hmm. It seems like memory size has always been a big problem with this project. If it could be a drop in replacement, it may be worth upgrading to that PIC if it would help in that regard, without too much fuss in other areas?
 

·
Registered
Joined
·
244 Posts
Another look at the IR calculation to give a battery fitness score :) might be a very useful addition. It could combine actual AH counted in/out with temp and IR etc. Not easy but interesting. As we know the BCM adapts itself to the changing capacity of the oem battery as it ages. Once the capacity has dropped to <1ah or so you get a P1447. If we counted ah in out on a single trip between full/empty we might be able to work out the current capacity of our particular battery :) A def selling point if seller could say battery has IR of X and X ah useable capacity.
Awesome, I'll be keeping an eye out for all this to put into my code as well. :)

I will likely add a counter that increments by one every time an AA serial packet is picked up, modulo that with 2-4 to figure the 2-4 readings apart. Every time a 0 comes through, compare the old current/volts reading with the new one. And of course if the value is higher than the highest, it'll store the new value.

Counting Ah I think is going to be the hardest part. The ESR/IR will likely be needed to figure in the slip of the cells. I don't see temperature as a viable or useful variable in battery health, but I could be wrong.

Edit:

I keep reading about memory issues. Ya know I never have any memory issues with my atmega328. It has 32kbytes of flash, 1kbytes ROM, 2kbytes RAM, and runs 16mhz with the c++ programming language. Just throwing that out there for you guys. I can add as many features as I want. I'm contemplating adding wireless right now to expand without harnesses...
 

·
Registered
Joined
·
1,616 Posts
Another look at the IR calculation to give a battery fitness score :) might be a very useful addition. It could combine actual AH counted in/out with temp and IR etc. Not easy but interesting. As we know the BCM adapts itself to the changing capacity of the oem battery as it ages. Once the capacity has dropped to <1ah or so you get a P1447. If we counted ah in out on a single trip between full/empty we might be able to work out the current capacity of our particular battery :) A def selling point if seller could say battery has IR of X and X ah useable capacity.
OK, maybe I am crazy, but why would ANYONE in their right mind be considering selling an Insight with gas over $4 a gallon??? I am looking for a junker right now to ADD to my stable. I want to do some body mods but dont want to mess up a nice car.

I am looking for a car that can be driven home. Other than that, whatever is wrong with it just lowers the price so I can afford it.
 

·
Premium Member
Joined
·
1,631 Posts
This 8 pin pic has 4096 words of memory :)

PIC12F1840

Ask them for a few samples, I'm going to. With a few config tweaks it would be a drop in replacement I'm sure, and with a new pcb could be a much neater solution not requiring the Rs485 chip or the voltage reg section for instance :) It has a hardware usart for a start!
Good find Peter :) Awhile back when I first ran out of code space, I was searching for some websites that showed the specs of a lot of PICs with a search tool to find 8 pins with higher memory amounts....That website must be outdated because the max word 8 pin I could find listed was already the 12f683 @ 2048....I saw other 4096 ones but they had more than 8 pins....I was hoping to find one that would physically fit your PCB instead of re-inventing the wheel.....

I will have to look more into that since it looks promising....I don't see it in the drop down list for the PIC programmer but maybe there is a way to update that or choose one that would be compatible (besides updating the compiler).....

JoeCVT = Just you average CVT owner
 

·
Premium Member
Joined
·
1,631 Posts
Doesn't it sometimes go below 25 and above 75% though which would skew the scaling? Can you confirm this?
Yesterday while trying out rev 5e in the car, just for the heck of it, I tried to see what is the max I could get the SOC to show in normal mode....While already moving, I would accelerate without using any assist to build up speed, then let the car slow slow for regen. When doing this repeatedly, I saw the gauge go to 80.8% SOC and I thought I saw it reach 81% as it was flashing the percent and decimal.....At that point, I could get no more regen....I think it will do that until it comes back to 75% again before regen will start again because even after using some assist, I pulled into my driveway at 78% and still had no regen.....I have seen this before so it appears to be normal behavior.....When flipping to the Expanded SOC mode, it showed 99.9% when the real SOC was above 75% as expected so it all worked well.

JoeCVT = Just your average CVT owner
 

·
Moderator
Joined
·
7,200 Posts
I ordered 3 samples of the PIC12F1840 :)
 

·
Premium Member
Joined
·
1,431 Posts
Yesterday while trying out rev 5e in the car, just for the heck of it, I tried to see what is the max I could get the SOC to show in normal mode....While already moving, I would accelerate without using any assist to build up speed, then let the car slow slow for regen. When doing this repeatedly, I saw the gauge go to 80.8% SOC and I thought I saw it reach 81% as it was flashing the percent and decimal.....At that point, I could get no more regen....I think it will do that until it comes back to 75% again before regen will start again because even after using some assist, I pulled into my driveway at 78% and still had no regen.....I have seen this before so it appears to be normal behavior.....When flipping to the Expanded SOC mode, it showed 99.9% when the real SOC was above 75% as expected so it all worked well.

JoeCVT = Just your average CVT owner
http://www.insightcentral.net/forums/modifications-technical-issues/17481-bcm-gauge-battery-data-display-13.html#post170761

From last summer; one picture of 99.9% via the bcm after a long downhill forced charge.
 

·
Administrator
Joined
·
12,142 Posts
Discussion Starter #574 (Edited)
Your lucky I tried to order 2 samples and got message saying no samples sent to Uk which is odd I'll try again when I get home.

Re programming the pic with the usb gizmo got this from piccircuit.com

Hi,

Thanks for checking with us.

For the PIC12F1840, you might need to install the attached patch to enable the PIC12F1840 programming

Please apply the patch at C:\Program Files\Microchip\PICkit 2 v2>PK2DeviceFile.dat

Then the PIC12F1840 should be detected by the PICkit2.

Please let us know the testing results on our solutions. We will try our best to help you.

Best Regards,

PICCIRCUIT.COM
I have also e-mailed pbpro for an update on support for the new pic.

Mark I think your 100% resulted from a masking error in the gauge code at that point in it's development. Certainly your >100% figures were an error we corrected. Have to see how it goes.
 

Attachments

·
Administrator
Joined
·
12,142 Posts
Discussion Starter #576
Reply from ME labs and pbpro with new 8 pin pic.

The datasheet wasn't available in time for our last PBP revision, and another revision isn't planned for few months.

It looks to me like the part is identical to the 16F1828, with the exception of a few missing ports. I think you can compile for the 1828 and the hex file will work for the 1840. Let me know if you encounter any compiler or assembly errors and I will look into it.

Programming support for the 1840 has already been added to the meProg software for the programmers.

Charles Leo
 

·
Registered
Joined
·
354 Posts
I just received in the mail one of the last three $10 pcb kits.

Thanks.

I ordered the lcd backpack from sparkfun and one of the $1.00 ebay
lcd's.

How do I connect/wire the backpack to the lcd? Joe mentioned
"female header pins", I think? How many are needed? Are wires
soldered to the "female header pins" and then soldered to the backpack?
If so, will it be obvious (I would think not) where to make the connections?
 

·
Premium Member
Joined
·
1,431 Posts
Your lucky I tried to order 2 samples and got message saying no samples sent to Uk which is odd I'll try again when I get home.

Re programming the pic with the usb gizmo got this from piccircuit.com



I have also e-mailed pbpro for an update on support for the new pic.

Mark I think your 100% resulted from a masking error in the gauge code at that point in it's development. Certainly your >100% figures were an error we corrected. Have to see how it goes.
I agree, but I can still get 99.9% if I run the batteries down all the way and then take it back up via forced regen.
 

·
Registered
Joined
·
244 Posts
The sparkfun page for the backpack should have pictures of one installed on the LCD. The headers you will need are male, not female. There are 3 wires that connect to the LCD: 5v power, 0v ground, and serial data. The backpack I received over 2 years ago had screw terminals on the PCB for the wires.

EDIT:

Just to clarify: What are you folks talking about with the SOC? Is that the 0x87:3,4 message from BCM? Also the 99.9% is a capped value of the remapped amounts? I'm having a hard time keeping up without knowing what ya'll are talking about in the 1st place.
 

·
Premium Member
Joined
·
1,431 Posts
Just to clarify: What are you folks talking about with the SOC? Is that the 0x87:3,4 message from BCM? Also the 99.9% is a capped value of the remapped amounts? I'm having a hard time keeping up without knowing what ya'll are talking about in the 1st place.
Not remapped values, these are values reported from the BCM on the gauge. Since I have deeper capacity than most I can force regen above the normal 75% that the BCM guage shows. The BCM will actually track upto 99.9%, but it doesn't save that value. If I key off and key back on it goes back to 75%.
 
561 - 580 of 1004 Posts
Top