Hi.
I'm trying to connect my own home-made Moteino to AVRISP mkII programmer to flash the bootloader and fuses (see picture below).
When I connect power using ftdi adapter(5v) it start to blink orange.
Power is detected in Atmel studio. Then I click on "read" or "fuses" button and I get "Unable to enter programming mode" message. Programmer led starts to blink red.
Any idea what am I doing wrong ? Is it problem with my connection, or with Moteino (bad soldering or something) ?
Thanks.
(https://dl.dropboxusercontent.com/u/2261256/forums/ATMega328p.jpg)
Why you would need to do this eludes me, but my first guess is it's probably wrong wiring.
I forgot to say that I built this Moteino from scratch by myself, so I have to load bootloader to Atmega 328p.
Did you solder the radio already? If so use a 10k pullup on d10.
And double check your ISP wiring.
I didn't solder radio yet.
I'll recheck my wiring, but I think that wiring is fine (look picture in previous post).
Maybe I burned some components - It's my first moteino, soldered by hand :)
Ok assuming the wiring is fine the only other variable that I cannot check is the PCB which you soldered by hand.
I'll solder another one. It will probably be easier with hot air gun (I don't have smd toaster oven yet). So it's ok if I burn bootloader before I solder radio?
Thanks
Sure, but it's much harder unless you have a TQFP breakout adapter, something like this: http://www.adafruit.com/products/1240
I mean if it's ok to do it like on picture from my first post - without RF Radio module.
If I understood, you have to use resistor only if radio is already soldered.
Hi Felix.
I still can't get it to work.
Here is my wiring diagram:
(https://dl.dropboxusercontent.com/u/2261256/forums/moteino_avrisp_mkii.jpg)
Radio is not soldered. Should I solder it first ?
I saw that you're using pin D10 on your programming jig. Where should I connect that one ?
Thanks
A possible mistake is that while the MKII expects the programmed part to be self-powered, you don't need to hook the Vcc to the programmer, only GND. In fact you must not hook up unstabilized Vin voltage (which is potentially even higher than +5V) to the MKII.
What should I put to VCC leg#2 of MKII, nothing ? I've connected it to power from Lowpowerlab FTDI adapter and atmel studio detects 5V.
Quote from: Lukapple on March 31, 2014, 01:02:37 PM
What should I put to VCC leg#2 of MKII, nothing ? I've connected it to power from Lowpowerlab FTDI adapter and atmel studio detects 5V.
EDIT: well, sorry, I'm uncertain. I've only programmed Arduinos with the standard ISP connector using my MKII. For the Vcc to be detected by the programmer you might need to connect the Moteino 3.3 Vcc (not the Vin from the USB connector) to its Vcc. Try that, it won't be worse. Someone with greater experience might have a solution/more ideas. You might have a dodgy soldering somewhere also.
Switched to moteino 3.3V pin and it works !!! Device is now detected. Thanks a lot :)
Felix, or anyone, could you please post what exactly do I have to set to burn Optiboot bootloader. Just Fuses: ext:FD, hi:DC, lo:DE. ?
Quote from: Lukapple on March 31, 2014, 01:38:31 PM
Switched to moteino 3.3V pin and it works !!! Device is now detected. Thanks a lot :)
Cool, glad I could help. Just a note for later: reading up a little on the subject, I concluded that you _must_ connect the Vcc of the programmed part to the (original, unmodified Atmel) MK2, otherwise it won't detect the chip.
Thanks for info. It detects target voltage 2,9v.
Now it stopped working again. When I hit the "read" button for several times, sometimes I get message:
(https://dl.dropboxusercontent.com/u/2261256/forums/avrispmkii.jpg)
But most of time I get Reading device ID...Failed!
But first time I connected it to moteino VCC it worked.
I'll try to solder another Moteino. This one has probably some bad solder joints or something.
Quote from: Lukapple on March 31, 2014, 01:46:39 PM
Felix, or anyone, could you please post what exactly do I have to set to burn Optiboot bootloader. Just Fuses: ext:FD, hi:DC, lo:DE. ?
Yes first set the fuses you mentioned, then burn the bootloader. Optionally you can set the lock fuses to prevent any accidental bootloader overwrite with very large sketches but that's not generally necessary as long as you know what you're doing, so I'll say forget that part.
I've soldered another Moteino, this time in reflow oven, joints looks good.
This time I've built Moteino programming jig (like the one on your video Felix):
(https://dl.dropboxusercontent.com/u/2261256/forums/moteino_jig.jpg)
But I get same error. I'm not sure that wiring is ok. On your image MOSI and MISO looks inverted:
(https://dl.dropboxusercontent.com/u/2261256/forums/Moteino_programming_1.jpg)
And on your video, where you demonstate jig usage, there is some other version of jig, with another pogo on "3.3V OUT". I should probably connect VCC there ?
Felix could you please post some schematic of your programming jig ? or some closeup pics ?
Thanks!
I think you're looking at the connector the wrong way. It's a TOP view in that diagram, that's why you probably have everything mirrored hence thinking that I have MISO/MOSI inverted.
Pins are ok, pin#1(marked red cable + arrow on connector) is MISO. But if you look at your picture(previous post), MISO is yellow cable, which is connected to Moteino D11(MOSI).
However I've tried to connect Moteino that I bought from you to programmer and device is detected without any problems.
Before that I made some modifications to my programming jig - VCC is now connected to Moteino 3.3V.
Looks like there is some kind of problem with my homemade Moteino. Maybe voltage ? When I click on read voltage, I get 2,9V, but with your Moteino I get 3.3 V or something like that. If I hit read like 20x, if I'm lucky, chip is recognized 1x, but most of the time I get error.
Maybe some of smd components are not compatibile, I've used following components:
- MURATA Resonator 16MHz ±0,5% SMD -20°C~+80°C 1,3x3,2mm H=0,4mm
- YAGEO (PHYCOMP) SMD MLC Capac. 0805 10uF +80%, -20% 10V Y5V -55°C~+125°C CC0805ZKY5V6BB106
- YAGEO SMD Resistor 0603 1% 10K Taped 100ppm (it has marking "OIC" or "DIC" or "310" or something like that)
- 4x KERKO CHIP 0603 X7R 0,1uF 10% 50V
- Microchip Voltage Regulator LDO 3V 250mA SOT-23-3 -40°C~+125°C MCP1702T-3002E/CB
- OSRAM SMD-LED Yellow 7mcd 160° 0603 587nm LY-L29K-H1K2-26-Z
- YAGEO SMD Resistor 0603 1% 1,5K 1/10W Taped 100ppm -55°C~+155°C (this one is for LED, it has marking "188" or "100" or something like that)
Do you have any idea what else should I check ?
Hm... if my Moteino works fine and yours doens't, perhaps just something wrong on your assembled one. I connect 5V to VIN, and let the Moteino regulate down.
Try giving it a thorough cleaning with IPA to wash away some of the flux residues... not sure what else to suggest.
Hand assembly with soldering iron is probably not a very good idea as you get a lot of residue in there. I use brand no-clean unleaded paste which leaves very clean joints.
Thanks for suggestions. I'll try to solder few more in reflow oven.
Quote from: Lukapple on April 17, 2014, 08:16:16 AM
- Microchip Voltage Regulator LDO 3V 250mA SOT-23-3 -40°C~+125°C MCP1702T-3002E/CB
Did you deliberately choose the 3V part? If you didn't, it might be your source of problems. 3.3V is already on the edge OC'ing the 328p a bit, but 3V definitely won't cut it on 16 MHz.
Heh, yeah 3V might be OK, but I would recommend 3.3V.
Also IMPORTANT: did you solder the radio on the back of your DIY Moteino before programming?
Quote from: kobuki on April 17, 2014, 08:31:24 AM
Quote from: Lukapple on April 17, 2014, 08:16:16 AM
- Microchip Voltage Regulator LDO 3V 250mA SOT-23-3 -40°C~+125°C MCP1702T-3002E/CB
Did you deliberately choose the 3V part? If you didn't, it might be your source of problems. 3.3V is already on the edge OC'ing the 328p a bit, but 3V definitely won't cut it on 16 MHz.
I've two components on stock:
1. Microchip Voltage Regulator LDO 3,3V 250mA SOT23-3 -40°C~+125°C MCP1700T-3302E/TT
2. Microchip Voltage Regulator LDO 3V 250mA SOT-23-3 -40°C~+125°C MCP1702T-3002E/CB <-- used this one
Ah, now I see that it's actually 3V. I chosen this one, because I wanted to support input voltage up to 13V.
In Moteino BOM there is option to use:
- MCP1702 3v3 (up to 13V in)
but now I see that I have 3V instead of 3.3V.
I'll try to replace it with first option. Thanks for the hint !
p.s.
In Atmega 328p datasheet I found that operating voltage is:
– 1.8 - 5.5V for ATmega48PA/88PA/168PA/328P
Shouldn't it also work with 3V regulator then ?
Felix: Yes, radio is soldered.
And here are some closeup pics of my DIY Moteino:
front (https://dl.dropboxusercontent.com/u/2261256/forums/moteino_front.jpg)
back (https://dl.dropboxusercontent.com/u/2261256/forums/moteino_back.jpg)
Quote from: Lukapple on April 17, 2014, 08:40:31 AM
p.s.
In Atmega 328p datasheet I found that operating voltage is:
– 1.8 - 5.5V for ATmega48PA/88PA/168PA/328P
Shouldn't it also work with 3V regulator then ?
These are recommended min and max values, under various circumstances and configurations. They do not apply to every working condition. The image is from the actual datasheet of the chip. I'd recommend giving it a thorough read. Image: http://i.stack.imgur.com/98hvi.jpg (http://i.stack.imgur.com/98hvi.jpg)
Quote from: Lukapple on April 17, 2014, 08:47:23 AM
And here are some closeup pics of my DIY Moteino:
front (https://dl.dropboxusercontent.com/u/2261256/forums/moteino_front.jpg)
back (https://dl.dropboxusercontent.com/u/2261256/forums/moteino_back.jpg)
Ok your problem is that CS (d10) is floating around when the radio is installed.
You will need to add a pull-up resistor on that pin. Use a 10K from D10 to 3.3V. That should fix it as long as your assembly is solid.
Thanks a lot for help guys. I'll try with pull up resistor. If that won't work then i'll try to replace regulator with 3.3V.
P.s. Why it worked with your Moteino that also has radio on?
Because you're using 3.3V regulator?
It's aliveeeee, my first DIY Moteino ! Looks like that 10K pull up resistor helped!
Thanks a lot for help guys !
(https://dl.dropboxusercontent.com/u/2261256/forums/its_alive.png)
Nice to hear you succeeded. BTW, you mean, you're running it on 16 MHz and 3.0V? If so I'm definitely interested in long-term stability. It would make powering the Moteinos from cheap batteries even more viable.
Yes,I'm using 3V Voltage Regulator. I'll let you know if there will be any problems with stability.
I'd also be curious to hear about stability. Running an ATMega328p on 3.3v@16MHz is a little out of spec, 3.0v@16MHz should be a lot out of spec.
Quote from: Felix on April 17, 2014, 08:51:19 AM
Ok your problem is that CS (d10) is floating around when the radio is installed.
You will need to add a pull-up resistor on that pin. Use a 10K from D10 to 3.3V. That should fix it as long as your assembly is solid.
I'm a little confused. I have a "store" purchased Moteino w/RFM12b and it does not appear to have a 10k pullup between D10 and 3.3V. So what makes the resistor needed in this case and not in my case (assuming I just didn't miss the resistor while eyeballing the board)?
There is no 10k on the Moteinos on D10. That's needed for programming the RFM69 which floats the CS line, confusing the programmer. RFM12B doesn't do that.
I've tried to program another one, this time without RF module. Works fine without resistor. :)