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.

Support Forum » How to slow down the baud rate?

February 03, 2012
by jeffspc88mx
jeffspc88mx's Avatar

I replaced my PL2303 cable with a Keyspan RS232 one, and hooked it up to a MAX232N (Texas Inst.), then on to the mega168. (I replaced the PL2303 because I was having intermittent "programmer is not responding" errors)

ANYWAY: While it has worked on occasion, usually I now get intermittent errors of a different type - actually many types, depending on nothing. Here's what happened during my last three "makes" of initialload:

Octopod:initialload house$ make
avrdude -c avr109 -p m168 -b 115200 -P /dev/cu.USA19Hfd413P1.1 -e
Connecting to programmer: .
Found programmer: Id = "FDL v02"; type = S
Software Version = 0.2; No Hardware Version given.
{snip}
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9406
avrdude: error: programmer did not respond to command: set addr

Octopod:initialload house$ make
{snip}
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: error: programmer did not respond to command: leave prog mode

Octopod:initialload house$ make
{snip}
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9406 
avrdude: reading input file "initialload.hex"
avrdude: input file initialload.hex auto detected as Intel Hex
avrdude: writing flash (7772 bytes):
Writing | ###############                                    | 29% 0.33savrdude: error: programmer did not respond to  command: write block

...and so on. Each time it's a little different. SO: I'm guessing that something's just a little to slow to keep up and maybe (just maybe) if I slow it down a bit it'll work better. BUT: Just changing the baud rate in the makefile isn't working.

+++How do I change the baud rate?+++

And, of course, is this likely to be my problem? Or am I way off base?

February 03, 2012
by Rick_S
Rick_S's Avatar

You can't change the baudrate without re-compiling the bootloader and re-installing it. The bootloader on the MCU is set at 115200bps. Anything else computer side and you won't talk to it.

If you want to replace the NK cable, I'd go with one based on the FTDI FT232 chip. They don't require an RS232 to TTL adapter, and they perform well on both mac and PC. You can get them on Ebay or SparkFun for around $15.

Rick

February 04, 2012
by Ralphxyz
Ralphxyz's Avatar

You might want to follow this thread especially adding the sleep to the make file to slow down the compiler!

Ralph

February 04, 2012
by jeffspc88mx
jeffspc88mx's Avatar

Does this seem like a timing glitch? I mean, three attempts yielding three different types of "non-response" error, each at different points in the process, I'm going with timing glitch, but what I don't know about MCU programming could fill an EE textbook.

I'm about at the max baud for the max232 chip (120kpbs), which supports my "timing glitch" theory. Maybe I'll get the FTDI cable, but first I'll try doing this under Windows Vista as it seems that a LOT of Mac users are having problems.

Oh, and the sleep command didn't help - thanks though.

February 05, 2012
by Rick_S
Rick_S's Avatar

It's possible you got a bad max232. I've not had issues with any of the 232's I've used, but most I recall using have been the Maxim brand. (Not that brand should make a difference) If you still have issues and want to go that route, you could try the MAXIM MAX232A which has a 200kbps rating.

As for trying it on a PC instead of MAC, if you have it available, I'd go for it. It does seem the MAC is picky with it's USB/Serial adapters. I have used an FTDI232 based adapter on my MAC Mini (driver installed with the Arduino software) and it worked well even with the NK loader.

Rick

February 19, 2012
by jeffspc88mx
jeffspc88mx's Avatar

Thanks Rick - I got an FTDI232 and that seems to have done it.

Also, my USB->RS232->MAX232->TTL bridge may not have worked because it could be that my MAX232 setup wasn't correct (backwards tantalum capacitors, plus I didn't bother hooking up the capacitors which appeared to be optional, but perhaps weren't (something about a 15V power supply?)). Oh well. Threw away those caps, got a Maxim MAX232A chip just in case, and it's back to C.

Now waiting on more capacitors, but at least the old lady is talking to me again.

Post a Reply

Please log in to post a reply.

Did you know that you can build a circuit to convert the "dit" and "dah" of Morse code back into letters automatically? Learn more...