Pages: [1]   Go Down
Author Topic: Atmega328, Arduino Boot, can't program with serial in IDE  (Read 1039 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally, after soem time fiddling with fuse settings, i have managed to flash the arduino bootloader and some working sketches and into an Atmega328 via AVR-ISP (actually pololu)

Now what i would really love to is to upload sketches right from the IDE using nothing more than a tiny usb-to-serial module (CP210), but i'm finding it to be a huge pain.

Serial is working, i've read all the sections in the troubleshooting, tried different reset timings, but nothing so far...
... any ideas would be appreciated.
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Now what i would really love to is to upload sketches right from the IDE using nothing more than a tiny usb-to-serial module (CP210), but i'm finding it to be a huge pain.

So do we assume the CP210 lacks the DTR signal needed to utilize a auto-reset on your 328 chip? Manual reset is a tricky timing, if you don't have auto-reset avalible. When I do a manual reset I press and hold down the reset switch and then press upload on the IDE. When the IDE prints the size of the compiled sketch is when to release the reset switch.

What timing method are you using to try and upload sketches? Have you tried a 'loop back' test using the arduino serial monitor to prove out the functionality of the CP210 module? If not, wire a tempory reset to ground on the 328P and wire a jumper from arduino pins 0 & 1 (328p pins 2 & 3). plug in the CP210, open the ARduino IDE, select the proper comm port for the CP210, open the serial monitor, whatever you type and send from the monitor output window should be received back in the input window.

Lefty

Logged

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

When the IDE prints the size of the compiled sketch is when to release the reset switch.

After much trial and error i finally succeeded, mainly due to the above.

I'm not sure if CP210x has the DTR signal, but the cheapo module i have doesn't (may try to hack it later).

I'm not sure what you mean by 'timing bethod', but sketches on the 328 would print to serial just fine.

Also, because i was also testing using the AVR-ISP for flashing (added a new board to the boards.txt), it would nuke the bootloader and as such there would be no way for the upload to succeed using serial  until flashing the loader again.
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After much trial and error i finally succeeded, mainly due to the above.

Great, so all is solved for now?

I'm not sure if CP210x has the DTR signal, but the cheapo module i have doesn't (may try to hack it later).

I think either the DTR or RTS signal will do the same reset feature. This signal needs to wire to a series .1mfd capacitor and then onto the reset pin on the 328. That would allow the IDE to reset the chip at the proper time before the upload begins.

I'm not sure what you mean by 'timing bethod', but sketches on the 328 would print to serial just fine.

I just meant that manual resetting before uploading must to timed correctly to work.

Also, because i was also testing using the AVR-ISP for flashing (added a new board to the boards.txt), it would nuke the bootloader and as such there would be no way for the upload to succeed using serial  until flashing the loader again.
Logged

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

I think either the DTR or RTS signal will do the same reset feature. This signal needs to wire to a series .1mfd capacitor and then onto the reset pin on the 328. That would allow the IDE to reset the chip at the proper time before the upload begins.

Many thanks, will try that!
(I'm kind still a bit new to both arduino and electronics in general, so help is very much appreciated.)

Update:

All it has is RST pin (causing the COM port do reset and not the mega :/)
I think will probably need a different 'not so cheap' (this was only about 3€ to be fair) module that brings the proper signals next time; but for now i guess it'l do.
« Last Edit: June 12, 2011, 10:01:01 am by jcinacio » Logged

Pages: [1]   Go Up
Jump to: