Hello,
I am trying to make a temperature logger without Arduino Duemilanove board. I would like to load the code on board Duemilanove then remove the chip and put it on breadbord with all the connections to sensor, RTC and SD card reader.
If I install Arduino IDE 1.6 and the appropriate internal clock configuration file then can I further program the chip using Arduino IDE 1.8 ? Because all the necessary libraries are installed to 1.8
AFAIK, you cannot do what you want. You must use arduino as ISP and load the code onto the chip while it is on the breadboard. There are several guides on how to do this: link - link - link.
You can load program code (a sketch) in the manner you have described. But that is not enough. You need a programmer, as has already been stated, or another Arduino configured as one to load the 8MHz boot loader and change the fuses to use the internal oscillator.
Your best option is probably to buy a new ATMEGA328P-PU chip and use your Duemilanove as an ISP programmer to burn the 8MHz bootloader onto the new chip. Then reconfigure the Duemilanove (as a USBTTL device) to upload sketches to the new chip.
Danois90:
Will the 16MHz oscillator/crystal on the board not be a problem in regards of the wanted internal 8MHz clock?
I've tried with an 8MHz 328P in an UNO and it did not work, on a breadboard with the chip removed from the UNO it was no problem, though
My experience is this, that if the fuses are set to use the internal oscillator, then the ATmega328P chip will ignore any crystal present. This fuse setting is done as a side effect of burning the bootloader for the chosen target board. I guess there may have been other factors which lead to the failure you described.
If, however, there is a mismatch between the clock frequency of the selected target board type in the IDE and the actual clock frequency of the board, then attempts to load a sketch may fail.
The correct order is:
Configure the ATmega328P chip so it matches its current fuse settings for the oscillator. This may mean, for example, (temporarily) adding a 16MHz crystal.
Connect an ISP programmer (or say a Uno configured as one) and select the target board type in the IDE, then select burn boot loader. This also sets the fuses.
Disconnect the ISP programmer and connect a USBTTL device (or say a Uno configured as one) and load a sketch. For this stage, it should even be possible to put the chip into a UNO etc., but the board type selected in the IDE must match that declared in 2 above.
I actually manage to get the ATMEGA328 work so that I loaded my code on Duemilanove board, removed the controller and put it on breadboard, where i added two 22 picofarad capacitors, one 16 MHz crystal and all the components of my project (SD card reader, RTC, LM35 temp sensor). And it is working.