Pages: 1 [2] 3   Go Down
Author Topic: Cheapest way to program standalone project  (Read 3075 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@dc42
I've not managed to get it working so smiley-sad

I'm using this set of parts
http://www.oomlout.co.uk/component-bundle-for-arduino-compatible-arcb-p-227.html

and have wired it up like this
http://arduino.cc/en/Tutorial/ArduinoToBreadboard (1st image)

which (if I've understood thinks properly smiley ) is the equivalent of connecting ICSPs together as per your blog.

Any suggestions?

Simon
PS I' m the IDE attempts to upload, after a minute it comes up with this error
Code:
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Next hardware purchase, try this:
http://www.nkcelectronics.com/arduino-runtime-board-rev-b.html
All 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.html
or this
http://www.nkcelectronics.com/ftdi-basic-breakout.html
Make 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.html
This 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/15R0268
http://www.mouser.com/ProductDetail/Atmel/ATMEGA328P-PU/?qs=sGAEpiMZZMtVoztFdqDXO6rEZqxeooRg

I bought a tube of 10, planning ahead some and also taking advantage of the price break.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@crossroads
Why spend £5 when you can spend £0 smiley

At them moment, I'm hoping the $5 lead from Hong Kong will do the job WHEN it arrives smiley

In the meantime, I'll continue to try it the cheap (but hard way) smiley

Simon
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@dc42
Quote
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 smiley [edit]correction from Gnd and 5V ![/edit]
Quote
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 smiley
Quote
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 Offline
Brattain Member
*****
Karma: 331
Posts: 16548
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Got one strapped between GND and 5V on Uno

I hope you mean ground and reset pin?

Lefty
 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I hope you mean ground and reset pin?
Yes - I did smiley
Simon
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@dc42
I'm running into the same error msgs as h4t smiley-sad

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
Quote
unknown MCU 'm328au' specified
(in my case its m328 as thats the name I tried to give mine)

This is a good game smiley

regards
Simon
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@dc42
BTW
Quote
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 smiley-sad

Simon
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I've got into cmd line AVRDude territoy now.

Using this
Code:
avrdude -b 19200 -p atmega328p -C ..\etc\avrdude.conf -c stk500v1 -P com2
I'm getting
Code:
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
(if I remove the power lead from my Uno to the breadboard I get
Code:
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
Code:
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 smiley-sad
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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

Quote
I'm assuming that COM2 really is the port that your Arduino appears on - mine appears on COM5.
I hope so smiley 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 smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally making progress in a forward direction  smiley-grin
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 smiley-sad

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 smiley

Simon
Logged

Pages: 1 [2] 3   Go Up
Jump to: