Recent

Author Topic: PicPas, Pascal compiler for Microchip PIC  (Read 115105 times)

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #210 on: September 11, 2020, 11:13:23 pm »
Hi.

I think I must migrate to *.po format in the project. It's i just don't know how to start. My objective is to be able to change the language in a simple way as it's doing now, from settings form and in runtime.

Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #211 on: September 12, 2020, 01:05:12 am »
In my GitHub-Repository is a Project called Prj_PicPas2Po, I use it to extract and import .po files to your Language-folder files.
Look under /Diverses  /FPC and /source/PicPas2Po.
Inside there is a unit 'unt_pofile.pass' that handles the .po files.
« Last Edit: September 12, 2020, 01:07:56 am by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #212 on: September 12, 2020, 04:48:11 am »
Thanks for the information. I will check.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

K155LA3

  • New Member
  • *
  • Posts: 14
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #213 on: November 14, 2020, 09:05:47 pm »
I use PicPas 0.9.0 and an error occurred when trying to use loops:
Code: Pascal  [Select][+][-]
  1. uses PIC12F629;
  2. ...
  3. var
  4.   i: byte;
  5. ...
  6. begin
  7.    ...
  8.   for i := 0 to 7 do
  9.     CLKPin := 0;
  10.     CLKPin := 1;
  11.   end;
  12. end;
  13.  
Error for string "for i := 0 to 7 do": Illegal Operation: (byte):=(bit). But everything worked fine in version 0.8.4, which I used before.
I tried to change it to "for i := $00 to $07 do" but got the same error.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #214 on: November 15, 2020, 02:42:54 am »
Hi. Version 0.9.0 is experimental. Work in progress.

Please use the previous version.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

K155LA3

  • New Member
  • *
  • Posts: 14
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #215 on: December 04, 2020, 11:36:28 pm »
Thanks. In version 0.8.8 this bug is gone. But the "Range check error" error appeared when checking the condition:
Code: Pascal  [Select][+][-]
  1. if (KEY_Select and %00001111) > %00000001 then
  2.  
If you write the condition in this way, the error disappears:
Code: Pascal  [Select][+][-]
  1. if KEY_Select and %00001111 > %00000001 then

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #216 on: December 05, 2020, 05:47:56 am »
Fixed.

Please update from GitHub.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

K155LA3

  • New Member
  • *
  • Posts: 14
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #217 on: December 05, 2020, 11:17:55 pm »
Thanks. Works fine.

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #218 on: December 07, 2020, 07:48:26 pm »
Wanted to give picpas a try (translating a small proton basic program).
However seems some dependencies are missing (or I'm doing something wrong - not impossible ;) ).
SynFacilHighlighter, also not in the project dependencies, SynFacilUtils, MisUtils, XpresBas.
I tried 0.8.8.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #219 on: December 08, 2020, 04:00:02 am »
Hi.

I've included the libraries in the project to avoid download individually.

Just download the from the Github: https://github.com/t-edson/PicPas
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #220 on: December 08, 2020, 10:01:14 pm »
Great! Working now  :D
(Only a warning on a missing Devices18 folder; but still starts.)
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

zj

  • Newbie
  • Posts: 1
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #221 on: January 14, 2021, 03:40:20 pm »
Hello, great work  :),
Is {$CONFIG2 ...}  implemented in Enhanced Mid-range Compiler in version 0.8.8 ?

program FT290_display_2;
uses PIC16F1939;
{$FREQUENCY 8MHZ}
{$CONFIG _FOSC_INTOSC, _WDTE_OFF, _PWRTE_OFF, _MCLRE_OFF, _CP_OFF, _CPD_OFF, _BOREN_ON, _CLKOUTEN_OFF, _IESO_OFF, _FCMEN_ON}
{$CONFIG2 _WRT_OFF, _VCAPEN_OFF, _PLLEN_ON, _STVREN_ON, _BORV_LO, _LVP_ON}
...
FT290-display-2[29,3] Error: Unknown directive: CONFIG2

Regards, ZJ


Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #222 on: January 15, 2021, 08:05:51 pm »
Hello, great work  :),
Is {$CONFIG2 ...}  implemented in Enhanced Mid-range Compiler in version 0.8.8 ?

program FT290_display_2;
uses PIC16F1939;
{$FREQUENCY 8MHZ}
{$CONFIG _FOSC_INTOSC, _WDTE_OFF, _PWRTE_OFF, _MCLRE_OFF, _CP_OFF, _CPD_OFF, _BOREN_ON, _CLKOUTEN_OFF, _IESO_OFF, _FCMEN_ON}
{$CONFIG2 _WRT_OFF, _VCAPEN_OFF, _PLLEN_ON, _STVREN_ON, _BORV_LO, _LVP_ON}
...
FT290-display-2[29,3] Error: Unknown directive: CONFIG2

Sorry.

Enhanced Mid-range series is a recent feature. There are still more features to complete. Collaborations are welcome.

Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #223 on: November 10, 2021, 12:35:34 am »
PicPas is now available as Snap package https://snapcraft.io/picpas

Related necessary changes to the project can be seen here: https://github.com/chronoscz/PicPas/commit/a816e0467a9dbda9d3d4c70be90a133577c694eb
Instructions how to create snap are available here https://wiki.freepascal.org/Create_snap_package

Some of my observations:
* The application doesn't remember windows size and position.
* Scaling and High DPI support is not enabled. So windows and text looks wrong under high DPI.
* File open and save dialog won't use path to current opened file or last used path.
* Application config file PicPas-linux.xml should be better placed into user config directory. Use function GetAppConfigDir(False) to get that directory. Also don't put your local recent files into that file and into git. It should be initialized as clean.
* Wrong relative paths to libraries in project Debug build mode. But its good that they are present in repository so one doesn't need to download them manually.
* Temp directory should be located under linux in /tmp directory or something like /tmp/PicPas or /tmp/PicPas-username. Or it can be also located in user config dir as temp.
* Use .gitignore file to ignore dynamically created directories and files like project.lrs, project.res and project/lib.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #224 on: November 10, 2021, 03:48:01 am »
PicPas is now available as Snap package https://snapcraft.io/picpas

Related necessary changes to the project can be seen here: https://github.com/chronoscz/PicPas/commit/a816e0467a9dbda9d3d4c70be90a133577c694eb
Instructions how to create snap are available here https://wiki.freepascal.org/Create_snap_package

Some of my observations:
* The application doesn't remember windows size and position.
* Scaling and High DPI support is not enabled. So windows and text looks wrong under high DPI.
* File open and save dialog won't use path to current opened file or last used path.
* Application config file PicPas-linux.xml should be better placed into user config directory. Use function GetAppConfigDir(False) to get that directory. Also don't put your local recent files into that file and into git. It should be initialized as clean.
* Wrong relative paths to libraries in project Debug build mode. But its good that they are present in repository so one doesn't need to download them manually.
* Temp directory should be located under linux in /tmp directory or something like /tmp/PicPas or /tmp/PicPas-username. Or it can be also located in user config dir as temp.
* Use .gitignore file to ignore dynamically created directories and files like project.lrs, project.res and project/lib.

Thanks for the collaboration.

It's a long time I don't update the compiler. I've been working a lot in a new lexer and code generator, but it's not ready to include.

Fortunately, the changes you suggest are easy to implement.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018