Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming Module V4.5 #133

Closed
Solarbot opened this issue Mar 23, 2023 · 11 comments
Closed

Programming Module V4.5 #133

Solarbot opened this issue Mar 23, 2023 · 11 comments
Labels
help wanted Extra attention is needed

Comments

@Solarbot
Copy link

Would it be possible to include information on programming the latest V4.5 module which doesn't have an ISP header? Many thanks.

@atanisoft
Copy link

I believe it is the same process as the external current shunt with UPDI.

@stuartpittaway
Copy link
Owner

Hi @Solarbot its an UPDI protocol.

You can program these boards using a simple USB to Serial adapter like the FT232. This is the documentation for it.

https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md

@stuartpittaway stuartpittaway added the help wanted Extra attention is needed label Mar 24, 2023
@Solarbot
Copy link
Author

Hi both, thanks for responding.

I've looked up UPDI programming which seems pretty neat - am I correct in thinking that the V4.5 module cannot therefore be programmed by the DIYBMS controller? If so, may I ask if I need to compile and upload or is there a precompiled version availble? Also, happy to say the ATTINY seems to be avaible once more :-)

@stuartpittaway
Copy link
Owner

am I correct in thinking that the V4.5 module cannot therefore be programmed by the DIYBMS controller?

Unfortunately - you are correct, it cannot be programmed using the controller.

There is a pre-compiled code in the release
https://github.com/stuartpittaway/diyBMSv4ESP32/releases

Take a look in the modules/HEX folder for these files - use the one for 5K or 10K speed as required.
image

@Solarbot
Copy link
Author

Thanks Stuart, appreciated.

Is there handy guide/workflow showing how to upload the HEX to the V4.5 module including what the 5K and 10K speed refers to :-)

@stuartpittaway
Copy link
Owner

No guide on this one I'm afraid - use the 5K if you are starting out - it refers to the communication speed between the modules and controller.

Do some google searching on UPDI programming - its quite simple, but a lot do struggle with it.

@Solarbot
Copy link
Author

The advantage of working it out for myself is that new stuff gets learnt :-)

Thanks for the pointers 👍

Cheers

@atanisoft
Copy link

@stuartpittaway https://github.com/adafruit/Adafruit_AVRProg or https://gitlab.com/bradanlane/portaprog/-/tree/master/ might provide the functionality. I didn't have much luck with Adafruit_AVRProg on a standalone ESP32 setup, but portaprog might be usable. The key will be disabling all other functionality of the BMS during flashing to maximize the time allotted to UART interaction.

@Solarbot
Copy link
Author

Solarbot commented Oct 16, 2023 via email

@stuartpittaway
Copy link
Owner

Hi @Solarbot

Use the pre-compiled firmware/code directly from GITHUB Releases.

Additionally, use a simple USB Serial adapter as an UPDI programmer, you don't need anything fancy, diode and couple of resistors. https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md#serial-adapter-requirements

After this, AVRDUDE command line tool will program the chips

Alternatively, you can use a spare Arduino Uno like in this guide - https://daumemo.com/diy-updi-usb-programmer-which-can-be-made-with-cheap-hardware/

And finally, another option is to use the Microchip python code...
https://github.com/microchip-pic-avr-tools/pymcuprog

@Solarbot
Copy link
Author

Solarbot commented Oct 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants