|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #16 on: August 14, 2011, 01:26:00 pm » |
Next hardware purchase, try this: http://www.nkcelectronics.com/arduino-runtime-board-rev-b.htmlAll parts needed can be found at www.dipmicro.com really inexpensively. Put the uController in a socket. For programming: http://www.nkcelectronics.com/breakout-board-for-ft232rl-usb-to-ser232.htmlor this http://www.nkcelectronics.com/ftdi-basic-breakout.htmlMake a 6-pin cable that can plug from one to the other for downloading sketches: Vcc, Gnd, Reset, Tx, Rx, Or use an ISP programmer http://www.nkcelectronics.com/pocket-avr-programmer.htmlThis one comes with a 10pin to 6pin cable to plug onto the UCSP header. Then if some accident happens again during development you only need replace the ATMega328 (or 168 if you decide you can live with less memory). With the programmer you can also easily download bootloaders, so you don't need to buy blank parts and save a few dollars. 3-4 projects and it pays for itself. http://www.newark.com/atmel/atmega328p-pu/ic-8bit-mcu-megaavr-20mhz-dip-28/dp/15R0268http://www.mouser.com/ProductDetail/Atmel/ATMEGA328P-PU/?qs=sGAEpiMZZMtVoztFdqDXO6rEZqxeooRgI bought a tube of 10, planning ahead some and also taking advantage of the price break.
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4694
|
 |
« Reply #17 on: August 14, 2011, 03:41:53 pm » |
Hi,
1. Yes the first image in that tutorial is equivalent to what I suggested in my blog, except that you also need the capacitor connected to the Uno to suppress the auto reset.
2. Since you bought the MCU with bootloader already programmed in, you should be able to upload a sketch to it using the second image in that tutorial, if you don't mind it always running the bootloader before it runs your program.
3. What is the exact marking on the MCU? The "Invalid device signature" might mean that your mcu is an atmega328 instead of atmega328p. The marking in full should be ATMEGA328P-PU. There is a fix for this if your device doesn't have a P in the right place.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #18 on: August 14, 2011, 03:44:23 pm » |
@crossroads Why spend £5 when you can spend £0  At them moment, I'm hoping the $5 lead from Hong Kong will do the job WHEN it arrives  In the meantime, I'll continue to try it the cheap (but hard way)  Simon
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #19 on: August 14, 2011, 03:55:39 pm » |
@dc42 1. ..except that you also need the capacitor connected to the Uno to suppress the auto reset. Got one strapped between GND and Reset on Uno  [edit]correction from Gnd and 5V ![/edit] 2. Since you bought the MCU with bootloader already programmed in, you should be able to upload a sketch to it using the second image in that tutorial, if you don't mind it always running the bootloader before it runs your program. I don't care if it makes a cup of tea as long as it uploads and works  3. What is the exact marking on the MCU? Well on using the sort of image enhancing tools used in Blade Runner I've managed to decipher the black writing on black plastic as saying ATMEGA?28-PU (where the ? is truely indecipherable!) Hopefully this is my issue and you'll be winging an answer on its way to me :-) Simon
|
|
|
|
« Last Edit: August 14, 2011, 04:34:53 pm by simplesi »
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15340
Measurement changes behavior
|
 |
« Reply #20 on: August 14, 2011, 04:16:25 pm » |
Got one strapped between GND and 5V on Uno I hope you mean ground and reset pin? Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #21 on: August 14, 2011, 04:33:38 pm » |
I hope you mean ground and reset pin? Yes - I did  Simon
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4694
|
 |
« Reply #22 on: August 14, 2011, 04:36:19 pm » |
Sounds like you have the ATMEGA328-PU instead of ATMEGA328P-PU. You need to edit the avrdude.conf file. See http://arduino.cc/forum/index.php/topic,68889.0.html.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16579
Available for Design & Build services
|
 |
« Reply #23 on: August 14, 2011, 04:59:56 pm » |
simplesi, I like to acquire a tool now & then to have it in place for the next project. I also don't like waiting 3 weeks for parts from the far east.
That's also why I wirewrap a lot of my projects - can be done in a day, vs waiting weeks to have a board that needs to be assembled still. Altho with iteadstudio's 10 100x100mm boards for $29.90 delivered, I am learning to be more patient!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #24 on: August 14, 2011, 05:46:11 pm » |
@dc42 I'm running into the same error msgs as h4t  Basically just changing the signature in avrdude.conf makes no diff - same error msg. Adding in new entrys in avrdude.conf and adding a new board just gives the unknown MCU 'm328au' specified (in my case its m328 as thats the name I tried to give mine) This is a good game  regards Simon
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #25 on: August 14, 2011, 06:05:47 pm » |
@dc42 BTW 2. Since you bought the MCU with bootloader already programmed in, you should be able to upload a sketch to it using the second image in that tutorial, if you don't mind it always running the bootloader before it runs your program. I believe I can't use the second method because I can't remove my soldered in 328 in my Uno  Simon
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #26 on: August 15, 2011, 05:09:23 am » |
Well I've got into cmd line AVRDude territoy now. Using this avrdude -b 19200 -p atmega328p -C ..\etc\avrdude.conf -c stk500v1 -P com2 I'm getting avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. (if I remove the power lead from my Uno to the breadboard I get avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50 avrdude: initialization failed, rc=-1 which I think shows that I've got some of the wires corrected properly) So I got very brave an attempted to force upload a new bootloader C:\Apps\arduino-0022\hardware\tools\avr\bin>avrdude -b 19200 -p atmega328p -C ..\etc\avrdude.conf -c stk500v1 -P com2 -F -U flash:w:optiboot_atmega328.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. avrdude: Expected signature for ATMEGA328P is 1E 95 14 avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: reading input file "optiboot_atmega328.hex" avrdude: input file optiboot_atmega328.hex auto detected as Intel Hex avrdude: writing flash (32748 bytes):
Writing | ################################################## | 100% 0.56s
avrdude: 32748 bytes of flash written avrdude: verifying flash memory against optiboot_atmega328.hex: avrdude: load data flash data from input file optiboot_atmega328.hex: avrdude: input file optiboot_atmega328.hex auto detected as Intel Hex avrdude: input file optiboot_atmega328.hex contains 32748 bytes avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 37.58s
avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x0000 0xff != 0x00 avrdude: verification error; content mismatch
avrdude: safemode: Fuses OK Which as you can see failed miserably 
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4694
|
 |
« Reply #27 on: August 15, 2011, 08:18:38 am » |
Looks like it failed right from the start, because 0x000000 doesn't look like a valid device signature. I suspect that the mcu isn't responding to the programming commands at all. I would check the breadboard wiring and the wiring to your Arduino very carefully. You might consider posting a photo of it.
You are right, I forgot your mcu was soldered in when I suggested uploading your program as shown in the second diagram.
I'm assuming that COM2 really is the port that your Arduino appears on - mine appears on COM5.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #28 on: August 15, 2011, 02:47:05 pm » |
Looks like it failed right from the start, because 0x000000 doesn't look like a valid device signature. I suspect that the mcu isn't responding to the programming commands at all. I would check the breadboard wiring and the wiring to your Arduino very carefully. You might consider posting a photo of it. I've rebuilt the circuit on a different breadboard and as soon as I work out how to upload an image on this forum I'll post it I'm assuming that COM2 really is the port that your Arduino appears on - mine appears on COM5. I hope so  My compuer initially assigned my Uno to COM26 but COM2 was free so I changed it in Device Manager - Ports - Ardunio - Properties -Port Settings - Advanced (I'm on XP) just in case anything had a problem with high com port numbers 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 48
|
 |
« Reply #29 on: August 15, 2011, 05:23:50 pm » |
Finally making progress in a forward direction  I came across http://www.adafruit.com/forums/viewtopic.php?f=25&t=19260&start=0 thread and downloaded optiloader and modified it so that it did not attempt to program but just read the signature of the connected MCU. As before, with all other attempts using AVRDude and my Uno running ArduinoISP - signature came back as 0  I tried all sorts of lead replacements and then I finally removed the 2 small caps across the crystal and now optiloader is returning a sig of 9514 (the sig for an ATMega328-PU) So I'm off to start again with ArduinoISP - wish me luck  Simon
|
|
|
|
|
Logged
|
|
|
|
|
|