Go Down

Topic: Problems with Serial Programming (Read 3385 times) previous topic - next topic

bromatt

First post! Be gentle!!  :smiley-roll-sweat:

I've breadboarded a ATMEGA328 and managed to bootload it (using the UNO) but I am having terrible troubles loading any sketches to it.  Thinking I'd possibly cocked up the bootloader / chip I jumpered it to the socket on the uno and managed to program it, however this is not ideal as I really want it to be re-programable in situ once its installed.

I've been using a CP2102 based, usb to serial converter to attempt the programming..

Used the following diagram,

http://www.miconbkk.com/shop/m/miconbkk/img-lib/spd_20120411163027_b.jpg

It seems to reset, but immediately goes back into the 'blink' program that I programmed using the uno, and I get the error; avrdude: stk500_getsync(): not in sync: resp=0x00.

Any ideas chaps!?  I've already checked the CP2102 is working (looped the TX>RX) and the DTR seems ok as  its reseting.  Is there any particular setting the IDE needs to be set to use the CP2102 > Serial (apart from setting the correct usb port!)  :smiley-roll:

Many thanks in advance!

Matt   :.
Got there in the end! :)

Nick Gammon

Quote
...  I jumpered it to the socket on the uno and managed to program it ...


OK, I'll be gentle, and welcome to the forum!

What is this "it" of which you speak?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nick Gammon

Stuff about minimal breadboards here:

http://www.gammon.com.au/forum/?id=11637
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

bromatt


Quote
...  I jumpered it to the socket on the uno and managed to program it ...


OK, I'll be gentle, and welcome to the forum!

What is this "it" of which you speak?


sorry managed to program the ATM328P.
Got there in the end! :)

bromatt

Checked out suggested page and looks like i am doing everything right, I am thinking could be the USB > Serial converter (the same error presents itself when I remove the TX/RX lines). Anyone else have any experiance with the CP2102 chipset adaptors with the arduino IDE??



Any help would be appreciated...

Regards

Matt
Got there in the end! :)

Nick Gammon

Where is that orange wire on the right going? The one connected to pin 2 of the chip.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

bromatt

Sorry its not very clear is it! Plus the colours dont match at the CP2102 end!!

Orange (pin2) > TXD on CP2102
Yellow (pin3) > RXD on CP2102

Regards

Matt
Got there in the end! :)

Nick Gammon

Is that capacitor in series with reset really 0.1 uF?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

bromatt


Is that capacitor in series with reset really 0.1 uF?


Yes, already swapped it out with another just to make sure it too! :(
Got there in the end! :)

bromatt

I rebuilt it following carefully http://shrimping.it/blog/shrimp/shrimpduino_bb_minimal/ and seem to have made some progress,  managed to program it a few times!

Programmed the blink sketch and noticed that the LED was flashing in a very non-uniform manner. Could the crystal be a bit duff??
Got there in the end! :)

wilson33

@bromatt..

No, I would assume that the wire is not connected properly.. try change it and tell us if you still have the same problem...

James C4S

Quote
Anyone else have any experiance with the CP2102 chipset adaptors with the arduino IDE??

Yes, lots of people have problems getting it to work out.

Most of those adapters have a pin called "RESET" which has nothing to do with resetting the Arduino.  You have to find a via on the breakout board that is connected to the DTR pin of the CP2102 and carefully solder a wire to it.  Or, manually reset your arduino when programming.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

cefn

@bromatt I recently experienced a blown/broken crystal, which didn't behave as you describe - the circuit simply didn't function. However, I don't know if there's any weird behaviour before one fails completely.

Without seeing the circuit in action, it sounds like it might be resetting for some reason, such as a temporary load which affects the voltage. If I'm right, the variation in blinking is therefore to do with it restarting the whole program again. I've seen this happen in unprotected circuits controlling motors, and it may reveal latent issues with having some contacts which are not conducting well for some reason (perhaps corrosion in the breadboard connections).

Protection from variations in load is one primary reason, as well as stable analog reference voltages, for the differences between the minimal programmable circuit at...
http://shrimping.it/blog/shrimp/shrimpduino_bb_minimal/
...and the more practical, protected circuit at...
http://shrimping.it/blog/shrimp/shrimpduino_bb/
...which is recommended for any substantial physical computing work.

Try the more protected circuit instead, and be sure everything is cleanly contacting.
http://shrimping.it

Docedison

Sort of Apropos the subject, Is there any real difference between the FTDI232, CP2102 and the PL2303 USB to TTL Adapters. I'd not given the subject much thought until this thread but for some reason (I own all) this question 'popped' up and I was wondering what if any difference there was practically and particularly. I will be doing a small pcb and I own a couple of the FTDI chips in a 'usable' (SSOP) package so my thought was that If there is a good reason to avoid any of the devices in particular... Which?. Jumpers are ok for this job as it is a picture frame with a 328 and a 3.2" Itead display and the pictures can be loaded onto the SD card and simply be 'plugged' in. If there is an advantage beyond immediate possession of the FTDI device I will include it on the board, If not then I will place a connector footprint rather than an IC footprint.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

bromatt

Hi Guys, Sorry for not keeping upto-date life does get in the way sometimes! :)

The original breadboarded layout I have pulled apart as I was practising getting 2x TLC5940 daisy-chained, I did notice some weird behaviour out of the breadboard (flickering led's) so I suspect that it might not be upto scratch so that is definitely one avenue - I'm going to give the 'shrimped' (am I using the correct terminology) another go, but this time going to build it on strip-board / matrix board - in t-he meantime however I purchased a RBBB Arduino http://shop.moderndevice.com/products/rbbb-kit from ebay - and put it together, works perfectly BUT still the CP2102 module refuses to play ball, but programs perfectly using RX/RT/RESET BLAH BLAH jumpered from a chipless Uno.

Doc: Differences,
FTDI232 - is the one that's used on the Uno itself!  Works!! (at least from the uno)
CP2102 - the one I have - very cheap! Works?? People say it does, I have faith!!
PL2303 - Pass! Never seen one.

There all USB > Serial Bridges - electronically they shouldn't make a jot of difference, i think the trade off is support/price/reliability..Given the choice again, i would go for the FTDI232! :P

Matt
Got there in the end! :)

Go Up