I have made a breadboard-arduino with an ATMega-328PU and the standard components taking help from Building an Arduino on a Breadboard. I interfaced the CT2102 Breakout Board with this assembly:
DTR - SCK
RXI - MOSI
TXO - MISO
RTS - Pin 1 On the ATMega
Before everything else, I downloaded ans installed the CP210x Drivers from their website. Now, it does come up on the list of "Attached USB devices" in the terminal window through the command ls /dev/cu.*
and ls /dev/tty.*
To check if everything's working correctly, I issued the "Read Fuses" command which:
avrdude -P /dev/cu.SLAB_USBtoUART -b 19200 -c avrisp -p m328p -v
I hit the reset switch on the breadboard: following what hoipolloi said on Arduino Sketch upload issue – avrdude: stk500_recv(): programmer is not responding.
No luck! avrdude failed saying:
avrdude: stk500_recv(): programmer is not responding
Can anyone please help?
I tried connecting it with cu
command, it says connected. But when I try reading data off of it (fuses) with
avrdude: initialization failed.
Best Answer
Please note that there are different ways to program a bare AVR and an "Arduino":
The bare AVR does not have a booloader pre-installed. Therefore, it can only be programmed via an AVR in-circuit programmer (ISP) (hardware!). This uses the RESET, MISO, MOSI, and SCK pins (see the "Bootloading" section).
avrdude
can then be used for example to upload the bootloader.Quote: "if you purchased some extra Atmega8 or Atmega168 chips from an online store they will have NOT been bootloaded with the Arduino bootloader (with the exception of Adafruit Industries). [...] You won't be able to program your chips using the USB to serial breakout board and the Arduino software [...]"
Only after the AVR has been set up with the Arduino bootloader can it be programmed via the USB-to-Serial adapter you already have. This connects to the TXD and RXD pins (and possibly also to the RESET pin).
Quote: "Connect the RX (pin 2) of your Atmega chip to the TX of the USB to serial board, and connect the TX (pin 3) of your Atmega chip to the RX of the USB to serial board."