Search found 3222 matches

by coulomb
6 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

I found that the original serial adapter had too much strain on the Veroboard tracks, which lifted and became intermittent. After a few fiddlings with this, I decided to mount the D9 connector vertically, and siliconed it to the board. Somehow, I didn't use much (that's not like me, I must have had ...
by coulomb
11 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

The Comparator I thought I'd document something that's bothered me for some time, and I believe I've just sorted it out. There are two comparators in the processor; one is unused. The first one, comparator one, is configured with the negative input connected to the scaled DC output measurement usin...
by coulomb
17 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Flashing New Firmware . The final step is to program the compiled and linked image into the microcontroller's flash memory. There are several ways that this can be done in the NXP processors; here we use the In Circuit Programming (ICP) technique. To do this, we have to reset the processor, and pul...
by coulomb
23 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Reading the serial data stream I've posted earlier about the useful information available in the serial data stream, but I seem to have forgotten to show how to access it. You will need: A small interface board, with a few dollars worth of components on it; see below A 12 V plug pack (wall wart, po...
by coulomb
33 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Building the Firmware The goal here is to create the file foo .ordered.hex , which will be the file needed by the Arduino or other program that flashes the new firmware. This is the overall process: Image compile process.png We start with foo .c , the source file discussed in the previous two posts...
by coulomb
41 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

The next parts of the file declares an array of structures. Each entry represents one stage. So the first entry is for stage 1 (in C, this is at index 0, but we don't need to worry about that here). Although the original source code would have an actual array, we don't bother with that here, and sim...
by coulomb
47 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Building New Firmware For those wanting to change the firmware in their chargers, this is the post with the meat in it. I'm sorry it took so long to find the time to get this together. The original firmware was written in C. I have snippets of old versions of the code, but nowhere near enough to ge...
by coulomb
56 minutes ago
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

EEPROM contents This information is basically a paste from an email, so it may take a few edits before it makes sense. There are 512 bytes of EEPROM in the Elcon charger microcontrollers, but only the first few tens of bytes are used. The "documentation" refers to a PDF (or similar) file, in Chines...
by coulomb
Today, 09:08
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Serial Data This is another post that is basically a paste from an email from some time ago. This is the so-called "listen data", which contains a binary copy of the "run" structure, which contains a lot of useful information about what the charger is doing. It is sent every two seconds, from memor...
by coulomb
Today, 09:06
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

The main loop. After initialization, the processor runs an endless loop: MainLoop.png The main loop starts by busy waiting for a Boolean (bit variable) to be set. This one is set by the real time interrupt routine every 100 ms. Next is a call to feed the watchdog timer (important after a long delay...
by coulomb
Today, 08:58
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Next (not shown) is a call to User_curve_set(). This checks for the button being pushed or not, and changes the user selection if necessary. This includes the one call to ProgramFlash(), shown earlier, where the user selection is saved (programmed) to flash memory. One of the values in EEPROM is the...
by coulomb
Today, 08:50
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

The start of main() : main1.png The call to LPC900_config_init is a standard call, and it does really standard initialization. serial_init and CCU_init initialize the serial port and Capture Compare Unit respectively. The next few calls are to PWM_set. There are several PWM outputs from the LPC938 ...
by coulomb
Today, 08:42
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Understanding the firmware: algorithms I'm not sure how to go about this. I think I'll introduce the code as I see it, and see how people react to this level of detail. Maybe most people just don't care. I'll start with the firmware that is oldest (for me) and best commented. Most of them are fairl...
by coulomb
Today, 08:27
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Understanding the Firmware: Tools The original firmware was written in C. We know this because snippets of code have leaked, but nowhere near a complete source code is available. Ideally, a decompiler would be used to convert the binary firmware read from the processor into readable, maintainable C...
by coulomb
Today, 08:19
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Writing the Firmware Writing the firmware uses the same tools (hardware and software) as reading them. First, you will need to build the new firmware; see other sections for details. The firmware will ultimately exist as an Intel Hex file . These files look like this: :1000000002194BC2ACE51A6518600...
by coulomb
Today, 08:16
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Hardware for Reading/Writing the Firmware There are two main ways to interface with the 5-pin programming port near the microcontroller. One is the off-the-shelf USB In-Circuit Programmer for LPC9XX from FDI: http://www.teamfdi.com/development-tools-kits/product-images/USB-ICP-LPC9XX-01.jpg This is...
by coulomb
Today, 08:06
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

User Selection. For non-CAN chargers, there are 10 "user selections". Only one of these is active at any one time. The ten selections programmed into any one charger is theoretically tailored to what the user wants. If the user can foresee all the changes s/he will need over the life of the charger...
by coulomb
Today, 07:57
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Reading the Firmware Generally, firmware is protected by security bits. The idea is that the manufacturer programs the micro, sets the security bits, then no-one can read the firmware without erasing the whole thing. The 8 KiB flash memory is broken up into eight 1 KiB sectors, and each can be set ...
by coulomb
Today, 07:52
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

The Processor . The microcontroller used in the Elcon/TC chargers is the NXP P89LPC938 . This is an 8-bit machine using the old Intel 8051 (MCS51) architecture . That means that there are plenty of tools out there - assemblers, disassemblers, simulators, and so on. The original Intel 8051 microproc...
by coulomb
Today, 07:49
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

Legal. I have no wish to cause trouble with this project. It seems plain to me that sharing knowledge of these chargers makes them more valuable than they were when no-one know how to repair them or change their behavior. No doubt someone, and possibly the manufacturers, will insist that firmware i...
by coulomb
Today, 07:47
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Re: Elcon/TC Charger Firmware: The Facts

History and Acknowledgements. This topic and many of the more useful Elcon/TC charger threads would not have been possible without the help of diyelectriccar members KennyBobby and Pdove. It was hosted on diyelectriccar for years, but in July 2018, the owners migrated the diyelectriccar forums to t...
by coulomb
Today, 07:39
Forum: Batteries, charging, management and monitoring
Topic: Elcon/TC Charger Firmware: The Facts
Replies: 21
Views: 39

Elcon/TC Charger Firmware: The Facts

THIS TOPIC IS UNDER CONSTRUCTION! Minimal Discussion! Please direct all discussions to the Elcon/TC Charger Firmware: Discussion thread. Obsolescence Notice This topic refers to the oldest range of Elcon/TC charger hardware, those manufactured with Elcon or TC branding prior to December 2013. Howev...
by coulomb
Today, 07:17
Forum: Batteries, charging, management and monitoring
Topic: TC/Elcon 2013 Charger Schematics
Replies: 7
Views: 38

Re: TC/Elcon 2013 Charger Schematics

Mike, I'm grateful for your contributions here, and I can only really treat it as a learning experience. Actually, this is mainly old information, archived here because the owners of diyelectriccar have lost a year's worth of posts (roughly last financial year), and don't seem to be competent enoug...
by coulomb
Yesterday, 09:06
Forum: Batteries, charging, management and monitoring
Topic: TC/Elcon 2013 Charger Troubleshooting and Repair
Replies: 24
Views: 57

Re: TC/Elcon 2013 Charger Troubleshooting and Repair

The original text for this post is lost, unless an archive can be retrieved later. But the image is the only important part. I find this image very useful for "deciding where to dig" into the black gunk. Many thanks to Diyelectriccar users KennyBobby and PDove for creating it. Use your browser cont...
by coulomb
Yesterday, 08:59
Forum: Batteries, charging, management and monitoring
Topic: TC/Elcon 2013 Charger Troubleshooting and Repair
Replies: 24
Views: 57

Re: TC/Elcon 2013 Charger Troubleshooting and Repair

I'm repairing a charger that has a direct short at the output of the bridge rectifier. It looks like it has to be one or both of Q7 and Q8, the PFC MOSFETs. I've never had these fail yet, and have never seen a part number for them, so I pulled one of them from a dead charger: Q7Q8 MOSFET.jpg It's an...