News:

Let's find out together what makes a PIC Tick!

Main Menu

Migrating from picbasic pro 2.60

Started by harryouaibe, Jun 24, 2022, 11:00 AM

Previous topic - Next topic

harryouaibe

Hi,

I'm using PBP2.60 for a long time, I have hundred of programs.
I would like to know if there is already a program (script ?) to translate PBP to POSITRON, before buying it.
Or at least a document which can help me to migrate faster.
I'm looking to buy POSITRON because of the large supported devices it could give.... As many Microchip are unavailable at this time.
Regards
Herve
Paris France

John Lawton

Sorry, I don't know of a script or conversion program. I started out using PBP and even did a recent USB project with it, but mostly I have been using Proton and now Positron for many years now. Migrating isn't too difficult, basically there are many more commands to find out about, but many of the old PBP ones translate fairly easily as they share a common heritage in Basic Stamp syntax.

The 8 bit manual is here: https://drive.google.com/file/d/1n66aAuRWKTOSjlghpizfoyKQcVBGFxq3/view?usp=sharing and it is well worth studying.




harryouaibe

Thank you John.... Maybe I will try to make a python script to translate some of differences
Regards

trastikata

Why do you need to translate them? Aren't they working? By now they should be stable enough to need only minor fixes that you can continue doing in Picbasic.

If the need for a major update/upgrade for any old program appears, it would be easier to simply re-write it in Positron than updating and modifying a script translated program. 

Otherwise leave them be and start writing the new programs using Positron from now on.

John Lawton

The OP stated the reason which is the present chip shortages and hence the need to port old programs to use different devices that can be obtained but sadly PBP may not support.

trastikata

Quote from: John Lawton on Jun 24, 2022, 03:15 PMThe OP stated the reason which is the present chip shortages and hence the need to port old programs to use different devices that can be obtained but sadly PBP may not support.

Oi, I read it but did not assimilate that info, thanks for the reminder John.

Yves

Long ago when I went from PBP to Proton now Positron it wasn't that difficult to rewrite the code. When a code is written in either language most of the hard work is done. If you have to change the lingo it is just matter to read the manual of each language and use some common sense. There are no major change in language anyway. I never look back since I went from PBP to Proton then the excellent  Positron language.

Yves 
Yves

harryouaibe

Yes, I have to read the BIG manual... ;-) May be not in one time...
OK I bought POSITRON  ;)
I didn't find any video showing the very basics things with IDE etc...
I will search, but I'm pretty sure I have to search this website and ask questions.
have a nice weekend !

keytapper

Since you know pretty well the English, the provided manual is the starting point.
As you'll want to develop a project, your ideas may get the correct answers by searching on the manual. I don't exclude that we'll give some tips.
Ignorance comes with a cost

top204

#9
Many thanks for your purchase Herve. I sent the link for the compilers download in the Ebay message.

I first started with PBP back in 1999, and actually wrote a book for it "Experimenting with the PICBASIC Pro Compiler". However, as the years went past, I could see no real changes to the melabs compiler and it was, essentially, stagnating. With few new features, and no floating point added, or signed variables, and support for newer devices was very lacking. It is still a good compiler to start with, but its assembler code creation is not very good and the assembler listing is very obscure to read, which is an important thing to me, because I pride myself on the single most important part of a microcontroller compiler, which is the assembler code it creates. It must be easy to understand and very optimised to get the most out of the device being used. That is when I started writing the Proton compiler, so I could have a good language that produced nice tight assembler code, but was still easy to use.

Converting the code from PBP to Positron is very straightforward because the Positron has procedures as an option and they are not mandatory, unlike most other procedural languages. So the compiler still works as a flat language and is loosely based upon the syntax of the BASIC Stamp II module, as is PBP. But I changed some of the command names to make them a bit easier to understand, and changed their syntax a little. Again, to make them easier to use, because the BASIC Stamp II module was an interpreted language and its syntax was not very efficient in a true compiler.

keytapper

In the beginning I picked up the Oshon framework. Most of my intent is to have an idea how the compiler creates the assembly. So the Oshon basic was just tidy and simple assembly.
It took me some time to understand what was the  lengthy header preface of proton basic, so I reputed not so interesting, but after comparing the results I could see the goodness of the compiler.
Ignorance comes with a cost

harryouaibe

Thank you top204, I also bought this book long time ago and still have it.
I don't know about the PBP assembler listing. I never take an eye on it. I made hundreds of progs for French Train, NOKIA, labs...(for myself too ;) ) and found all that I need in your book and with help from one guy (RIP Darrel) on the PBP forum. Learning how to add a bootloader was one of the last things.
I'm not a good programmer but when making prototypes or use PROTEUS simulation, it's easyer.
Now, for me, it's time to go where I think the future seem's secure before retirement (2025) and chip shortage. Helping the young lady who should replace me to learn basic but efficient langage for small/medium projects too.
Herve