NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Program with real serial cable

July 17, 2012
by lnino
lnino's Avatar

Hi at all.

my USBtoSerial Nerdkit cable seams to have some problems since yesterday.

Maybe driver, software, windows or something else.

Know I would try another way.

I have a serial card with real serial ports in my pc and a real serial cable. DB9 to DB9

Which pins of the DB9 Cable do I have to connect on my breadboard to be able to flash it like I did it with the USBtoSerial cable?

Does someone know?

July 17, 2012
by lnino
lnino's Avatar

I also have a USBasp. WIth the USBasp I flash the bootloader.

Do I can also flash new programs to my atmeg168 like I did it with my serial-to-usb Nerdkit cable?

But how?

Do I have to change the make file? Or do I have to use a different command, oder program?

Maybe someone has a clue.

July 17, 2012
by pcbolt
pcbolt's Avatar

Hi Inino -

You have to be careful using a DB-9 cable. The RS-232 protocol uses +/- 12v (approx) on the TX/RX lines. You need a way to convert down to +5v / 0v for data exchange to the MCU. I've used a dedicated MAX232 chip to do this, unfortunately it only works with the RX and TX pins. I think for serial line programming, you need the RTS/CTS/DTR lines along with the TX line, which are all connected to the SPI of the MCU. Also, you'd have to change the AVRDUDE flags in your makefiles from "avr109" to "dasa". I've never used the USBasp, but if you were able to flash the bootloader, you should be able to flash any program you wish the same way. I don't know the specifics though.

July 18, 2012
by Rick_S
Rick_S's Avatar

If you look through the NK guide, you'll see some photo's of their older serial adapter (at least in the guide available for me to download). That was the adapter I got when I purchased my Nerdkit a few years ago. This is what it looked like:

programmer

This has worked well for me with my pc's built in serial port. I don't know if they still have any around or not, you could send them an email. Otherwise, as pcbolt said, a max232 works well. I will also repeat his warning... do not tie the rs232 lines directly to your micro. The micro uses TTL level serial logic NOT rs232 levels. Direct connection could damage your micro.

As for the USBASP, You can use that as well to program, you just have more wires to connect. You also may run into problems if your project uses the same wires as the USBASP. It's all a preference thing...

Rick

July 18, 2012
by Ralphxyz
Ralphxyz's Avatar

What a nice looking serial adapter, I'd like to have one.

What is the IC?

Ralph

July 18, 2012
by Rick_S
Rick_S's Avatar

That is the one I got with my Nerdkit. It has a 74HCT14 on it.

July 18, 2012
by Ralphxyz
Ralphxyz's Avatar

Are the four wires the same as the current Nerdkit USB cable?

Red          power
Yellow       pin 2 RX
Green        pin 3 TX
Black        ground
July 18, 2012
by lnino
lnino's Avatar

Thanks for the replies.

I have removed the driver of the serial cable and reinstalled it.

After that everything worked fine. Strange, but glad it Works.

July 18, 2012
by Rick_S
Rick_S's Avatar

Are the four wires the same as the current Nerdkit USB cable?

Red          power
Yellow       pin 2 RX
Green        pin 3 TX
Black        ground

Yep, I'm guessing you must get a different NK guide than I get as this is the one pictured on page 35 step 7b Wire up the Programming Header of my guide.

Rick

Post a Reply

Please log in to post a reply.

Did you know that first-order systems have a exponentially decaying response to step inputs? Learn more...