Home        Store        Docs        Blog

Signs of life after flashing processor?

(Alexander) #1

Hello, again. I’ve assembled and programmed a Blue ESC and would like some advice on the next steps.

I am using a AVRISP XP II programming tool and Atmel Studio 7. With the logic board connected to the power board, flashing is not possible - the power supply powering the ESC collapses and goes into current limit just as the “Program” button is pushed. I suspect that this is due to the fact that the MOSI pin is serving double duty as the L_PWM_CL pin, and applying a signal to it during programming is also causing a MOSFET to operate.

Separating the two boards, and supplying ~10Vdc to the logic board Vbat allows the programming tool to recognize, and program, the processor. I am programming blueesc_id0.hex into flash, with nothing in the EEPROM. I’ve tried leaving the BOOTRST fuse both set and cleared, with the same results; I have verified that the flash is written correctly.

After the processor is flashed, I reconnect the logic and power boards and apply power, with no results - no LED activity, no MOSFET switching. I’ve tried this with no PWM input, and using a Servo Tester.

Any help would be appreciated,


(Rusty) #2


You can program with both boards attached if you power it with 5V directly to a 5V pin instead of the main power lines.

I’m not sure why nothing is going on. I would try setting the fuses to the recommended settings. Here’s the programming line needed for that:

avrdude -c usbtiny -p m8 -U lfuse:w:0x3f:m -U hfuse:w:0xca:m

I believe these set the processor speed so that will probably help.

Sorry I was slow to respond to this!


(Alexander) #3

Rusty, thank you for the help.

I was worried about applying +5V to the assembled stack because this also applied the voltage to the output of the 5V regulator - something usually to be avoided. In any case, if the processor has power and ground, and the AVR programmer tells me that the firmware is installed, I expect signs of life after the power is re-cycled - there are still none.

The problem with programming while assembled is that the the MOSI pin is also the L_PWM_CL pin, and applying +5V to it during programming closes a MOSFET and creates a bus short - I’ve verified this manually.

Your fuse recommendations (Lower=0x3f Upper=0xca) are consistent with the those in the bluesc.hex file, and the ones I’m currently using when flashing the processor.

What’s the significance of the EEPROM data? Calibration only, or do I need code there for functionality?

BTW, I am using an external 16Mhz resonator and an Atmega ATMEGA168PA-AN processor - is that correct?

Cheers, -Alex


(Rusty) #4

Hi Alexander,

As long as you leave the main power disconnected then I think it’s fine to power directly with 5V. The linear regulator should be fine with that and since the main power is disconnected, activating a MOSFET won’t cause any issues.

The EEPROM data is written by the microcontroller but you do not have to initialize the EEPROM with anything. I think it is used to store calibration values but the calibration is disabled in our firmware.

Our firmware files are compiled for the Atmega8A microcontroller. I don’t think they’ll work with the 168PA! That’s probably the issue. I would recommend recommend trying the Atmega8A.



(Alexander) #5

Rusty, I think you’ve found the problem - thank you again.

In the Eagle model, the part is labeled externally as an ATMEGA8, but the device “type / gate” is ATMEGA 168; I should have asked for clarification. Now, to de-solder a TQFP-32…

Cheers, -Alex

(Rusty) #6

Yeah - I used a 168 footprint since they are the same but relabeled it. Sorry for the confusion!


(Alexander) #7

Hey, it’s an open-source design. I appreciate you guys doing all the heavy lifting, and providing tech support! Thank you again, -Alex

(Rusty) #8


Of course! I hope it works out for you.