Flashing driver using Arduino

8 posts / 0 new
Last post
YuvalS
YuvalS's picture
Offline
Last seen: 5 hours 8 min ago
Joined: 09/26/2018 - 10:39
Posts: 444
Flashing driver using Arduino

Hi all,
I am new to the world of flashing driver.
My first attempt was flashing a ToyKeeper BLF A6 firmware on BLF A6  A17DD-L FET + 1 driver.

Since I don't yet have the proper hardwear, I am using Arduino board to flash the driver connected to the MCU using soldered wires.

While connecting to the Arduino everything works perfectly and also when I only use the arduino as power supply (only GND and 5V connected).

But when I disconnect everything and try to use a 18650 as a power source, nothing works - the LED is not turn on.

Voltage between terminal is 4v.

Do you have any advices? 

Thanks


My FW repository

My BLF/OL contest entries: 7th 8th 9th 

Flashy Mike
Flashy Mike's picture
Offline
Last seen: 4 days 17 hours ago
Joined: 01/14/2016 - 16:38
Posts: 1222
Location: Germany

I hope you connected positive and negative correctly. Check the voltage at the Attiny then – perhaps the schottky diode is defect. You might also have left a solder bridge somewhere. Check all pins against ther neighbors for shorts.

YuvalS
YuvalS's picture
Offline
Last seen: 5 hours 8 min ago
Joined: 09/26/2018 - 10:39
Posts: 444

Flashy Mike wrote:
I hope you connected positive and negative correctly.
 
Connection is correct 
Flashy Mike wrote:
Check the voltage at the Attiny
 
It is 4v, shouldn't it be same as terminals?  
Flashy Mike wrote:
then - perhaps the schottky diode is defect.
 
What should I check? 
Flashy Mike wrote:
You might also have left a solder bridge somewhere. Check all pins against their neighbors for shorts.

No shorts, pin 3 and 4, are shortly beeps and also 7 and 8 but it is the same with my other (new) driver

My FW repository

My BLF/OL contest entries: 7th 8th 9th 

Flashy Mike
Flashy Mike's picture
Offline
Last seen: 4 days 17 hours ago
Joined: 01/14/2016 - 16:38
Posts: 1222
Location: Germany

YuvalS wrote:

Flashy Mike wrote:
I hope you connected positive and negative correctly.
 
Connection is correct 
Flashy Mike wrote:
Check the voltage at the Attiny
 
It is 4v, shouldn’t it be same as terminals?  
Flashy Mike wrote:
then – perhaps the schottky diode is defect.
 
What should I check? 
Flashy Mike wrote:
You might also have left a solder bridge somewhere. Check all pins against their neighbors for shorts.

No shorts, pin 3 and 4, are shortly beeps and also 7 and 8 but it is the same with my other (new) driver

The voltage at the Attiny should be about 0.3 Volts less than at the cell due to the diode. You might have disconnected a pin of the Attiny when you unsoldered the wires. Or it might be fried but they are pretty tough.
Difficult to say what more could be damaged, perhaps if you post a picture.
mrheosuper
Offline
Last seen: 2 months 3 weeks ago
Joined: 09/30/2016 - 12:44
Posts: 1515
Location: Ho Chi Minh City, Vietnam

Do you flash right fuse?

Forgot my pen

YuvalS
YuvalS's picture
Offline
Last seen: 5 hours 8 min ago
Joined: 09/26/2018 - 10:39
Posts: 444

Flashy Mike wrote:
YuvalS wrote:

Flashy Mike wrote:
I hope you connected positive and negative correctly.
 
Connection is correct 
Flashy Mike wrote:
Check the voltage at the Attiny
 
It is 4v, shouldn't it be same as terminals?  
Flashy Mike wrote:
then - perhaps the schottky diode is defect.
 
What should I check? 
Flashy Mike wrote:
You might also have left a solder bridge somewhere. Check all pins against their neighbors for shorts.

No shorts, pin 3 and 4, are shortly beeps and also 7 and 8 but it is the same with my other (new) driver

The voltage at the Attiny should be about 0.3 Volts less than at the cell due to the diode. You might have disconnected a pin of the Attiny when you unsoldered the wires. Or it might be fried but they are pretty tough. Difficult to say what more could be damaged, perhaps if you post a picture.

 

Thanks Mike, 
I think it might be the diode.

I didn't desolderd the wires from the MCU, I keep them soldered in order to continue practicing flashing code. I only disconnect the wires from the Arduino board when connecting to battery.

I didn't notice the diode is in series to MCU, so when connecting to Arduino 5v I connected id directly to pin 8 

My FW repository

My BLF/OL contest entries: 7th 8th 9th 

YuvalS
YuvalS's picture
Offline
Last seen: 5 hours 8 min ago
Joined: 09/26/2018 - 10:39
Posts: 444

mrheosuper wrote:
Do you flash right fuse?

 

Actually I don't know, the code sayes:

FUSES
 *      I use these fuse settings
 *      Low:  0x75  (4.8MHz CPU without 8x divider, 9.4kHz phase-correct PWM or 18.75kHz fast-PWM)
 *      High: 0xfd  (to enable brownout detection)

But I can't find where it is burned to the MCU 

http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/view/he...

 

My FW repository

My BLF/OL contest entries: 7th 8th 9th 

YuvalS
YuvalS's picture
Offline
Last seen: 5 hours 8 min ago
Joined: 09/26/2018 - 10:39
Posts: 444

mrheosuper wrote:
Do you flash right fuse?

After some reading in the Attiny Datasheet and other sources about the fuse, mrheosuper was correct and the problem was in the fuse settings.

In case, someone will have the same problem in the future:

The tutorials on the web for flashing MCU using Arduino include burning bootloader. During the burning of bootloader the fuse is also burned.
In order to use the same fuse settings as toykeeper set the BOD to 1.8v and clock to 4.8 MHz internal (under tools menu at the Arduino IDE).

Thanks mrheosuper for the Tip.

My FW repository

My BLF/OL contest entries: 7th 8th 9th