* * *

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

boz

  • New member
  • *
  • Posts: 6
    • Roving Dynamics Ltd
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #120 on: November 06, 2017, 07:47:25 pm »
Looks very nice. great Work.

I migrated from Mikropascal to MPLABX/XC8 about 6 years ago and these days I mostly use the newer PIC32 and 18F26K42 in my embedded projects.

I do have a current open source project that uses a larger 16F18857 device (http://rodyne.com/?p=844) it would be nice to try making a more complicated project for this (I hate string support in C!) are there any plans to support these newer bigger chips or (as there are so many) are there plans to allow us to configure our own chips?

Boz
Roving Dynamics Ltd
www.rodyne.com


Boz
Roving Dynamics Ltd
www.rodyne.com

Edson

  • Hero Member
  • *****
  • Posts: 800
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #121 on: November 06, 2017, 10:24:52 pm »
Hi @boz.

Currently PicPas only support the Mid-Range PIC MCU, like PIC16F887 or PIC16F628. One interesting feature of PicPas is that new devices can be defined usign hardware directives. So theoretically, PicPas can support all devices of the Mid-Range core MCU.

The project PicPas is just beginning, it is in a beta status. I have plans to include the Enhanced Mid-Range and the 18F family of MCU. But it depends on my free time, so probably it won't be soon.

Anyway, this is an open source project so collaborations are welcome.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Laksen

  • Hero Member
  • *****
  • Posts: 596
    • J-Software
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #122 on: November 06, 2017, 10:39:49 pm »
I know it's not a good question, but I often wonder why people use PIC controllers. What keeps you using them?

They aren't really cheap, and the architecture is not suited for compilers or humans.
Some say they are great for noisy environments, but anything running that slow will work in a noisy environment.

Creating a compiler for it is a great feat for sure. So kudos for the project  :)

boz

  • New member
  • *
  • Posts: 6
    • Roving Dynamics Ltd
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #123 on: November 06, 2017, 11:06:50 pm »
I also use AVR, PIC32, ARM and 8051s in my work. You choose the best fitting and most cost effective for your project and not limit yourself based on an particular bias, at the higher level (C/C++) they all work very similar to me. In this case I have a lot of PIC micros returned by the CM from a previous project so I am using them.

I also drink Pepsi sometimes instead of coke and sometimes drive Japanese cars over European ones, I'm probably too old to worry about being trendy or I probably wouldn't be using Pascal :)
Boz
Roving Dynamics Ltd
www.rodyne.com

Laksen

  • Hero Member
  • *****
  • Posts: 596
    • J-Software
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #124 on: November 06, 2017, 11:16:00 pm »
I also use AVR, PIC32, ARM and 8051s in my work. You choose the best fitting and most cost effective for your project and not limit yourself based on an particular bias, at the higher level (C/C++) they all work very similar to me.
Fair enough, but still I wonder what application you find the PIC saves you time or money?

Quote
In this case I have a lot of PIC micros returned by the CM from a previous project so I am using them.
If you have a bunch of micros in stock that are just going to lose value then and they could be used for something. Sure. But buying new of them? Unless you sell in the 100k region of boards I really wonder how good of a price you can get on them?

boz

  • New member
  • *
  • Posts: 6
    • Roving Dynamics Ltd
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #125 on: November 07, 2017, 01:22:38 am »
Hi @boz.

Currently PicPas only support the Mid-Range PIC MCU, like PIC16F887 or PIC16F628. One interesting feature of PicPas is that new devices can be defined usign hardware directives. So theoretically, PicPas can support all devices of the Mid-Range core MCU.

The project PicPas is just beginning, it is in a beta status. I have plans to include the Enhanced Mid-Range and the 18F family of MCU. But it depends on my free time, so probably it won't be soon.

Anyway, this is an open source project so collaborations are welcome.
Thanks

I see the hardware files in the projects units folder it seems very clean to add another device but it looks like you need to know pic16 assembly which I dont.  I am used to C Headers and libraries being available to abstract a lot of the hardware, I'm very familiar with the control registers on the PIC16 and know how to read the datasheet to get things done but I last used assembly on the 8051 in 1987 so I am not sure I am skilled enough to do this, maybe I will have another look when I get some down-time.

Keep up the great work.
Boz
Roving Dynamics Ltd
www.rodyne.com

Edson

  • Hero Member
  • *****
  • Posts: 800
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #126 on: November 07, 2017, 02:57:12 am »
I see the hardware files in the projects units folder it seems very clean to add another device but it looks like you need to know pic16 assembly which I dont.  I am used to C Headers and libraries being available to abstract a lot of the hardware, I'm very familiar with the control registers on the PIC16 and know how to read the datasheet to get things done but I last used assembly on the 8051 in 1987 so I am not sure I am skilled enough to do this, maybe I will have another look when I get some down-time.
No need to know ASM, to add a new device. You can define it in the same source code.

The following example, taking from the User Manual, defines a new PIC16F84 devices, with more FLASH memory:

Code: Pascal  [Select]
  1. program MiPICprogram;
  2. //Defines basic hardware
  3. {$SET PIC_MODEL='MIPIC'}
  4. {$SET PIC_MAXFREQ = 1000000}
  5. {$SET PIC_NPINS = 18}
  6. {$SET PIC_NUMBANKS = 2}
  7. {$SET PIC_NUMPAGES = 1}
  8. {$SET PIC_MAXFLASH = 2048}
  9. //Clear the RAM setting
  10. {$SET_STATE_RAM '000-1FF:NIM'}
  11. //Defines RAM state
  12. {$SET_STATE_RAM '000-00B:SFR, 00C-04F:GPR'}
  13. {$SET_STATE_RAM '080-08B:SFR, 08C-0CF:GPR'}
  14. //Defines mapped RAM
  15. {$SET_MAPPED_RAM '080-080:bnk0, 082-084:bnk0, 08A-08B:bnk0'}
  16. {$SET_MAPPED_RAM '08C-0CF:bnk0'}
  17. //Defines unimplemnted bits in RAM
  18. {$SET_UNIMP_BITS '003:3F,083:3F,005:1F,085:1F,00A:1F,08A:1F'}
  19.  
  20. {$FREQUENCY 4Mhz}
  21. begin
  22.  
  23. end.
  24.  
« Last Edit: November 07, 2017, 03:05:21 am by Edson »
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Edson

  • Hero Member
  • *****
  • Posts: 800
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #127 on: November 14, 2017, 03:08:17 pm »
PicPas has done again  :D. It's the best, optimizing the code size for the Mid-Range PIC, according to a new competition, against the best profesional compilers: https://github.com/AguHDz/PicPas-Librerias_y_Programas/tree/master/Compativa%20Compiladores%20II

Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5810
Re: PicPas, Pascal compiler for Microchip PIC
« Reply #128 on: November 14, 2017, 03:29:31 pm »
I also use AVR, PIC32, ARM and 8051s in my work. You choose the best fitting and most cost effective for your project and not limit yourself based on an particular bias, at the higher level (C/C++) they all work very similar to me.
Fair enough, but still I wonder what application you find the PIC saves you time or money?


Compared to what? For me the 144 pins devices and crossbarswitch for peripherals in dspic (dspic33ep512mu814) allows me to make a generic board, and for experiments and test situations do a modular expansion 

I played with PIC32MK this summer, and rejected it. The CPU seems to be slower. (despite being a 120MHz over 70MHz, it feels like 40MHz)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus