Recent

Author Topic: AVRPascal – free code editor for FPC for AVR  (Read 16063 times)

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: AVRPascal – free code editor for FPC for AVR
« Reply #120 on: December 03, 2024, 02:50:47 pm »
Hi,

@ackarwow:

I prefer the AVRPascal editor to the Arduino IDE, because I write the control programs in Pascal Lazarus and I don't need to change programming languages.

In addition, it is faster to compile and upload.

Arduino also allows you to compile for other types of processors, such as ESP8266 or ESP32 that I use a lot.

Of course, Arduino has more libraries like AccelStepper, but I'm sure that in the future, they will be rewritten.  :D

B->


Regards,
Dzandaa

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #121 on: December 03, 2024, 08:45:53 pm »
The size if greater than Arduino's IDE (...)

@Dzandaa, @marcov
I made some tests with inlining of short, frequently used routines. Yes, it little bit reduced executable sizes. Results of tests attached in Inlining.pdf. Also I updated sources on GitHub (https://github.com/ackarwow/unolib).
« Last Edit: December 04, 2024, 05:16:06 pm by ackarwow »

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #122 on: December 03, 2024, 09:04:00 pm »
@Dzandaa

Thank you for you comment. I will wait a bit for other comments (maybe there will be) but it seems my doubts about the functionality of AVRPascal as an editor are not very important. What is more important is improving and expanding the capabilities of the UnoLib library.

Of course, Arduino has more libraries like AccelStepper, but I'm sure that in the future, they will be rewritten.  :D
(...)

If there are sources for AccelStepper, translation is not a big problem, testing is another matter ;)

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #123 on: December 08, 2024, 07:34:07 pm »
(...) It is possible to use the editor, but for convenience I miss:
1. Better jump to interface/implementation sections. If I have an incorrect fragment in the code (e.g. in C) the program raises an exception. I show such exceptions to see in what situations they appear and now I know that I should move them to the Messages area and not interrupt the program.
2. Better finding of declaration of keyword/module performance. Some declarations are not found at all, especially if they are in IFDEF blocks.
3. I really miss jump history to e.g. go back to the previously found declaration/definition. The jump list doesn't have to be displayed anywhere, but shortcuts like in Lazarus are needed (Ctr+H/Ctr+Shift+H).

I think I have solved the problems with the editor mentioned above, probably not perfectly, but I hope well enough. I am testing the changes, they will probably appear in version 3.0 of AVRPascal.

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #124 on: December 10, 2024, 04:57:47 pm »
New version of AVRPascal (3.0) is available at http://akarwowski.pl/index.php?page=electronics&lang=en.

Changes:
New version of UnoLib (0.8, does not contain "extras" directory; see https://sourceforge.net/projects/unolib/ for details)
New features:
- added jump history, available using shortcuts Ctr+H (go backward) and Ctrl+Shift+H (go forward) to navigate between visited points
Bug fixes:
- improved switching between interface and implementation sections of a given method, information about possible syntax errors moved to the Messages area
- improved searching for identifier declarations when they are in $IFDEF blocks
- improved serial port support (list of devices, port reset)

Thanks to @Dzandaa for suggestions and THardwareSerial.ReadByte code for UnoLib :)

Edit: Minor changes to the manual (attached)
« Last Edit: December 14, 2024, 10:52:16 am by ackarwow »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: AVRPascal – free code editor for FPC for AVR
« Reply #125 on: December 14, 2024, 03:43:55 pm »
Hi,

@ackarwow:

Here is the version of TestAVR for MacOS using the library TLazSerial from Jurasyc Pork

https://github.com/JurassicPork/TLazSerial

Only tested on MacOS Sierra :)

B->
Regards,
Dzandaa

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #126 on: December 14, 2024, 05:29:52 pm »
(...)
Here is the version of TestAVR for MacOS using the library TLazSerial from Jurasyc Pork
https://github.com/JurassicPork/TLazSerial
Only tested on MacOS Sierra :)
(...)

@Dzandaa,
Many thanks for your update! :) I will test new TestAVR on my MacOS and Windows and Linux machines. 

Dzandaa

  • Sr. Member
  • ****
  • Posts: 404
  • From C# to Lazarus
Re: AVRPascal – free code editor for FPC for AVR
« Reply #127 on: December 14, 2024, 06:26:38 pm »
Hi,
@ackarwow,

The new version is only for Mac and Linux, on Windows, you have to make some change due to NonBlock property that doesn't exist in the Windows version.

B->
Regards,
Dzandaa

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #128 on: December 14, 2024, 10:00:42 pm »
The new version is only for Mac and Linux, on Windows, you have to make some change due to NonBlock property that doesn't exist in the Windows version.
@Dzandaa,
Thanks for the tip, really there were some complications on Windows, but generally your code works as expected on Windows, Linux and MacOS :)
I had to remove BaudRate (incompatible constants) and SynSer.NonBlock properties in testavru.lfm on Windows. Moreover, I slightly changed the code:
Code: Pascal  [Select][+][-]
  1. {$IFDEF UNIX}
  2. RS232.SynSer.NonBlock := True;
  3. {$ENDIF}
  4.  
Perhaps dynamically created TLazSerial could be more comfortable in this case, but all works fine. Thank you :)
« Last Edit: December 14, 2024, 10:45:35 pm by ackarwow »

VisualLab

  • Hero Member
  • *****
  • Posts: 614
Re: AVRPascal – free code editor for FPC for AVR
« Reply #129 on: December 15, 2024, 11:22:40 pm »
I have a question for @ackarwow and @Dzandaa: what Linux distribution are you currently using (on which you tested AVRPascal)?
« Last Edit: December 15, 2024, 11:24:44 pm by VisualLab »

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #130 on: December 15, 2024, 11:39:48 pm »
I have a question for @ackarwow and @Dzandaa: what Linux distribution are you currently using (on which you tested AVRPascal)?

Info via hostnamectl:
Code: Text  [Select][+][-]
  1. (...)
  2. Operating System: Linux Mint 19.3
  3. Kernel: Linux 5.0.0-32-generic
  4. Architecture: x86-64
  5.  

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #131 on: December 29, 2024, 07:09:24 pm »
Recently me and @Dzandaa prepared an experimental software implementation of 32-bit floating point numbers. The module float32.pas include string to float (without scientific notation) and float to string conversion, addition, subtraction, division and other basic routines. Moreover, @Dzandaa prepared routines for square root, sinus and cosinus. At the time we are testing main software float routines comparing them with results of their RTL counterparts. After tests, float32.pas will be added to UnoLib library. Source code and test program attached.
« Last Edit: December 29, 2024, 07:20:22 pm by ackarwow »

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #132 on: January 05, 2025, 01:12:33 pm »
I opened new thread about UnoLib (https://forum.lazarus.freepascal.org/index.php/topic,69783.0.html), so please write any questions, comments and wishes to UnoLib there.

ackarwow

  • Full Member
  • ***
  • Posts: 103
    • Andrzej Karwowski's Homepage
Re: AVRPascal – free code editor for FPC for AVR
« Reply #133 on: January 08, 2025, 11:05:35 pm »
I am collecting things to fix, improve or add in AVRPascal editor in version 3.1 (in preparation). Here is current list, please let me know here if you have something to add to it.

Code: Text  [Select][+][-]
  1. TO FIX
  2. 1) Access Violation after typing "Exit(" or "SizeOf("
  3.  
  4. TO ADD
  5. 1) Option for use real tab character or specified number of spaces after pressing TAB key (suggested by @Dzandaa)
  6. 2) Global definition of symbol "AVRPascal" ("-dAVRPascal" in command line) during compilation in AVRPascal; it can be useful in IFDEF block of UnoLib sources
  7.  

 

TinyPortal © 2005-2018