Go Down

Topic: programming stand alone ATMEGA 2560 with usb 2 serial converter (Read 220 times) previous topic - next topic

weightwatcherphil

I have built a stand alone system with the ATMEGA 2560 and I have used an Arduino ATMEGA2560 as ISP to program my ATMEGA 2560 with a bootloader.  This worked well and I can use a FTDI to RS232 converter along with a RS232 to TTL converter to upload sketches.  I just connect +5v,Tx,Rx,GND and push my reset button and it works.  I then bought an arduino USB 2 serial converter and hooked up +5v,Tx,Rx,GND and pushed my reset button and it does NOT work.  I tested the USB 2 serial converter by tying Tx to Rx and I can see it echo characters.  So my question is has anyone successfully used the USB 2 serial converter to upload sketches to an ATMEG 2560 ?

one other thing when I use the USB 2 Serial converter I  can see my standalone ATMEGA2560 output info from a sketch I loaded using the FTDI to RS232 cable.

weightwatcherphil

On the Arduino page for the usb 2 serial converter it mentions

The adapter can easily connect to the Arduino Ethernet, Mini, Mini Pro, LilyPad, LilyPad Simple, and Fio.

I am wondering if it is too slow for the ATMEGA 2560


weightwatcherphil

on the USB 2 serial converter I see both the TX and RX leds light up.  Since I can see text from a previous sketch appear on the ARDUINO IDE serial monitor I am pretty sure I have the RX and TX hooked up correctly.  I did reverse them and I still cannot get a sketch to upload.

CrossRoads

Mega2560 runs at the same 16 MHz as all the other parts you mentioned. Post your 2560 schematic, maybe you're missing something in the reset circuit, like a 10K pullup, 0.1uF DTR cap, diode with anode to +5 to stop any spikes on the reset line from triggering the chip into high voltage programming mode and looking hung until it is reset.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

weightwatcherphil

my full schematic is five pages long.  I have attached the reset section.

my FTDI USB to RS232 through a RS232 to TTL adaptor works if I ground TP101 and then release it as the IDE starts with program uploading.
thanks
Phil

CrossRoads

Design looks ok.
Try File:Preferences, turn on verbose outputs.
Press & Hold Reset (TP101), when the IDE shows "compiled xxx bytes of 128xxx bytes" release Reset. Can be easier to get the timing of the release that way.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

weightwatcherphil

okay I will try that tomorrow. By the way I have the arduino/ Genuino Mega or Mega2560
as the board selection in the IDE.

weightwatcherphil

well I tried releasing the ground on TP101 as the IDE reported the "compiled xxx bytes of 128xxx bytes" and that did not work.  I noticed each time I release the ground on TP101 the TX led flashes but the RX led does not flash.  I tested my usb to micro usb cable on a DUE and it loaded code successfully.

I went to the send block on the serial monitor and when I put in some characters and hit send the RX led flashes.

When my program powers up I see the header that prints on the serial monitor screen.

I crossed the RX and TX leads and when I hit send on the serial monitor the string is echoed on the screen.

I think I have it wired correctly and the parts are all working.

I was wondering if anyone else has tried this and got it to work.

weightwatcherphil

well I got it to work.  The Arduino store said I had to connect the USB 2 serial converter reset line to my TP101 (atmega2560 reset pin) with a 10 uf cap.  I did this and it worked !!!!

so problem solved.  The USB 2 serial converter documentation does not mention this as far as I can tell.


weightwatcherphil

well the documentation does say a 100nf cap.  I tried that and it did not work so the larger 10 uf cap is needed.

weightwatcherphil

on the ATMEGA2560 product schematic there is a 100 nf cap.  But my standalone design with its five page schematic has more stuff attached to the reset line than just the ATMEGA2560 cpu.  so I am guessing that is why I need to use a larger cap.

Go Up