Ok, first of all the pic:
As you can see I've got it displaying the pack/max/min voltages on the first line, and temp/current/SOC on the bottom. This is updated in one second intervals - I was having problems with data corruption so I added a checksum which sorted that out
The latest C code and modified Remote code is also attached:
I had a bit of a nightmare with the display module, if you don't send it characters in quick succession for a while it corrupts the first few characters, so I found that 128 was a suitable non-displayable character to use as a preamble to get it going.
I didn't bother with the preamble from the master to the Tx module due to the way my code is structured to avoid delays, but it seems to work ok without it. If I can get it going in the PIC18, with the extra space I'm going to try and put in a more flexible timing structure.
Old BMS Software Thread
Moderators: GregsGarage, retepsnikrep
- hohisilver
- Posts: 114
- Joined: Mon Jan 24, 2011 10:17 pm
- Location: Wells, Somerset
Re: Old BMS Software Thread
Ian.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Re: Old BMS Software Thread
Nice!! Looks good
Regards Peter
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
- hohisilver
- Posts: 114
- Joined: Mon Jan 24, 2011 10:17 pm
- Location: Wells, Somerset
Re: Old BMS Software Thread
Also had a bit of a beer and brainwaving session last night and I've abandoned the USB idea as I've discovered the PIC18F2680 which has even more program space (32K words) and RAM (over 3K). The only trouble with the "beer" part is that I find I end up buying stuff online! So I've ordered a couple of PIC18F2680's and this for logging purposes:
http://www.ebay.co.uk/itm/SD-Card-subsystem-FAT16-FAT32-I2C-Serial-/110638316697?pt=LH_DefaultDomain_3&hash=item19c28ebc99
It looks ideal for the job (serial interface, RTC etc.). Also, I've bookmarked their main website
http://www.byvac.com/bv3/index.php?route=common/home
as they do all sorts of other goodies (e.g. serial colour displays) that might be useful for future developments
http://www.ebay.co.uk/itm/SD-Card-subsystem-FAT16-FAT32-I2C-Serial-/110638316697?pt=LH_DefaultDomain_3&hash=item19c28ebc99
It looks ideal for the job (serial interface, RTC etc.). Also, I've bookmarked their main website
http://www.byvac.com/bv3/index.php?route=common/home
as they do all sorts of other goodies (e.g. serial colour displays) that might be useful for future developments
Ian.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
- hohisilver
- Posts: 114
- Joined: Mon Jan 24, 2011 10:17 pm
- Location: Wells, Somerset
Re: Old BMS Software Thread
While my scooter's off the road I've got plenty of opportunity to experiment so I've been tweaking my code for the PIC18F2680, and this evening I finally have it (basically) running
It now uses 21.3% of program space and 18.3% data space, so plenty of room for more development!
It now uses 21.3% of program space and 18.3% data space, so plenty of room for more development!
Ian.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
-
- Posts: 100
- Joined: Sun Apr 03, 2011 7:41 pm
Re: Old BMS Software Thread
Trying to figure out how to use the master code on the picaxe chips.
the latest version of the picaxe master code i've found so far is here, posted by peter:
http://www.solarvan.co.uk/bms/MASTER170 ... 00BAUD.txt
I'm using the latest version of "PICAXE progamming editor", downloaded from the picaxe site.
when i hit the button to check syntax, i get:
"Error: #Directive error - invalid #gosubs value for #picaxe type"
but #gosubs is set to 255, like the code says it should be.
I haven't changed the code at all yet, i want to be sure i can compile it and all that as-is, before i change any values. (i'm going to need to change the number of slaves, and the cell voltage parameters to work with my battery pack)
any ideas about the gosub error i'm getting?
*edit*
of course, as soon as i posted this, i found basically the same question that peter had posted on the picaxe forum. it seems that the answer is, #gosubs doesn't have to be defined. i commented out the line, and the syntax checks out, and the code simulates and seems to be doing what it's supposed to do
the latest version of the picaxe master code i've found so far is here, posted by peter:
http://www.solarvan.co.uk/bms/MASTER170 ... 00BAUD.txt
I'm using the latest version of "PICAXE progamming editor", downloaded from the picaxe site.
when i hit the button to check syntax, i get:
"Error: #Directive error - invalid #gosubs value for #picaxe type"
but #gosubs is set to 255, like the code says it should be.
I haven't changed the code at all yet, i want to be sure i can compile it and all that as-is, before i change any values. (i'm going to need to change the number of slaves, and the cell voltage parameters to work with my battery pack)
any ideas about the gosub error i'm getting?
*edit*
of course, as soon as i posted this, i found basically the same question that peter had posted on the picaxe forum. it seems that the answer is, #gosubs doesn't have to be defined. i commented out the line, and the syntax checks out, and the code simulates and seems to be doing what it's supposed to do
Re: Old BMS Software Thread
Hi guys,
I have been using the PICAXE BMS version developed, however, I have recently tried to redo my system using the PICs, but don't know how to upload the code to the PIC for testing. Does anyone have a cheap way of uploding the code? I was previously using a PICAXE experimenter board and downloading the program through the PICAXE programming software.
What is the system like for downloading PIC programs? I have bought the experimenter version of PBPro.
Any help?
I have been using the PICAXE BMS version developed, however, I have recently tried to redo my system using the PICs, but don't know how to upload the code to the PIC for testing. Does anyone have a cheap way of uploding the code? I was previously using a PICAXE experimenter board and downloading the program through the PICAXE programming software.
What is the system like for downloading PIC programs? I have bought the experimenter version of PBPro.
Any help?
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Re: Old BMS Software Thread
Josh HP You need one of these to program the pics.
http://www.piccircuit.com/shop/pic-prog ... r-set.html
Remember though once a picaxe is programmed as a pic it can never be a picaxe again.
If you have been using a working picaxe master and picaxe slave code please post it so the poster above you can have a look at the code.
http://www.piccircuit.com/shop/pic-prog ... r-set.html
Remember though once a picaxe is programmed as a pic it can never be a picaxe again.
If you have been using a working picaxe master and picaxe slave code please post it so the poster above you can have a look at the code.
Regards Peter
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Re: Old BMS Software Thread
Noticed from the schematics of the multi-cell slave boards that the cell is connected directly to the PIC. Does the PIC have an internal resistance that would affect the voltage reading as well as the current that passes through it?
Tried searching the data sheets for this but couldnt find anything.
Tried searching the data sheets for this but couldnt find anything.
Re: Old BMS Software Thread
HI again, realised i posted the above comment in the wrong section, but anyhow...
I purchased the ICP01 and the iCP03 adapter from icircuit technologies,
http://www.piccircuit.com/shop/pic-prog ... r-set.html
as recommended by Peter. Unfortunately, the iCP03 didnt arrive but you can program without it I think.
Has anyone used this adapter before and does anyone have or know how to find the driver to install the USB device?
Been spending weeks trying to get the hardware and software connected, turning out to be really frustrating and I really am not sure how is best to do it. Do you guys go through Microcode studio, MPLAB, pickit2???
Any help would be great.
Cheers
I purchased the ICP01 and the iCP03 adapter from icircuit technologies,
http://www.piccircuit.com/shop/pic-prog ... r-set.html
as recommended by Peter. Unfortunately, the iCP03 didnt arrive but you can program without it I think.
Has anyone used this adapter before and does anyone have or know how to find the driver to install the USB device?
Been spending weeks trying to get the hardware and software connected, turning out to be really frustrating and I really am not sure how is best to do it. Do you guys go through Microcode studio, MPLAB, pickit2???
Any help would be great.
Cheers
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Re: Old BMS Software Thread
Use the software pickit 2.61 software on the site where you bought the pic programmer.
If you want to bring it down here we can set it up and get it going it's a bit hard remotely.
We need proper pics of the test setup and wiring for a start to help diagnose it.
The pic works out the cell voltage by comparing it's varying supply (cell) voltage with the known reference voltage provide by the 1.235v diode. There is example maths in the slave code text files.
If you want to bring it down here we can set it up and get it going it's a bit hard remotely.
We need proper pics of the test setup and wiring for a start to help diagnose it.
The pic works out the cell voltage by comparing it's varying supply (cell) voltage with the known reference voltage provide by the 1.235v diode. There is example maths in the slave code text files.
Regards Peter
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Who is online
Users browsing this forum: No registered users and 47 guests