Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

danmachen
Posts: 22
Joined: Fri Nov 11, 2011 11:26 am

Re: Old BMS Software Thread

Postby danmachen » Mon Dec 05, 2011 5:40 pm

I'm sure we're likely to come up against many more problems from here in, but I feel like we can get to grips with the code and the hardware. Its just draining not actually being able to program any chips yet.

We have downloaded pickit2.6, we have picbasic pro, and we have MPLAB.Just wondering which program is best to use for this application, MPLAB or Microcode studio.

Our understanding at the moment is that PicKit takes the hex files generated by pbpro, and writes them onto the chip. However when it comes to using PBpro with either MPLAB or microcode studio, not sure how to get a hex file out of them. Obviously not as simply as pressing compile.

We made an attempt to get pickit2 to recognise our chip by wiring up this test circuit seen below:
Attachments
IMG-20111205-00025.jpg
IMG-20111205-00025.jpg (217.83 KiB) Viewed 18809 times

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Tue Dec 06, 2011 9:41 am

I use MCS.

MPLAB is a nightmare :shock:

You must however have MPLAB installed or at least the MPASM part of it, as that is the assembler which builds the hex files.

Once you have MPASM installed then when in MCS you need to tell it where the assembler is located then it should generate hex files.

Does your breadboard test setup work and is the pic detected by the pickit 2.61 software?
If that part works then it's OK so far.
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.

danmachen
Posts: 22
Joined: Fri Nov 11, 2011 11:26 am

Re: Old BMS Software Thread

Postby danmachen » Tue Dec 06, 2011 10:40 am

Yes pickit2 recognises the chip, so that part is working now. The read, verify buttons seems to communicate with the chip.

Even if the chip does not communicate with pickit 2, surely I can still generate hex files through MCS?

So..it must surely be the options on MCS. In MCS I want the comiler to be PBP, the assembler to be MCS and the programmer to be pickit2?

Getting closer! :D

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Tue Dec 06, 2011 10:47 am

Not quite correct MCS is not a compiler or assembler it is just a glorified text editor.

You must have MPASM installed from the MPLAB suite, that is what generates the final hex files.

pbpro compiles the program then it is assembled by MPASM
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.

joshp1990
Posts: 13
Joined: Wed Oct 12, 2011 8:12 pm

Re: Old BMS Software Thread

Postby joshp1990 » Tue Dec 06, 2011 12:00 pm

Hi Peter,

Using PBPro through Microcode Studio, we can generate the HEX files, although only if the config lines are suppressed, which then causes problems later when the hex file is moved to PicKit 2.61.

after a few tries we added some #CONFIG and #ENDCONFIG, but we still get the error message in PicKit 2 of...

"Warning: some configuration words not in the hex file, Ensure values to the above right are acceptable"

Here is the bit of code we are currently working with:

'Below used with MPASM Assembler
#CONFIG
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT
#ENDCONFIG

'DAN AND JOSH - Added a "#endconfig" , "removed a @ symbol from before __CONFIG

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Tue Dec 06, 2011 12:09 pm

Try one of my files first, get that compiling etc and working then start modifying your own.
Use my configs exactly as in my programs.

You should not need to supress the configs in MCS they are vital.
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.

joshp1990
Posts: 13
Joined: Wed Oct 12, 2011 8:12 pm

Re: Old BMS Software Thread

Postby joshp1990 » Tue Dec 06, 2011 12:20 pm

We've using v27 of your master code, unedited to try and create a hex file. MPASM runs to 100%, before coming up with this error message:

Error[118] C:\USERS\USER\DOCUMENTS\FORMULA STUDENT\BMS SYSTEM\NR8MASTER2.ASM 410 : Overwriting previous address contents (2007)
Message[306] C:\PBP3\PBPPIC14.LIB 663 : Crossing page boundary -- ensure page bits are set.


there are a lot of message [306] also, we are not sure what they are about.

any ideas?

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Tue Dec 06, 2011 12:36 pm

ignore error 306

Google mpasm error 118 or Seach for it on the pbpro forum
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.

joshp1990
Posts: 13
Joined: Wed Oct 12, 2011 8:12 pm

Re: Old BMS Software Thread

Postby joshp1990 » Tue Dec 06, 2011 1:03 pm

we think we may have found the problem...

obviously v27 works for you as it is, so it looks like the error could come from the version of MPASM that we are using, either they have changed some of the syntax or the newer versions contain bugs. the one we have installed is MPASM 5.42.

There are a few options we have available, either we can download an older version of MPLAB (which may be more reliable) or we can change the code, which would introduce more room for error, as we currently have not got a working version to compare any alterations with.

We are going to download an older version of MPASM to see if that works, just wondering which version you use, to see if we can move forward using that

we sense we are pretty close to having everything up and running.... only one or two more hurdles to go!

joshp1990
Posts: 13
Joined: Wed Oct 12, 2011 8:12 pm

Re: Old BMS Software Thread

Postby joshp1990 » Fri Dec 09, 2011 2:40 pm

Thank you for all for your help so far, we've just finished getting out communication with the chip sorted and have successfully loaded our hex files onto the chip.

However, some problem in the way it is being loaded is posting random characters to the screen. (seen below)...

I'm sure I might have read someone having this problem previously in this thread but not sure where, so I'll reread that. Anyone know..?

It does manage to read the values from the EEPROM successfully before it starts descending into nonsensical character writing. :(
Attachments
IMG-20111209-00018 (1).jpg
IMG-20111209-00018 (1).jpg (163.99 KiB) Viewed 18778 times


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 26 guests