Page 4 of 4

Re: General questions about the BMS project here please.

Posted: Sun Mar 20, 2011 6:15 am
by retepsnikrep
hohisilver wrote:Solved :D

The watchdog PIC wasn't programmed correctly. It was warning me that it would be unreliable if MCLR was disabled while using the internal clock, which I foolishly ignored. Once I'd overridden the MCLR setting in the configuration it programmed correctly :)


I don't understand the mclr error. I don't get that with my cheapo programmer using the published code. What programmer are you using?

Re: General questions about the BMS project here please.

Posted: Sun Mar 20, 2011 12:45 pm
by hohisilver
I'm using an ICD2 driven by MPLAB. I don't know whether it reads the configuration bits from the hex file, but I had "configuration bits set in software" checked and I kept getting that warning. Unchecking that box and setting the MCLR manually fixed the problem.

Re: General questions about the BMS project here please.

Posted: Sun Mar 20, 2011 3:09 pm
by GregsGarage
hohisilver wrote:I'm using an ICD2 driven by MPLAB. I don't know whether it reads the configuration bits from the hex file, but I had "configuration bits set in software" checked and I kept getting that warning. Unchecking that box and setting the MCLR manually fixed the problem.


Look here for a discussion on the required configuration settings for the watchdog chip. Version 3 required manual setting of the configuration bits because it used default settings which were not correct. In version 4, it should all be set in the hex file. Maybe you've got version 3 of the watchdog? BTW, the only difference between the 2 versions is the configuration settings in the hex file, so if you have manually set the configuration it will work the same.

Re: General questions about the BMS project here please.

Posted: Sun Mar 20, 2011 5:36 pm
by hohisilver
I'm actually a bit confused about how it programmed in the first place. When I tried to reprogram it yesterday with those settings it gave me the warning then failed to program. Before, I just got the warning and programming succeeded - I'm just wondering whether I programmed it as a slave the first time!

I'm definitely using Watchdog_081010_V04_1SP.hex, and looking at the source I'm assuming in this line:

@ __config _FCMEN_ON & _IESO_ON & _BOD_OFF & _CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_OFF & _WDT_ON & _INTOSCIO

_MCLRE_OFF is equivalent to "MCLR pin function is digital input, MCLR internally tied to VDD" in MPLAB-speak and _INTOSCIO is telling it to use the internal oscillator, which MPLAB is telling me is an illegal combination.

Re: General questions about the BMS project here please.

Posted: Sun Mar 20, 2011 5:56 pm
by hohisilver
Ah no, as you were :) It's an ICD2-specific thing I think - from the help file:

"When Internal MCLR is used with MPLAB ICD 2 for programming, both Vpp and Vdd are powered together, and then Vpp is pulled high to Vihh to enter programming mode. This means that your code will be running before Vpp goes to Vihh. If that code makes use of port pins that correspond to clock and data pins* in programming mode, there is a chance their values may not be 0, as necessary to enter programming mode. Therefore, the device could not be reprogrammed."

What I read from this is that once the code has been programmed in with this combination of config bits it can't be reprogrammed without erasing it first with MCLR enabled. Not really a problem then :)

Re: General questions about the BMS project here please.

Posted: Fri Dec 16, 2011 9:20 pm
by boelle
Hi peter

Would you mind if your work found way to a user based product?

We are (excludning myself) a group of danish cityel owners that are thinkinger with a replacement board that replaces the org relay/fuse board and the battery cells are from thundersky.

Since the cityel is not an complicated "car" it would look stupid on my eyes to invent the wheel all over


ps... do you think your PCB layouter are up for making boards if we do schematic's etc?

Re: General questions about the BMS project here please.

Posted: Fri Dec 16, 2011 10:04 pm
by retepsnikrep
Sounds reasonable please post more details of exactly what you want.

Re: General questions about the BMS project here please.

Posted: Fri Dec 16, 2011 11:02 pm
by boelle
first we are going to build a basic PCB that handles lights etc... all the basic's to make it street legal

after that we are going to add on top of that, charging are the next.... i was maybe a bit ahead but since it's an EV i thought i might as well start search for options..

and that is where i remembered the slave units...

we are still in the very early stages.... for now we are planning what inputs and outputs we need

Re: General questions about the BMS project here please.

Posted: Fri Dec 16, 2011 11:36 pm
by GregsGarage
boelle wrote:first we are going to build a basic PCB that handles lights etc... all the basic's to make it street legal


Boelle, have a look at DesignSpark for schematic and pcb layout. It's free and unlike Eagle doesn't have a pcb size limit which would be a problem when making a fairly large board for relays. Also have a look at this pdf for a tutorial on creating pcb layouts. I have done a couple of simple pcbs and they aren't that hard to do. I have been using itead studio, prices start at $10usd for 10 small pcbs, they are quick (about a week, not bad coming from China) and even spotted an error on my first pcb and asked me to correct it and resend the files. :D

Re: General questions about the BMS project here please.

Posted: Sat Dec 17, 2011 1:37 am
by boelle
great... those advice was just what i needed.... have any idea what max size is they handle? had a bit trouble navigate their site