Go Down

Topic: Programming without Arduino (Read 6815 times) previous topic - next topic

aaroncm

#15
Jun 08, 2013, 06:33 am Last Edit: Jun 08, 2013, 08:16 am by aaroncm Reason: 1
Thanks guys,

I've built the exact circuits, for the programming and building it on the breadboard. Every component is exact, and I don't know if a /8 fuse is set or not, not even sure what that is yet (Second day with Arduino today) :p

All I know is I have built both circuits exactly the same (Programming and running the chip on the BB) and that I'm using a Uno chip pre-loaded with the boot loader that came with the 16Mhz Crystal.

For clarification, this is the exact item I purchased: http://www.freetronics.com/products/atmega328p-mcu-with-arduino-bootloader#.UbKzXpzvuuY

Attempting to program the chip results in a 5 second wait, and:

Code: [Select]
avrdude: stk500_getsync(): not in sync: resp=0x00

Thanks for any help in advance,

Aaron

Edit: If I bridge RX and TX from the circuit output to the chip, it returns what I send fine. :s

majenko

And you are pressing the reset button during that 5 second wait like I told you?

pito

Uploading without an automatic reset is a mess. Try to acquire a cheap usb/ttl from ebay (DTR or RTS connected to Reset via 100nF cap).
For example: http://www.ebay.com/itm/FTDI-Basic-6-PIN-3-3-5V-For-Arduino-Free-USB-Cable-/230820610037?pt=LH_DefaultDomain_0&hash=item35bdfafff5

majenko


Uploading without an automatic reset is a mess. Try to acquire a cheap usb/ttl from ebay (DTR or RTS connected to Reset via 100nF cap).
For example: http://www.ebay.com/itm/FTDI-Basic-6-PIN-3-3-5V-For-Arduino-Free-USB-Cable-/230820610037?pt=LH_DefaultDomain_0&hash=item35bdfafff5

You may have noticed I gave up mentioning those - it seems to have fallen on deaf ears...

pito

He may have other issues there as well. His PC rs232 may not accept positive only serial, looping via the interface is not a validation it works. I had spent ages with pushing the reset button, but resigned finally. One record of mine was 35 minutes of messing with the reset button in order to push single upload over (via a BT I must admit)..  :smiley-roll:

aaroncm

Yes, I've tried everything I could find on the reset, one second after the size output, a second before, just after, when it displays, everything. And it has not once programmed.

At the moment the Tx LED pulses 3 times and then nothing.

Oh and I have purchased a usb/ttl from eBay, obviously it would be stupid not to, however it's a long weekend, I won't have it for 5 days, and I don't mind going the extra length to get something working, especially if I get to build it myself. What gives?

Thanks

pito

I did some measurements with logic analyzer on the reset signal, how is the timing. Maybe I will find it in the older post somewhere.

aaroncm

I'll keep trying in case it's the reset =)

But if I bridge Tx/Rx on the TTL, anything sent will return echo back to the PC. Does this indicate a bad chip or something? Or could it still one of the issues you stated above? Maybe the speed is set higher than it can handle or something?

Thanks

pito

#23
Jun 08, 2013, 12:58 pm Last Edit: Jun 08, 2013, 01:00 pm by pito Reason: 1
Quote
But if I bridge Tx/Rx on the TTL, anything sent will return echo back to the PC. Does this indicate a bad chip or something?

Basically you have to maintain the voltage at the tx resistor (lower end of the R2 in your schematics) is always -3V or less (log1 with rs232). Therefore the diode and the capacitor there (in the schematics I sent you). What is your schematics actually?

aaroncm

Thanks for the reply,

at the moment, I'm using this schematic:



It seems to stick at -5v on idle, when a signal is being passed it sits at -1.45v.

pito

#25
Jun 08, 2013, 01:25 pm Last Edit: Jun 08, 2013, 01:33 pm by pito Reason: 1
I would increase the capacitor to 100u, and not sure whether 10k used there is not too big for 115k baud.  Try to use R4=1k, R3=1k, R5=1k. That may help to push the signal via the cable. Do not use 220ohm with LEDs, go with 1k or more.

Also mind the "handshake looping wiring" of certain signals at the rs232 connector - http://airborn.com.au/serial/rs232.html

BTW - there is RTS/DTR on your rs232 connector available I think, ask experts whether the avrdude is toggling them during the upload sequence (or do measure it). You may use it for an automatic reset then..

aaroncm

Tried everything, even those serial loop bridge things. Still doesn't want to talk.

I'll probably have to just wait it out for the adapter to arrive, feel free to throw any other ideas forward, will give them a go =P

Thanks pito  :)

pito

#27
Jun 08, 2013, 03:13 pm Last Edit: Jun 08, 2013, 03:29 pm by pito Reason: 1
I am always coping with swapped rx/tx lines. Check that again. When you have Terminal on (on your PC) and you touches with ttl/tx the gnd or Vcc you must see random characters coming to the terminal. That has to be connected to Tx on the chip. When you enter blabla in the Terminal, you must see activity on the ttl/rx pin. Idle ttl/rx/tx levels are HIGH (5V against the ground).

Start the upload in the IDE - set it to verbose output - and show us what you get (the avrdude codes).
Press shortly the reset button exactly (or 1 sec after) when it stops with "Compiling sketch" and starts with "Uploading.." - watch the IDE window. Your reset must have 10k pullup wired, decoupling capacitors must be there on Vcc, 16Mhz crystal with 2x22pF connected, LED against ground via 1k on D13 - it blinks after the reset few times (it depends on the bootloader setup). Serial set to 115k2 8N1, no handshake.

BTW what bootloader do you have inside?

aaroncm

Hmm tried all that... Still nothing  =(

How do I set the serial to 115k2 8N1 No handshake?

Output:

Code: [Select]
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM1
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.


Thanks

aaroncm

Well, the TTL adapter didn't arrive. But I ended up grabbing some new 22pF caps. Rebuilt the circuit, all out of boredom. It worked. I assume it was the old caps. They were ancient but I still don't see that causing defects.

But yep, circuit now working. Chip is flashing away through pin 13.  ;)

Go Up