Help me reprogram the chip inside my flashlight! :P - Page 1
Forum section: electronics / repair

author: MrJoeyJoeJoe
author_rank: Contributor
timestamp: February 14, 2021, 08:43:22 am
content: Hey guys!I need help! I'm always up for fixing things and am sick of my headlight torch's programming: you have to push the button once, twice, three times to turn on all of the LEDs and then a fourth and fifth time to turn off!I recently bought a USB multi microchip reader/writer and thought I know, I'll reprogram it so it's just one click to turn on, one click to turn off. How hard can it be?I am now in a world of pain.Unfortunately it appears to be a blob microchip with what appears to be 7 pins...I've tried to connect the pins to the USB device in some sort of coherent fashion and am about to install a flasher program like Dave used in his video on USB chip readers, but I'm wondering if it's even possible to code this sort of thing? I was hoping for some kind of language, but it looks like it's all F's and numbers?Is it even possible to 'free code' something like this?All ideas are welcome,Thanks, Joe!

author: ataradov
author_rank: Super Contributor
timestamp: February 14, 2021, 09:03:54 am
content: I don't understand. How can you connect an unknown MCU to the programmer? What even makes you think it is an MCU? Most of those multi-press cheap flashlights use fixed functions LED drivers. There is nothing to reprogram.

author: ataradov
author_rank: Super Contributor
timestamp: February 14, 2021, 09:05:01 am
content: It may be easier to just bypass the chip and wire a fixed switch.

author: AndyC_772
author_rank: Super Contributor
timestamp: February 14, 2021, 12:52:19 pm
content: Personally I wouldn't even bother trying to find out what that blob is or how it might be reprogrammed. I'd just design a new PCB the same shape and size with a PIC on it and use that; companies like JLC are so stupidly cheap it's a no-brainer, IMHO.

author: Gyro
author_rank: Super Contributor
timestamp: February 14, 2021, 01:48:19 pm
content: Quote from: ataradov on February 14, 2021, 09:03:54 amQuote from: ataradov on February 14, 2021, 09:05:01 amActually, most of those torches do have a micro driving the FET. They do the PWM dimming, SOS flashing etc. It allows different products to be differentiated by different numbers of 'modes' - and importantly, things like low battery shut-off. Some of them are PIC based, some ATtiny, probably clones, and doubtless others, something cheap and Chinese. Blobbed dies are the bottom of the pile though.There's a website somewhere where modders have various public domain firmware variants - it's referenced on the forumsomewhere. Simply bypassing the chip is going to rob it of things like battery shut-off and dimming though - they don't last long at maximum current.I agree with the Andy's advice. I can't see the OP being able to identify what the controller is - even the SOIC versions are normally sanded and need identifying from their pinout.P.S. It might even be possible to isolate the blob and air-wire a micro onto the existing PCB.

author: MrJoeyJoeJoe
author_rank: Contributor
timestamp: February 14, 2021, 02:53:39 pm
content: Quote from: ataradov on February 14, 2021, 09:05:01 amThanks a lot for your replies!It certainly WOULD be easier just to wire on a new on/off switch. But I'm really curious about the code that goes on inside these home appliances, and would love to have the ability/ knowledge to manipulate them!

author: MrJoeyJoeJoe
author_rank: Contributor
timestamp: February 14, 2021, 02:58:47 pm
content: Quote from: Gyro on February 14, 2021, 01:48:19 pmAwesome advice, regarding replacing the blob for an identifiable micro! And then flash a public domain firmware onto that, no?What should I google, to find that??

author: perieanuo
author_rank: Frequent Contributor
timestamp: February 14, 2021, 03:13:17 pm
content: atarodov is right, just the switch + current regulator for your led, you're ok

author: shakalnokturn
author_rank: Super Contributor
timestamp: February 15, 2021, 03:02:28 am
content: It sounds like a lot of trouble for a bit of light but yes those multi-mode cycles are annoying.The only decent headlight I've found so far is a aluminium body "Boruit" branded one from AliExpress.It has a IR proximity sensor that I never use and simple on/off switch that when held will make the lamp go through a dimming cycle to set a default brightness on release.If you can't get to talk to your white blob it looks like a good from scratch learning project for i.e. a PIC10F222.

author: amyk
author_rank: Super Contributor
timestamp: February 15, 2021, 03:20:51 am
content: ataradov is right, there's basically 0 chance it's going to be a reprogrammable MCU, and even if it's an MCU it's going to be mask ROM with that sort of packaging and production volume.Put another way, a manufacturer is going to choose a mask ROM before going with COB.

author: Habropoda
author_rank: Regular Contributor
timestamp: February 15, 2021, 03:23:32 am
content: Budget Light Forum has lots of info on DIY and modding flashlights including firmware, code examples and schematics:https://budgetlightforum.com/forum/otherled/mods

author: Gyro
author_rank: Super Contributor
timestamp: February 15, 2021, 10:39:46 am
content: Thatwas the site.P.S. Infray torches (well at least the ones I've bought) come back on in the same mode if you hold the button down to turn them off.

author: AndyC_772
author_rank: Super Contributor
timestamp: February 15, 2021, 11:40:53 am
content: Quote from: MrJoeyJoeJoe on February 14, 2021, 02:58:47 pmTry "complete beginner guide programming PIC in C".This will be an exercise in programming, not finding some pre-existing code for that specific combination of light + replacement processor.

author: MrJoeyJoeJoe
author_rank: Contributor
timestamp: February 16, 2021, 10:11:14 am
content: Thanks a lot guys, I'll check out that other forum!