Stand alone ATMega328p

Have I got this straight?

  1. The purpose of the bootloader is to facilitate ATMega328p communication with an IDE.

  2. Assuming the bootloader is loaded on the ATMega328p, with an FTDI connector on a Stand alone ATMega328p, uploading and troubleshooting (using Serial.print) would be possible via a USB to serial adapter board.

  • Scotty

If by "FTDI connector" you meant "ICSP Header", then that is correct by my understanding.

scottyjr: Have I got this straight?

  1. The purpose of the bootloader is to facilitate ATMega328p communication with an IDE.

  2. Assuming the bootloader is loaded on the ATMega328p, with an FTDI connector on a Stand alone ATMega328p, uploading and troubleshooting (using Serial.print) would be possible via a USB to serial adapter board.

  • Scotty

There are two ways to upload a sketch using the Arduino IDE.

  1. Using serial communications link via USB serial connection (that could be a FTDI serial converter cable, module, or chip mounted on the standalone board. This method first requires a bootloader to have been installed on the 328p chip using a ICSP hardware programmer using the ICSP pins on the target standalone board. This same USB serial link can then later be used in your sketches to communicate with the arduino IDE serial monitor.

  2. Using a hardware ICSP programmer one can upload a sketch from the IDE using the upload using programmer option in the ICSP. So the same method to burn a bootloader onto a standalone chip can also be used to burn a sketch onto the chip, making a bootloader not required if using this method. Note you must use a hardware programmer that the arduino IDE supports, which can just be another arduino board running the arduinoISP sketch. However this method does not allow one to communicate with a PC via serial communications to the IDE serial monitor unless one also has a FTDI USB serial converter cable, chip, or module installed on the standalone board. If you do have a FTDI device for the standalone board you can use that to communicate with the arduino serial monitor no matter if you are using a bootloader or not.

Does that answer your question?

Lefty

Here’s a summary -

Atmel AVR microcontrollers are programmed using a programmer through SPI (Serial Peripheral Interface). The process of doing this is known as ISP (In Service Programming) or ICSP (In Circuit Serial Programming).

Most microcontrollers do not understand USB, so need the USB signals to be converted to UART signals - this is done on the older boards by a dedicated chip designed for this purpose, manufactured by FTDI. The newer boards use another AVR microcontroller to do this conversion.

  1. The bootloader allows programming of the microcontrollers flash memory without using a programmer and the SPI interface, instead - it allows you to program the flash memory over USB.

  2. On a standalone board, yes - you can use an external converter cable/board. OR - buy a programmer (such as the AVR ISP MK II) and simply connect it to the SPI pins on the microcontroller.

I use nearly all standalone boards for my projects, I program the chip on the Arduino board, unplug the chip and plug it into the socket on the standalone board...

I use all standalone boards for my projects as well, but I put an ICSP header in and program the uC on the board, the program is never quite right the very first time unless a working board is being duplicated.

You can thank CrossRoads for my reply - he was the one that provided me with the answers when I had the same questions!

I use standalone home made customised board for my projects and successfully using following low cost serial port adopter without removing the ATMEGA 328 chip from the standalone board. I can debug and burn the sktetch with it successfully. Keep in mind TX and RX signals are reversed…
http://dx.com/p/jy-mcu-usb-serial-port-adapter-download-line-arduino-104322

Yes, I stupidly used the SPI pins for an IDC gen purpose connector on my little board I generally use for small projects.

I have worn out 2 sockets on my Arduinos ! But I must have plugged/unplugged hundreds of times .

I have to redesign it sometime, so I think I must put the ISP socket on too.

Perhaps I will look to see if there is a proto board that I can buy readymade, I will do a search when my current projects are done.

Perhaps I will look to see if there is a proto board that I can buy readymade, I will do a search when my current projects are done.

That is the way to go as many cost no more then the parts consumed to make an equivalent standalone or built into a larger PCB project. Just a matter of figuring out the features you need or not need like on-board +5vdc regulator or not, serial pins broken out or not, ICSP pins broken out or not, crystal, ceramic, or no external clock needed, etc.

Lefty

I have 2 boards I made, that I tend to use all the time, one is just the chip with xtal and basic components,and a 10way IDC socket and pads for the other pins. The other has 4 TPIC6B595 shift registers with 10 way IDC sockets to go to 7 seg LED panels , another 10way IDC to daisychain further display drivers. The panel could take the wireless 433 MHz receiver I used to use.

Time for me to move on, I see one of our top ( Faraday? Edison ? Shannon ? ) members has a very comprehensive list of Arduino accessories for sale - I just can't get time to look ( I am taking Christmas day off for the family , thats it for holidays )

Another has a board that works out cheaper to buy than to make here in Cape Town , even without the set up cost . I dont know about the duty.

Thank You, Gentlemen, for your responses. I understand more clearly now and the info helps me in with deciding what path to take for a stand alone ATMega. What I plan to do is install the bootloader onto the 328s I have using an Arduino Uno. In the future I will most likely purchase 328s with the bootloader already installed. Since I want to be able to use the serial monitor for troubleshooting and since I already have a USB to serial adapter, I will include a header that will have Pin 1 = GND, Pin 2 = N.C., Pin 3 = VCC, Pin 4 = TX to RX, Pin 5 = RX to TX, Pin 6 = Reset.

Do I understand this right? FTDI uses TX & RX. ICSP uses Mosi, Miso & Sck. ICSP can install the bootloader and upload sketches. FTDI can load only sketches. FTDI only can be used for debugging through the serial monitor.

  • Scotty

Once you have installed the bootloader using ICSP (MOSI/MISO/SCK/RESET) then you can upload subsequent sketches using the bootloader and Tx/Rx pins. Generally you would use an FTDI cable to do that, as it converts serial back to USB.

ICSP can also upload sketches, for example if you wanted to do away with the bootloader, for faster start-up plus get back the memory the bootloader uses.

Do I understand this right? FTDI uses TX & RX. ICSP uses Mosi, Miso & Sck. ICSP can install the bootloader and upload sketches. FTDI can load only sketches. FTDI only can be used for debugging through the serial monitor.

Yes, that is it in a nutshell. Only thing I would add is that the FTDI can also supply a DTR signal that can be used to auto-reset the standalone board from the IDE automatically when uploading a new sketch. You can work without using the DTR signal but you have to have a reset swtich installed on the standalone board and learn how to time a manual reset at the correct time for the upload to work from the IDE.

Lefty

"I will include a header that will have Pin 1 = GND, Pin 2 = N.C., Pin 3 = VCC, Pin 4 = TX to RX, Pin 5 = RX to TX, Pin 6 = Reset.

You need GND on pin 2 also as CTS input to the FTDI chip.

Hello, I have a big question on ICSP :-)

If I would to use an stand alone ATMEGA328 and download Arduino programs by ICSP converter. Can you help me saying what must I do ?

Best regards Bernard

Generally, you need a 2x3 male header connected to MISO, MOSI, SCK, Reset, +5, Gnd. Connect your AVR ISP to these pins, select your board, programmer, and load the bootloader: Tools: Board:Uno generally Tools: Programmer:select yours Tools: Burn Bootloader

Do you have Atmega328 or Atmega328P?

ICSP Header: 1 MISO 2 +5V 3 SCK 4 MOSI 5 Reset 6 GND

See here for a discussion:

http://www.gammon.com.au/forum/?id=11637

bernard46: If I would to use an stand alone ATMEGA328 and download Arduino programs by ICSP converter. Can you help me saying what must I do ?

There is some guidance on using ICSP at http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/.

Hello,

few explanation of my question ...

I know very well ATMEGA for 10 years (ATMEGA8....ATMEGA128). In the past, I worked without bootloader + WINAVR + AVRDUDE + ICSP programmer.

My last AVR programmer is this one : Pocket AVR Programmer : https://www.sparkfun.com/products/9825?

I recently discover Arduino, I like this Environnement, the community,... and I would like to switch to Arduino environnement. Problem : the time of upload. This point is very important because I work with 10 little robots and I must to upload each new program on its.

I compare the time of uploading by USB-to-serial converter on the Arduino and my ICSP/AVR programmer. For me, the upload with my AVR programme ICSP is very very fast then USB-to-serial converter on the Arduino. I tested with a Blink program and one big program about 30ko.

Do you test that ?

So, I try to understand the utility the Arduino bootloader in my configuration ? Perhaps, is it possible to work in the Arduino Environnement, don't upload the Arduino Bootloader and upload only my programs.

One other information. I think if I would like to debug step by step with JTAG, I must destroy the Arduino Bootloader on the ATMEGA. Do you have an idea of that ?

Best regards