Arduino IDE 2: greyed/disabled Tools->Ports with USBasp programmer

HP Pavilion 17", Linux Mint 20, Arduino IDE 2: greyed/disabled Tools->Ports with USBasp programmer and ProMini m168 connected to USB. Avrdude does connect with programmer/ProMini m 168 showing basic parameters of arduino pcb. Arduino IDE doesn't see this USB connection, why? Can anybody advice?

Hi @gbk77. The USBasp is a pure USB device. It does not produce a serial port.

So it is normal and expected that you won't see a serial port in the Tools > Port menu of Arduino IDE for the USBasp. This is also not a problem because no serial port is required to do "Burn Bootloader" or "Upload Using Programmer" operations using the USBasp.

So everything is fine and you can get back to your Arduino project.

If you are experiencing some actual problem, you can come back here with a detailed description of the problem, including the full and exact text of any error or warning messages, and we'll help you out.

Thank You Ptillisch for the answer. The trouble, however, I have with programming/uploading any code to ProMini m168, via USP and USBasp. Arduino says: error - no serial port. Is it normal? How to upload m168 with any code? The original errors are translated into Polish - not very heplful for You, I suppose.

Hi again, You are right. It works !!! :). I tried before with upload, not upload with programmer. So thank You very much. But I have two kinds of ProMini: m168 and m168p and... with the second chip I cannot find it on the list of chips. How to upload (with programmer:) m168p? Difference - m168 id: 0x1e9406 and m168p id: 0x1e940b. Kind regards

Great progress!

As you noticed, the official "Arduino AVR Boards" platform does not provide support for the ATmega168P microcontroller. The reason is that this chip was not used on any official or partner Arduino board.

Fortunately the excellent 3rd party "MiniCore" boards platform does provide support for the ATmega168P. I'll provide an overview of the use of "MiniCore" with the ATmega168P:

  1. Install "MiniCore" by following the instructions provided under the "Boards Manager Installation" section of its documentation:
    https://github.com/MCUdude/MiniCore#boards-manager-installation
  2. Select Tools > Board > MiniCore > ATmega168" from the Arduino IDE menus.
  3. Select Tools > Variant > 168P / 168PA from the Arduino IDE menus.
  4. Select Tools > Programmer > USBasp from the Arduino IDE menus.

After doing that, you should be able to upload to the ATmega168P-based Pro Mini board using Sketch > Upload Using Programmer.


Due to the enhanced capabilities of "MiniCore" there is another optional procedure you can perform to enhance the usability of your Pro Mini. A boot section is normally reserved on the Pro Mini boards for the bootloader that allows uploading via the serial port. If you are exclusively uploading to the board via the USBasp then you don't need that boot section and it is only taking up significant amount of precious flash memory for no reason. "MiniCore" has a configuration option that allows you to use the full capacity of the flash memory on the ATmega168P for your sketch application. I'll provide instructions you can follow to do that if you like:

  1. Connect the USBasp to the ATmega168P-based Pro Mini and your computer.
  2. Select Tools > Bootloader > No Bootloader from the Arduino IDE menus.
  3. Select Tools > Burn Bootloader from the Arduino IDE menus.
  4. Wait for the "Burn Bootloader" operation to finish successfully.

The reason the "Burn Bootloader" operation is required is to adjust the boot section on the ATmega168P using the configuration fuses of the microcontroller.

After doing that, you will notice the IDE allows you to use the full 16 kB of flash memory for your sketch application.

I'm very grateful for Your help, Ptillisch. I'm new here and impressed by Your professional engagement. Thank You very much. Great helpful work.
I'm going to set my first useful arduino project with 1302 real time clock for LED light control for my wife's chicken coop :). Light on at 6:00AM and off when daylight ON. Any directions?

You are welcome. I'm glad if I was able to be of assistance.

My recommendation is that, if you would like to request assistance or discuss your project with the forum community, you should start a new dedicated forum topic for that purpose. That will make it more likely for the people who can make valuable contributions to see it.

Regards,
Per

Thank You. I'll consider starting the new topic. But for now how to get/import the library for RTC 1302 "ArduinoRTClibrary". I've got a sample code with #include <virtuabotixRTC.h> at the beginning, but I suppose I have to add these library, how to do it?

Please provide a link to where you found that sample code.

Thanks again. The first sample code is wrong - concern another RTC device, I suppose. I've found GitHub - Treboada/Ds1302: A C/C++ library to use DS1302 RTC chip. - seems good. Compiler, however, throw "PlatformIO" error. I don't understand the "arduino project" construction: what file in what directory should be placed. Exactly the problem concern the pin assignment (DAT, CLK and RST/ENA). This assignment is codded in platformio.ini but arduino ide compiler doesn't take it.

It works just fine for me.

I'm going to ask you to post the full output from a compilation.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select Sketch > Verify/Compile from the Arduino IDE menus.
  2. Wait for the compilation to fail.
  3. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  6. Press Ctrl+V.
    This will paste the compilation output into the code block.
  7. Move the cursor outside of the code tags before you add any additional text to your reply.
  8. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (image) on the post composer toolbar:
    Upload icon on toolbar
    A dialog will open.
  6. In the dialog, select the .txt file you saved.
  7. Click the "Open" button.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

You don't need to think about it at this point in your learning journey.

Install the library using the Arduino IDE Library Manager and Arduino IDE takes care of putting the library files in the correct directory structure.

Use the File > New Sketch, and File > Save As... features of Arduino IDE to create and save sketches and Arduino IDE will automatically create the correct sketch directory structure.

Yeah, that was a very silly thing the library author did. Sad. Just use normal variables in the sketch. For example:

byte PIN_ENA = 2;
byte PIN_DAT = 3;
byte PIN_CLK = 4;
Ds1302 rtc(PIN_ENA, PIN_CLK, PIN_DAT);

Arduino:1.8.19 (Linux), Płytka:"Arduino Pro or Pro Mini, ATmega168 (5V, 16 MHz)"

arduino-builder -dump-prefs -logger=machine -hardware /usr/share/arduino/hardware -tools /usr/share/arduino/hardware/tools/avr -libraries /home/gbk/Arduino/libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega168 -ide-version=10819 -build-path /tmp/arduino_build_539190 -warnings=all -build-cache /tmp/arduino_cache_580277 -prefs=build.warn_data_percentage=75 -verbose /home/gbk/Arduino/zegar_02_1302/zegar_02_1302.ino
arduino-builder -compile -logger=machine -hardware /usr/share/arduino/hardware -tools /usr/share/arduino/hardware/tools/avr -libraries /home/gbk/Arduino/libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega168 -ide-version=10819 -build-path /tmp/arduino_build_539190 -warnings=all -build-cache /tmp/arduino_cache_580277 -prefs=build.warn_data_percentage=75 -verbose /home/gbk/Arduino/zegar_02_1302/zegar_02_1302.ino
Using board 'pro' from platform in folder: /usr/share/arduino/hardware/arduino/avr
Using core 'arduino' from platform in folder: /usr/share/arduino/hardware/arduino/avr
Detecting libraries used...
"/usr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-I/usr/share/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/share/arduino/hardware/arduino/avr/variants/eightanaloginputs" "/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp" -o "/dev/null"
"/usr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-I/usr/share/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/share/arduino/hardware/arduino/avr/variants/eightanaloginputs" "-I/home/gbk/Arduino/libraries/Ds1302/src" "/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp" -o "/dev/null"
"/usr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-I/usr/share/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/share/arduino/hardware/arduino/avr/variants/eightanaloginputs" "-I/home/gbk/Arduino/libraries/Ds1302/src" "/tmp/arduino_build_539190/sketch/zegar_02_1302.cpp" -o "/dev/null"
Using cached library dependencies for file: /home/gbk/Arduino/libraries/Ds1302/src/Ds1302.cpp
Generating function prototypes...
"/usr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-I/usr/share/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/share/arduino/hardware/arduino/avr/variants/eightanaloginputs" "-I/home/gbk/Arduino/libraries/Ds1302/src" "/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp" -o "/tmp/arduino_build_539190/preproc/ctags_target_for_gcc_minus_e.cpp"
"/usr/bin/arduino-ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_539190/preproc/ctags_target_for_gcc_minus_e.cpp"
Kompilowanie szkicu...
"/usr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-I/usr/share/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/share/arduino/hardware/arduino/avr/variants/eightanaloginputs" "-I/home/gbk/Arduino/libraries/Ds1302/src" "/tmp/arduino_build_539190/sketch/zegar_02_1302.cpp" -o "/tmp/arduino_build_539190/sketch/zegar_02_1302.cpp.o"
"/usr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega168 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-I/usr/share/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/share/arduino/hardware/arduino/avr/variants/eightanaloginputs" "-I/home/gbk/Arduino/libraries/Ds1302/src" "/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp" -o "/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o"
Compiling libraries...
Compiling library "Ds1302"
Użycie wcześniej skompilowanego pliku: /tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o
Compiling core...
Using precompiled core
Linking everything together...
"/usr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega168 -o "/tmp/arduino_build_539190/zegar_02_1302.ino.elf" "/tmp/arduino_build_539190/sketch/zegar_02_1302.cpp.o" "/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o" "/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o" "/tmp/arduino_build_539190/../arduino_cache_580277/core/core_arduino_avr_pro_cpu_16MHzatmega168_1621df717313d057c92202babd71649a.a" "-L/tmp/arduino_build_539190" -lm
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::init()'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_end()'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_nextBit()'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_readByte()'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_writeByte(unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_setDirection(int)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_prepareRead(unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::isHalted()'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::getDateTime(Ds1302::DateTime*)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_prepareWrite(unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::halt()'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::setDateTime(Ds1302::DateTime*)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_dec2bcd(unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
/tmp/arduino_build_539190/libraries/Ds1302/Ds1302.cpp.o (symbol from plugin): In function Ds1302::Ds1302(unsigned char, unsigned char, unsigned char)': (.text+0x0): multiple definition of Ds1302::_bcd2dec(unsigned char)'
/tmp/arduino_build_539190/sketch/zegar_02_1302.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
Użycie biblioteki Ds1302 w wersji 1.0.4 z folderu: /home/gbk/Arduino/libraries/Ds1302
exit status 1
Błąd kompilacji dla płytki Arduino Pro or Pro Mini.

It looks like maybe you copied the library files into your sketch.

Select File > New Sketch from the Arduino IDE menus and then start over from scratch.

This sketch code should compile without any problems:

/** GetDateTime.cpp
 *
 * Example of getting the date and time from the RTC.
 *
 * @version 1.0.1
 * @author Rafa Couto <caligari@treboada.net>
 * @license GNU Affero General Public License v3.0
 * @see https://github.com/Treboada/Ds1302
 *
 */
#include <Ds1302.h>

// DS1302 RTC instance
byte PIN_ENA = 2;
byte PIN_DAT = 3;
byte PIN_CLK = 4;
Ds1302 rtc(PIN_ENA, PIN_CLK, PIN_DAT);

const static char* WeekDays[] = {
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday",
  "Sunday"
};


void setup() {
  Serial.begin(9600);

  // initialize the RTC
  rtc.init();

  // test if clock is halted and set a date-time (see example 2) to start it
  if (rtc.isHalted()) {
    Serial.println("RTC is halted. Setting time...");

    Ds1302::DateTime dt = {
      .year = 17,
      .month = Ds1302::MONTH_OCT,
      .day = 3,
      .hour = 4,
      .minute = 51,
      .second = 30,
      .dow = Ds1302::DOW_TUE
    };

    rtc.setDateTime(&dt);
  }
}


void loop() {
  // get the current time
  Ds1302::DateTime now;
  rtc.getDateTime(&now);

  static uint8_t last_second = 0;
  if (last_second != now.second) {
    last_second = now.second;

    Serial.print("20");
    Serial.print(now.year);  // 00-99
    Serial.print('-');
    if (now.month < 10) Serial.print('0');
    Serial.print(now.month);  // 01-12
    Serial.print('-');
    if (now.day < 10) Serial.print('0');
    Serial.print(now.day);  // 01-31
    Serial.print(' ');
    Serial.print(WeekDays[now.dow - 1]);  // 1-7
    Serial.print(' ');
    if (now.hour < 10) Serial.print('0');
    Serial.print(now.hour);  // 00-23
    Serial.print(':');
    if (now.minute < 10) Serial.print('0');
    Serial.print(now.minute);  // 00-59
    Serial.print(':');
    if (now.second < 10) Serial.print('0');
    Serial.print(now.second);  // 00-59
    Serial.println();
  }

  delay(100);
}

Ptillisch - You are the great man (in my eyes:). Compilation and upload completed successfully. I'm grateful indeed. Only one last step to perform. How to see/confirm that the code is running properly on the laptop screen?. My arduino programming knowledge is not advanced... Only one code line more, please...

This sketch is configured to print the date and time obtained from the RTC to the Arduino IDE Serial Monitor.

You can learn how to use Serial Monitor from this tutorial:

Please let me know if you have any questions or problems while using it.

I've read this tutorial. I've found out, that arduino 2 has serial-monitor easy accessible. I've installed it, but now I have on the serial output monitor:
Not connected. Select a board and a port to connect automatically.
"Port" is still greyed/inactive.
So, 1.8.19 does compile and upload successfully and gives no feedback. 2.2.1 gives serial monitor, but not connected.

Sorry, I forgot you were using a USBasp to communicate with your Pro Mini instead of a USB to serial adapter. There is no way to get feedback from the board on your computer through the USBasp programmer.

The most convenient solution is a USB to serial adapter (AKA "FTDI") like this:

The Pro Mini board has a six pin header on one end that is meant specifically for connecting one of these modules, so if you buy one make sure to get the kind with the standard "FTDI header" pinout:

  • DTR or RTS
  • RX
  • TX
  • VCC
  • CTS
  • GND

You will find that some of these modules have that pinout and some have a non-standard pinout. You can use either one, but if you get the one with the non-standard pinout you'll need to use jumper wires to make the connections.

You can purchase these modules from any electronics parts supplier (e.g., SparkFun, Adafruit, DigiKey, Mouser) or online marketplace (e.g., Amazon, eBay).


For now without a usable communication channel between the board and the computer, you'd need to improvise some other way of getting feedback from the board. You already have one feedback mechanism, which is the LED on pin 13 of the board. You can add code to the sketch to blink the LED to indicate what is happening in the code. Beyond a simple "heartbeat" blink that only says the program is running, you can use patterns of blinks to communicate more information. Go all the way to using Morse code if you like!

You might have other electronics components that could be more convenient as a feedback mechanism. For example a display would be ideal.

Thank You. nevertheless I've learn much of Your directions. Its a pity, but I have got tiny/naked m168, without USB port. I will try another way to get progress...

You can still use a USB to serial adapter to get serial communication with a bare microcontroller. It isn't so convenient as plugging it into the FTDI header on a Pro Mini board, but it is easy enough to do because you only need to make a few connections using jumper wires.

So I would still recommend purchasing one of those modules. You won't benefit so much from selecting one with the standard pinout, but I would still recommend doing that because you might eventually use it with one of the boards that has the "FTDI header".


My suggestions for alternative feedback methods still hold as well. Even if you don't have a built-in LED as is the case with the Pro Mini, you can always connect an LED to one of the pins on the ATmega168P microcontroller (making sure to use a current limiting resistor in series) and blink it to your heart's content.

OK, thanks. I tried this way.
counter limit is following now.second, now.minute, now.hour etc and blue led (on the board:) is blinking each time 1/second - that mean second, minute, hour are ZERO thus rtc.setDateTime(&dt) and/or rtc.getDateTime(&now) doesnt work properly. Why?
Code:
void setup() {
Serial.begin(9600);

// initialize the RTC
rtc.init();

 // test if clock is halted and set a date-time (see example 2) to start it
if (rtc.isHalted())
{
    Ds1302::DateTime dt = {
        .year = 23,
        .month = Ds1302::MONTH_OCT,
        .day = 25,
        .hour = 17,
        .minute = 52,
        .second = 0,
        .dow = Ds1302::DOW_WED
    };
    rtc.setDateTime(&dt);
}

}

void loop() {
// get the current time
Ds1302::DateTime now;
rtc.getDateTime(&now);

for (int counter = 0 ; counter <= now.second; counter = counter +1)
digitalWrite(LED_BUILTIN, HIGH);
delay (250);
digitalWrite(LED_BUILTIN, LOW);
delay (250);

delay(1000);
}