(...)
So: what causes problems with uploading the batch to the Arduino microcontroller using AVRPascal?
Thank you for your comment and detailed description of this case. I will check it in th evening. Did you try use your Arduino Uno clone with unchecked option "Notify of connection or disconnection of supported device" (and restart AVRPascal)?
As suggested, I disabled the "Notify the connection or disconnection of supported device" option in
AVRPascal, located on the
Uploader tab in the
Options dialog. I closed
AVRPascal and then restarted it and checked if the option was disabled by closing the
Options dialog with the Cancel button. Then I did some tests using the files:
- TestBlink.pas
- TestBlinkWithoutDelay.pas
- TestSerial.pas
The upload test after compiling the
TestBlink.pas file was successful the first time. I closed
AVRPascal and then disconnected the USB cable from the Arduino board. Then I reconnected it and restarted
AVRPascal. I loaded the
TestBlinkWithoutDelay.pas file, compiled it and ran the upload, which failed (10 attempts to communicate with the
Arduino board from
avrdude). However, I noticed that during these communication attempts, the TX and RX LEDs on the
Arduino board seemed to flash (very short flashes, unfortunately I initially missed which ones were flashing). I re-ran 2 more tests on the files:
- TestBlink.pas - avrdude communicated with the Arduino board on the 4th attempt and programmed the Arduino,
- TestBlinkWithoutDelay.pas - avrdude communicated with the Arduino board on the 7th attempt and programmed the Arduino,
- TestSerial.pas - avrdude communicated with the Arduino board immediately and programmed the Arduino.
After programming the
Arduino with the batch from the compiled
TestSerial.pas program, the board works as expected, i.e. when sending a string of characters from the computer to the
Arduino and receiving a response from the
Arduino, the TX and RX LEDs are clearly visible flashing on the computer and the response sent from the
Arduino is displayed on the serial port monitor.
I performed another test, which consisted of another attempt to load the batch from the complicated
TestSerial.pas file. I launched the upload –
avrdude made 10 attempts to communicate with the Arduino board, without success. This time I observed the TX and RX LEDs. During each attempt, short flashes of the RX diode on the
Arduino board were visible. I repeated the upload of the batch from the compiled
TestSerial.pas file once more. This time, the
Arduino was programmed immediately without any problems. I performed another test, which consisted of reloading the
TestBlink.pas program, compiling it and then uploading it to the Arduino. The
avrdude program made 5 attempts to communicate, after which it managed to program the board on the 6th attempt.
I performed several tests on the above source files again. Some of them were successful after several attempts of communication between
avrdude and
Arduino, while others failed at all. I performed the tests with the
Define baud rate option enabled and disabled (set to 9600). I did not notice any impact of this option on the success (or failure) of the upload. It seems as if the upload is taking place randomly, but there is definitely a specific reason for the upload problems. I also noticed that during attempts to establish communication between
avrdude and
Arduino, in the Task Manager next to the
AVRPascal process in the Status column, the entry
Not Responding appears and disappears.
I'll try to do some more testing in the next few days using another computer. It has both Windows 10 and Linux installed. I'm also planning to order two AVR microcontrollers (ATtiny13A-PU and ATmega16A-PU) and a USBasp compatible programmer so I can do some breadboard testing (I've only experimented with PIC microcontrollers so far).
I have conducted several experiments with AVRPascal, in two sessions.
(...)
So: what causes problems with uploading the batch to the Arduino microcontroller using AVRPascal?
Could you show avrdude command line parameters used to upload your code in Arduino IDE 2.3.3? You can set verbosity in File->Preferences->Show verbose output during upload.
As for the option to display details of the
avrdude call in the
Arduino IDE, I have it set since installation. The
avrdude call is as follows:
"C:\Users\Ja\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Ja\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -patmega328p -carduino "-PCOM5" -b115200 -D "-Uflash:w:C:\Users\Ja\AppData\Local\Temp\arduino\sketches\2EA4A341383756C7852978801EA8BA99/FastBlink.ino.hex:i"