Recent

Author Topic: AVR / Arduino GUI Package for Lazarus  (Read 1239 times)

Mathias

  • New Member
  • *
  • Posts: 41
AVR / Arduino GUI Package for Lazarus
« on: February 19, 2020, 01:50:08 pm »
I now officially present my component, with which you can very easily create an Arduino / AVR project.
To install the component, as usual with components, simply open via "Package -> Package file (* .lpk) ..."
Then select "Use -> Install", then confirm the dialog with [Yes].

An "Arduino AVR Project" can then be created via "File -> New ... -> Project -> AVR Project (Arduino)".
If you want to change something at runtime, you can edit the values ​​via "Project -> AVR Options".

The AVR5 family is currently supported. This applies above all to the popular ATmega and the Arduino Uno & Nano.
With the button template, you can directly select the parameters for common Arduino / AVR.

The prerequisite that everything runs is a functioning cross compiler.
How this works, everything is described here: https://wiki.freepascal.org/AVR_Embedded_Tutorial/de

Download the package: https://github.com/sechshelme/Lazarus-Embedded/tree/master/Lazarus_Arduino_AVR_GUI_Package

I am always welcome for feedback. : Wink:
Especially when someone tests it on Windows.
« Last Edit: February 20, 2020, 05:10:20 pm by Mathias »

ccrause

  • Sr. Member
  • ****
  • Posts: 266
Re: AVR / Arduino GUI Package for Lazarus
« Reply #1 on: February 19, 2020, 08:15:33 pm »
Good work!

BlueIcaro

  • Hero Member
  • *****
  • Posts: 585
Re: AVR / Arduino GUI Package for Lazarus
« Reply #2 on: February 19, 2020, 08:35:31 pm »
Nice work, but link to wiki doesn't work.
/BlueIcaro
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

af0815

  • Hero Member
  • *****
  • Posts: 549
Re: AVR / Arduino GUI Package for Lazarus
« Reply #3 on: February 20, 2020, 06:31:11 am »
I think this link

https://wiki.freepascal.org/AVR_Embedded_Tutorial_-_Entry_Lazarus_and_Arduino/de (German original)
https://wiki.freepascal.org/AVR_Embedded_Tutorial_-_Entry_Lazarus_and_Arduino (Translated english)

was shortend.

I known this very interesting articles were written first in german and then translated to other languages, so the german are the leading articles if something is not finished in english. Thanks to trev for his translation.
« Last Edit: February 20, 2020, 06:36:01 am by af0815 »
regards
Andreas

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #4 on: February 20, 2020, 05:14:09 pm »
Thanks for the feedback

Nice work, but link to wiki doesn't work.
/BlueIcaro
I corrected the links, they were somehow destroyed in the forum.  :-[
« Last Edit: February 21, 2020, 06:03:53 pm by Mathias »

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #5 on: March 13, 2020, 04:15:37 pm »
Now it is also possible to select ARM types.
This also includes STM32.

As always, I am grateful for mistakes and suggestions.

avra

  • Hero Member
  • *****
  • Posts: 1910
    • Additional info
Re: AVR / Arduino GUI Package for Lazarus
« Reply #6 on: March 13, 2020, 05:46:51 pm »
Things are getting better and better  :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #7 on: March 15, 2020, 05:23:12 pm »
Since the fpc sources (cpuinfo.pas) contain data on memory size, etc., I have installed an info box.
First for the AVR and this with a simple TMemo.

For this I have installed a button "CPU Info ...".o.

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #8 on: April 12, 2020, 02:04:41 pm »
I added a serial monitor to the package.

But is still in the alpha stage.

With "/dev/ ttyUSB0" and 9600 baud it already works.


Dimitrios Chr. Ioannidis

  • Full Member
  • ***
  • Posts: 123
    • Nephelae
Re: AVR / Arduino GUI Package for Lazarus
« Reply #9 on: April 12, 2020, 03:44:14 pm »
Hi,

I added a serial monitor to the package.

< snip >


I don't know your Roadmap but I think that we're having the same goal regarding Lazarus IDE Serial Monitoring feature . What do you think about working together for this feature of your project ?

regards,

Dimitrios Chr. Ioannidis
http://www.nephelae.eu

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #10 on: April 13, 2020, 04:10:39 pm »
I just saw that you also have something similar in mind.
https://github.com/dioannidis/lazserialmonitor
I have read something that you can interrupt the serial monitor when uploading to the AVR and then start it again, as Arduino and sloeber - IDE can.

You are welcome to browse through my sources.
https://github.com/sechshelme/Lazarus-Embedded

We can already exchange ideas, only the biggest problem, I can not speak English, I have to translate everything with Google.


Addendum:
For the serial monitor, I copied and modified the unit synaser.pas from the package synapse.
So it is no longer necessary to install the Packge synapse.
« Last Edit: April 13, 2020, 04:15:27 pm by Mathias »

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #11 on: April 14, 2020, 04:59:23 pm »
@Dimitrios Chr. Ioannidis

In your project I found lines that take me a lot further.
Interrupt the Com-Port when uploading and then open it again.

Code: Pascal  [Select][+][-]
  1. procedure TLSW.DoOpen;
  2. begin
  3.   ShowMessage('Serial Öffnen');
  4. //  if Assigned(SerialMonitor) then
  5. //    SerialMonitor.RequestActivateMonitor(True);
  6. end;
  7.  
  8. procedure TLSW.DoClose;
  9. begin
  10.   ShowMessage('Serial Schliessen');
  11. //  if Assigned(SerialMonitor) then
  12. //    SerialMonitor.RequestActivateMonitor(False);
  13. end;
  14.  
  15. ....
  16.   // Run ( without or with debugger ) hooks
  17.   LazarusIDE.AddHandlerOnRunDebug(@LSW.RunHandler);
  18.   LazarusIDE.AddHandlerOnRunWithoutDebugInit(@LSW.RunNoDebugHandler);
  19.   LazarusIDE.AddHandlerOnRunFinished(@LSW.StopHandler, True);


Addendum:
I completely did without Synaser in my project, I now use the Serial unit, which is part of Lazarus.

Dimitrios Chr. Ioannidis

  • Full Member
  • ***
  • Posts: 123
    • Nephelae
Re: AVR / Arduino GUI Package for Lazarus
« Reply #12 on: April 14, 2020, 05:46:47 pm »
In your project I found lines that take me a lot further.
Interrupt the Com-Port when uploading and then open it again.

Nice ! This was just a proof of concept. I'm glad that you find it useful.

I completely did without Synaser in my project, I now use the Serial unit, which is part of Lazarus.

I don't know any Lazarus serial unit. Maybe you mean FPC's serial unit ?

I'll wait until you commit the changes to your github repository.

regards,
Dimitrios Chr. Ioannidis
http://www.nephelae.eu

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #13 on: April 15, 2020, 05:35:03 pm »
Quote
I don't know any Lazarus serial unit. Maybe you mean FPC's serial unit ?
Code: Pascal  [Select][+][-]
  1. uses
  2.   Serial;

Quote
I'll wait until you commit the changes to your github repository.
https://github.com/sechshelme/Lazarus-Embedded/tree/master/Lazarus_Arduino_AVR_GUI_Package

Mathias

  • New Member
  • *
  • Posts: 41
Re: AVR / Arduino GUI Package for Lazarus
« Reply #14 on: April 17, 2020, 05:13:06 pm »
Now the serial monitor window can be opened with Show instead of ShowModal.
If the monitor is active and blocks the COM port. The monitor is automatically interrupted when a program is compiled. So the AVRDude has the COM port free.
After uploading, the monitor becomes active again.

Just as the Arduino IDE does.

Can someone test under Windows?

 

TinyPortal © 2005-2018