Forum > Embedded - AVR
AVRPascal – free code editor for FPC for AVR
ccrause:
--- Quote from: ackarwow on August 03, 2025, 10:11:14 am ---@ccrause,
Yes, it is possible. I modified slightly usb.pas to be more compatible with Arduino source (attached) but I'm not sure if it will help. Have you tried writing a similar test program to the Arduino Sketch to make sure that Arduino code is working correctly? What are the connections in your test environment (I mean hardware and circuit)?
PS. I am using Arduino 1.8.19
--- End quote ---
I'm using a Leonardo board for testing. To test the hardware serial I use a USB-serial converter connected to pins 0 and 1 (not that the hardware serial should be a consideration here). Below an Arduino sketch that works as expected (built in Arduino 1.8.15):
--- Code: C [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---#define LEDpin 8 void setup() { // On Leonardo this is the USB-CDC serial: Serial.begin(9600); while (!Serial) {} pinMode(LEDpin, OUTPUT); digitalWrite(LEDpin, HIGH);} void loop() { if (Serial.available() > 0) { digitalWrite(LEDpin, !digitalRead(LEDpin)); Serial.write(Serial.read()); }}
PS: I typically use CuteCom as serial monitor on Linux, and I noticed that if the RTS and DTR signals are disabled then the Arduino CDC serial does not write to host, because of the lineState check in the code. Same gotcha in GTKTerm. Ensure that either DTR or RTS is set in the receiving client's serial setup when expecting USB-CDC serial data from the Arduino implementation.
ccrause:
--- Quote from: ackarwow on August 03, 2025, 10:11:14 am ---I modified slightly usb.pas to be more compatible with Arduino source (attached) but I'm not sure if it will help.
--- End quote ---
Tested the new usb.pas, same problem with sending data from Leonardo.
ackarwow:
@ccrause,
Here are corrected version of usb.pas and my test program. Sending data to USB should work.
ackarwow:
A new version of AVRPascal (3.3) has been released.
As always, it's available for download on my webpage (http://akarwowski.pl/index.php?page=electronics&lang=en).
Changes:
New version of UnoLib (1.1, see https://sourceforge.net/projects/unolib/ for details)
New features:
- added the "Add conditional directive for current device" option to the New File dialog box
- automatic renaming of the program/unit name after saving a file with a new name
- new options in Serial Port Monitor window: "line ending" (No, NL, CR, NL&CR) and "mode" (Ascii, Hexadecimal) (thanks to @Dzandaa for suggestions)
- improved installer for Linux, now AVRPascal appears in "Programming" section (thanks to @Dzandaa for suggestions)
Bug fixes:
- fixed problems with reading data in Serial Port Monitor (thanks to Christof Biner for detailed description of the problem)
- minor aesthetic changes in Upload window
The PDF manual will be updated in a few days.
ackarwow:
The manual, updated with the new features of AVRPascal 3.3, is available on my website.
I have also prepared a short "How to start" guide for beginners (attached). Please let me know if anything is missing or needs to be corrected.
Navigation
[0] Message Index
[#] Next page
[*] Previous page