Recent

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

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #150 on: February 25, 2018, 04:34:44 am »
The README.md describes a file called PicPas-linux, but I could not find that in your github repository.

The linux executable is "PicPas-linux". It's just I work more in Windows, so not always I build a Linux version. But you can find the executable in previous versions, in the same GitHub.

Compiling from source gives this error:
  FormPrincipal.pas(11,3) Fatal: Cannot find SynFacilHighlighter used by FormPrincipal of the Project Inspector.
Are there dependencies for source compilation?

Yes. To compile you need to download all the Third Party libraries:

..\..\_Librerias\SynFacilUtils-1.21;
..\..\_Librerias\MisUtils 0.5;
..\..\_Librerias\MiConfig 0.4b;
..\..\_Librerias\PicUtils-1.2;
..\..\_Librerias\Xpres-1.3.2;
..\..\_Librerias\UtilsGrilla 0.8;
..\..\_Librerias\ogEditGraf 1.6b

All are mine so you can find them in my GitHub.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

AnthonyTekatch

  • Jr. Member
  • **
  • Posts: 78
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #151 on: February 25, 2018, 12:22:13 pm »
Yes. To compile you need to download all the Third Party libraries:

..\..\_Librerias\SynFacilUtils-1.21;
..\..\_Librerias\MisUtils 0.5;
..\..\_Librerias\MiConfig 0.4b;
..\..\_Librerias\PicUtils-1.2;
..\..\_Librerias\Xpres-1.3.2;
..\..\_Librerias\UtilsGrilla 0.8;
..\..\_Librerias\ogEditGraf 1.6b

All are mine so you can find them in my GitHub.

Thank you. Looking very good so far!

Can you put that text in the READM.md under requirements

A few notes during my compile:

..\..\_Librerias\Xpres-1.3.2;
should be
..\..\_Librerias\t-Xpres-1.3.2;

Problem: MisUtils.pas(435,10) Error: Identifier not found "FileExistsUTF8"
Cause: The function FileExistsUTF8 in the fileUtil it is depreciated.
Solution: Add  LazFileUtils unit to uses in MisUtils.pas



Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #152 on: February 25, 2018, 04:54:27 pm »
Can you put that text in the READM.md under requirements

It's at the bottom of the text. Maybe it needs to be more specific.  :-\

..\..\_Librerias\Xpres-1.3.2;
should be
..\..\_Librerias\t-Xpres-1.3.2;

You're right. I use a different name for my local copy.

Problem: MisUtils.pas(435,10) Error: Identifier not found "FileExistsUTF8"
Cause: The function FileExistsUTF8 in the fileUtil it is depreciated.
Solution: Add  LazFileUtils unit to uses in MisUtils.pas

Maybe it's because of the version. PicPas 0.8.3 use "MisUtils 0.5". The default version in GitHub is 0.6. You need to select the previous version.

Tell me if you have problems. Maybe I need to update PicPas to "MisUtils 0.6".
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

AnthonyTekatch

  • Jr. Member
  • **
  • Posts: 78
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #153 on: February 25, 2018, 07:29:55 pm »
It's at the bottom of the text. Maybe it needs to be more specific.  :-\
I should read more, thanks  :-[



Problem: MisUtils.pas(435,10) Error: Identifier not found "FileExistsUTF8"
Cause: The function FileExistsUTF8 in the fileUtil it is depreciated.
Solution: Add  LazFileUtils unit to uses in MisUtils.pas

Maybe it's because of the version. PicPas 0.8.3 use "MisUtils 0.5". The default version in GitHub is 0.6. You need to select the previous version.

Tell me if you have problems. Maybe I need to update PicPas to "MisUtils 0.6".

I have no problems now that I added  LazFileUtils to uses in MisUtils.pas, You will have a problem when you upgrade Lazarus/FPC (I am at 1.8.0/3.04).

Thank you, I'll keep testing it out now.

syrecky

  • New Member
  • *
  • Posts: 11
Nested Cycles do not work
« Reply #154 on: March 29, 2018, 02:47:42 pm »
Hi,

PisPac is a very interesting and useful tool.
I tried some examples.
Unfortunately, nested cycles do not work.

Code: Pascal  [Select][+][-]
  1. {$PROCESSOR PIC16F877A}
  2. {$FREQUENCY 8Mhz}
  3. {$MODE PICPAS}
  4.  
  5. program NestedCycle;
  6.  
  7. uses PIC16F877A;
  8.  
  9. var
  10.   a, b, c, d: byte;
  11.  
  12. begin
  13.   d := 0;
  14.   for a := 1 to 4 do
  15.     for b := a + 1 to 5 do
  16.       for c := b + 1 to 6 do
  17.         inc(d);
  18.       end;
  19.     end;
  20.   end;
  21. end.

during cycles, the variables A, B and C have bad values
at the end of cycles the variable D has a bad value 16  -  right = 20

I apologize for my English, I am Czech  :)

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #155 on: March 30, 2018, 07:24:55 am »
Hi,
PisPac is a very interesting and useful tool.
I tried some examples.
Unfortunately, nested cycles do not work.

You are right. There is a horrible bug here  :'(. The implementation of the loop FOR was recently and it was incomplete by now.

Let me check to see what's the problem.

Thanks for test.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #156 on: May 02, 2018, 10:51:47 pm »
PicPas 0.8.5 has released. :D
https://github.com/t-edson/PicPas
Thanks to https://github.com/cuistax, now PicPas includes french translaton and support for almost all the Mid-range PIC models: PIC10F320 PIC10F322 PIC12F609 PIC12F615 PIC12F617 PIC12F629 PIC12F635 PIC12F675 PIC12F683 PIC12F752 PIC16F73 PIC16F74 PIC16F76 PIC16F77 PIC16F83 PIC16F84 PIC16F87 PIC16F88 PIC16F610 PIC16F616 PIC16F627 PIC16F627A PIC16F628 PIC16F628A PIC16F630 PIC16F631 PIC16F636 PIC16F639 PIC16F648A PIC16F676 PIC16F677 PIC16F684 PIC16F685 PIC16F687 PIC16F688 PIC16F689 PIC16F690 PIC16F707 PIC16F716 PIC16F720 PIC16F721 PIC16F722 PIC16F722A PIC16F723 PIC16F723A PIC16F724 PIC16F726 PIC16F727 PIC16F737 PIC16F747 PIC16F753 PIC16F767 PIC16F777 PIC16F785 PIC16F818 PIC16F819 PIC16F870 PIC16F871 PIC16F872 PIC16F873 PIC16F874 PIC16F874A PIC16F876 PIC16F877 PIC16F882 PIC16F883 PIC16F884 PIC16F886 PIC16F887 PIC16F913 PIC16F914 PIC16F916 PIC16F917 PIC16F946
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #157 on: May 03, 2018, 09:50:40 am »
hi ! is it mean that we can compile a program for famous Arduino or Teensy?
Or AtTiny?





(I have no idea of what is "PIC")
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

ccrause

  • Hero Member
  • *****
  • Posts: 843
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #158 on: May 03, 2018, 06:22:41 pm »
hi ! is it mean that we can compile a program for famous Arduino or Teensy?
Or AtTiny?

The fpc compiler can already compile to AVR, see wiki.

PicPas is a different pascal compiler that targets a different controller family. Note that fpc doesn't support the PIC controller family.

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #159 on: May 04, 2018, 05:31:29 pm »
hi ! is it mean that we can compile a program for famous Arduino or Teensy?
Or AtTiny?

The fpc compiler can already compile to AVR, see wiki.

PicPas is a different pascal compiler that targets a different controller family. Note that fpc doesn't support the PIC controller family.

Exactly. PicPas doesn't compile to AVR. Free Pascal can do it.

But PicPas is not only a compiler/IDE. It includes a debugger for PIC devices and can do simulation in Real Time. Some experimental by now.

One sustancial difference with Free Pascal, is PicPas use a different Pascal syntax, more at the style of Modula 2:

Code: Pascal  [Select][+][-]
  1. if ...  then
  2. ...
  3. end;
  4.  
  5. while ... do
  6.  
  7. end;

And PicPas have some special syntax for bit manipulation. Like a real "bit" type and access to individualy bits for byte/word/dword:

Code: Pascal  [Select][+][-]
  1. PORTA.7 := 1;
  2.  
  3. WORD1.high.bit0 := 1;
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #160 on: May 20, 2018, 05:04:47 pm »
PicPas 0.8.6 have now experimental support for Baseline PIC (12 bits instructions)  :). This include to the microcontrollers:

PIC10F200 PIC10F200 PIC10F202 PIC10F204 PIC10F206 PIC10F220 PIC10F222
PIC12F508 PIC12F509 PIC12F510 PIC12F519
PIC16F505 PIC16F506 PIC16F526 PIC16F527 PIC16F54 PIC16F57 PIC16F59

Some functionalities have been disabled because of the limited resources this devices have (Some of they have 16 bytes of RAM)  :o.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Kays

  • Hero Member
  • *****
  • Posts: 569
  • Whasup!?
    • KaiBurghardt.de
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #161 on: May 20, 2018, 05:25:58 pm »
[…] (I have no idea of what is "PIC")
in general programmable integrated circuit; but here the short/colloquial name for PIC μController
Yours Sincerely
Kai Burghardt

xterro

  • New member
  • *
  • Posts: 9
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #162 on: May 23, 2018, 11:23:08 am »
Hello, when will be PIC18/24 support? Is there the plans about support this pic families?  ::)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #163 on: May 23, 2018, 11:39:40 am »
pic24 and dspic(30/33) are a different (16-bit) architecture.

So is PIC32, but that one is covered by FPC.

Edson

  • Hero Member
  • *****
  • Posts: 1296
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #164 on: May 23, 2018, 08:26:38 pm »
Hello, when will be PIC18/24 support? Is there the plans about support this pic families?  ::)

Currently I'm solving some issues with including the support to Baseline family (12 bit instructions Core).
Including support for this new family was some kind of experiment to redesign the architecture of PicPas to be able to include new compilers in the same IDE.
The support for the Baseline family in PicPas is supported through creating a new compiler (although sharing most of the code).
PicPas has now a new architecture that can support multiple compilers, and the next steps will be create:
* A compiler for the Enhanced 14 bits Core
* A compiler for the 18F family.

All of this families are in the group of 8 bits Micro, and by now I have not plans to include support for 24 or 32 bits Core PIC.

Anyway PicPas is opened to collaborations so if someone want to include support for a new familly, it's wellcome.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018