Author Topic: RFM69 causes ATMega328p to brick in ISP mode [solved]  (Read 4347 times)

Lensdigital

  • Full Member
  • ***
  • Posts: 155
    • Lensdigital
RFM69 causes ATMega328p to brick in ISP mode [solved]
« on: January 06, 2015, 09:57:05 PM »
I'm working on a fun project, similar to Moteino, but coin cell battery powered and running at 8Mhz.  Thing is, I keep destroying ATMega328p chips and I absolutely don't understand why it's happening.  I'm using USBTiny ISP programmer, and it works great (I can upload bootloaders, change fuses) until I solder RFM69 chip (I tried with both RFM69W and RFM69CW). If I have bootloader loaded prior to adding RFM chip, I have no issues using board and upload sketches via FTDI. But as soon as I try uploading bootloader, it bricks MCU. It no longer accepts serial programming :(   Schematic is very similar to Moteino... I tried uploading different bootloaders to Moteino R2 and it worked fine.
I found few more people reporting same issue with 8Mhz bootloader and RFM chip.
Oh and it gets even more sad, as I'm using SMD chip, so no hope of recovering them with parallel programmer :(
« Last Edit: January 08, 2015, 08:50:41 AM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #1 on: January 06, 2015, 10:26:49 PM »
Some big red flags:
USBTinyISP is not an official AVR programmer, I would never use that. I have reports that it's flaky sometimes.
You need a pullup on the CS line of the RFM69 otherwise it will introduce gibberish on the SPI bus (which is also shared by the ISP programmer). So the CS needs to be pulled up during programming otherwise your USBTinyISP might load bogus fuses into the mega - which is what I bet is actually happening.
If you coin cell power this, you should reduce the TX power of the RFM69 to minimum since the coin cell cannot supply 45ma for W and 130ma for HW in TX mode.

Lensdigital

  • Full Member
  • ***
  • Posts: 155
    • Lensdigital
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #2 on: January 06, 2015, 10:58:12 PM »
Wow thanks Felix! I actally added pull-up but never soldered it! Didn't know that my ISP flakey, I will buy a better one asap! Which is Recommended?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #3 on: January 06, 2015, 11:14:08 PM »
I would get an AVRISP MK-ii.
I think they are discontinued though, you might still find them on some websites or on ebay. But make sure it's a genuine one.
If you can't find it then Atmel must have designed a new one, I just never investigated what the replacement is since I already have one.

Lensdigital

  • Full Member
  • ***
  • Posts: 155
    • Lensdigital
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #4 on: January 07, 2015, 10:25:14 AM »
I would get an AVRISP MK-ii.
I think they are discontinued though, you might still find them on some websites or on ebay. But make sure it's a genuine one.
If you can't find it then Atmel must have designed a new one, I just never investigated what the replacement is since I already have one.
I see ATmel still sells mk2 directly, crazy shipping charges tho...
BTW I think I found a way to unbrick my SMD chips!  There's a HV Rescue sheild, which works with DIP versions of AVRs which I knew about for a while, so I've been trying to figure out how to adapt it to QFP32 package and discovered today that they actually have solder-less (kind of zif) adapters! 

Just ordered one on eBay :)  Of course I'll still need to desolder chip from my PCB, but that's super easy to do with hot air station...

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #5 on: January 07, 2015, 12:02:46 PM »
Good luck with that. I used to do that in the old days, but now my time is not worth to try and rescue the few failed boards that happen from time to time.
BTW the HVRescue shield method will not unbrick all chips, only about 6 out of 10 will unbrick, at least that's my experience, so for me its a complete waste of time.

Lensdigital

  • Full Member
  • ***
  • Posts: 155
    • Lensdigital
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #6 on: January 07, 2015, 02:06:03 PM »
I hear you :)  But I think it's a nice tool to have. Besides I can use it burn bootloaders to the SMD chips until I make pogo pin jig...
BTW the HVRescue shield method will not unbrick all chips, only about 6 out of 10 will unbrick, at least that's my experience, so for me its a complete waste of time.
Oh no, I had no idea :(  I thought it works 100% unless chip is physically damaged...

EDIT: Forgot to mention, I had absolutely no issues with using CR2032 3V battery with RFM69W chip at default setting. I didn't test it for long, but I just left board in the shed where temperature at night went below 0C.  I configured it to send temperature/humidity and battery voltage every 5 minutes. Voltage didn't go below 2.84V, and when I brought it back inside after 2 weeks, battery went back to 3+V. I think it can last for year at least...
« Last Edit: January 07, 2015, 02:31:57 PM by Lensdigital »

Lensdigital

  • Full Member
  • ***
  • Posts: 155
    • Lensdigital
Re: RFM69 causes ATMega328p to brick in ISP mode
« Reply #7 on: January 07, 2015, 10:15:38 PM »
Just wanted to follow up. Felix you were absolute right about pullup resistor! As soon as I added it, I now have no issues burning bootloaders!!! Thank you so much!!!