I am working since many years with the melabs (2xx) compiler and wrote several programs for PIC.
Now I have to decide if I stay with this compiler (go to PBP3) or migrate to something new, e.G.: MPLAB XC8.
But recently I discovered GCbasic and I am really very impressed.
So my questions to you experts:
What is your experience in comparison melabs to GCbasic?
How difficult would it be to migrate existing PBP code?
I could not find a discusion MPLAB XC8 vs GCbasic (I know C is hardly comparable to basic)
but what are your pros and cons?
When are you prefering XC8 and when GCbasic?
I have many years experience with assembler, pic-basic and other languages, except C. My programms have around 1000 lines of code and I use it for controlling I/Os and serial communication. Migrating this software to a new system might be an issue.
So I guess GCbasic would be quicker to start with?
many thanks for you answers.
BR from Austria,
Herb.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have not see MELAB - Please confirm that the URL and the samples on that page represent MELAB, No point in my starting from the wrong example of the MELAB language.
Meanwhile have a look at an example to compare and contrast MELAB and Great Cow BASIC.
Evan
' Name : ADCIN10_1934X.pbp' Compiler : PICBASIC PRO Compiler 2.6' Assembler : MPASM' Target PIC : 40-pin 16F1934 or similar' Hardware : LAB-X1 Experimenter Board' Oscillator : 4MHz external crystal' Keywords : ADCIN, LCDOUT' Description : PICBASIC PRO program to display result of' 10-bit A/D conversion on LCD. Connect analog input to' channel-0 (RA0).'' Define LCD registers and bitsDefineLCD_DREGPORTDDefineLCD_DBIT4DefineLCD_RSREGPORTEDefineLCD_RSBIT0DefineLCD_EREGPORTEDefineLCD_EBIT1' Define ADCIN parametersDefineADC_BITS10' Set number of bits in resultDefineADC_CLOCK4' Set clock source Fosc/4DefineADC_SAMPLEUS50' Set sampling time in uSadvalVarWord' Create adval to store resultGosubInit' Hardware initialization routinemainloop:
Adcin0, adval' Read channel 0 to advalLcdout$fe, 1' Clear LCDLcdout"Value: ", DECadval' Display the decimal value Pause100' Wait .1 secondGotomainloop' Do it foreverInit:
ANSELA=1' Set PortA 0 to analog POT inputANSELB=0' portb all digitalANSELD=0' portd all digitalANSELE=0' porte all digitalADCON1=%11000000' Right justify for 10-bit, Fosc/4, +Vref/-Vref = Vdd/gndOPTION_REG.7=0' Enable PORTB pullupsTRISD=0' PORTD all outputsPause100' Wait for LCD to startReturn' Return to callerEnd
a port to Great Cow BASIC. This took about two minutes over a coffee. :-)
' Name : ADCIN10_1934X.gcb' Compiler : Great Cow BASIC' Assembler : Great Cow BASIC ( or MPASM which would just take more time... :=) )' Target PIC : 40-pin 16F1934 or similar' Hardware : LAB-X1 Experimenter Board' Oscillator : 4MHz external crystal' Description : Port to Great Cow BASIC to display result of' 10-bit A/D conversion on LCD. Connect analog input to' channel-0 (RA0).'
#chip16f1934, 4
#optionExplicit' Define LCD registers and bits
#defineLCD_IO4
#defineLCD_NO_RW; ----- Define Hardware settings
#defineLCD_RSPORTE.0
#defineLCD_EnablePORTE.1
#defineLCD_DB4PORTD.3
#defineLCD_DB5PORTD.2
#defineLCD_DB6PORTD.1
#defineLCD_DB7PORTD.0DimadvalasWord' Create adval to store resultDOForeveradval=ReadAD10(AN0)' Read channel 0 to advalCLS' Clear LCDPrint"Value: "+str(adval)' Display the decimal valueWait100ms' Wait .1 secondLoop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is your experience in comparison melabs to GCbasic?
Personally none. Other may have experience but if the code above represents the language then it is very easy
2
How difficult would it be to migrate existing PBP code?
Easy. Learn the syntax, look at the 1000s of examples and it will be easy. As I do not know what is in your 1000 lines of code it is truely hard to say - but, we have libraries to reduce the porting work.
3
I could not find a discusion MPLAB XC8 vs GCbasic [I know C is hardly comparable to basic] but what are your pros and cons?
You ask a great question. This has not been asked before. See next section as we need define the list......
4
When are you prefering XC8 and when GCbasic?
XC8 with MPLAB-IDE... I only use to generate reference code. I gave up using XC8 with MPLAB-IDE years ago. I used Great Cow BASIC only. I only use MPASM to generate reference HEXs to compare to the Great Cow BASIC generated HEX file. So, I may be the wrong person to comment.
5
I have many years experience with assembler, pic-basic and other languages, except C. My programms have around 1000 lines of code and I use it for controlling I/Os and serial communication. Migrating this software to a new system might be an issue.
I cannot really assess without seeing the 1000 of lines of code. If you want to review - then, send me an email.
6
So I guess GCbasic would be quicker to start with?
Any language has a learning curve. We have a friendly community that can assist.
Index
Scope/Feature
Pro
Con
1
Product Support
tbc
tbc
2
Licensing
tbc
tbc
3
Architectures Supported
tbc
tbc
4
Chips Supported
tbc
tbc
5
Libraries Suppored
tbc
tbc
6
Community
tbc
tbc
What else? There must a mega list of questions that you can add to this list.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems both are similar, great cow basic seems even easier to set up.
as I understand: GCB is taking care about your TRISA, ANSEL etc registers, so less traps when starting a new project. And you dont have to go too often into the PIC datasheet.
I wonder how far a C compiler (e.G XC8) supports you to find the right register settings. I fear that more pitfalls are possible?
So as I see it -please add your experience:
melabs picbasic: (I have 20 years experience, but not too intensely)
+ simple and easy to start and understand
+ special debugging over serial port
+ debugging over MPLAB IDE integration (but never tried)
- not too many examples / libraries
- maybe not too many users nowadays, not much present in internet
gread cow basic (have not yet tried)
+ simple and even easier to start
+ open source with all its benefits -GREAT !
+ my impression so far: pretty good community support
+ many answers one can find by searching in internet
? debugging possibilities
- maybe the name creates confusion among engineers :-)
C-compiler e.G MPLAB XC8 (have not yet tried)
+ used by professional programmers
+ debugging possibilities
+ I guess thousands of libraries and examples
+ no limitations - only you own time and brain maybe...
- maybe tricky to start with ? Especially when one is not yet familiar with C?
or is the learning curve comparable to picbasic/gcbasic???
- free version limited (not sure how far this is a disadvantage)
BR from Austria
Herb
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The debugging over RS232+Terminal is in my opinion the easiest and a very efficient method. Thanks also for the video to debug over ASM code in MPLAB, very interesting.
just for information,
PBP offeres some integration into MPLAB to debug the basic code directly, but not sure if one can read the memory/ registers also, I never tried it. This is the only video I could find:
I think, I will install both GBC and XC8 and try a simple bink + serial out program. Then I can compare to PBP on my own and will report my experience.
BR from Austria
Herb.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been working on an enhanced method of debugging over RS232 that eliminates, or greatly reduces, the memory overhead of serial debugging and at the same time emulates some of the features of hardware debugging.
It uses a custom application in place of the terminal emulator to cut down on the overhead of VT100 code strings but also to add features that exceed the capabilities of a normal serial port debugger.
I have had it on the back burner for a while now but as my overseas holiday is no longer possible and I still have another two weeks of Lockdown to look forward to now may be a good time to revisit it.
I will create a thread soon to cover the development for those who would like to beta test it and comment on the project, I hope you will contribute.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
what I really like on GCB, its kept simple and smart, no fat, no bloatware. no overengineering. Perfect, quick and reliable for many control tasks.
This is real engineering !
I will definitely use it for my next projects, where IO control, timing, serial etc is necassary.
Then I would like to come back to your offer, chris to test the enhanced debugging.
But in near future I will also have to do a more complex project:
- to read wave files from a flash memory (or SD card, which might be more complex)
- output this signal as PWM over a filter or over a DAC.
please give me your opinion to this. I am not sure if this would be possible with GCB.
are there examples for SPI flash reading or handling SD cards?
many thanks and greetings,
Herb
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello GCbasic community,
I am working since many years with the melabs (2xx) compiler and wrote several programs for PIC.
Now I have to decide if I stay with this compiler (go to PBP3) or migrate to something new, e.G.: MPLAB XC8.
But recently I discovered GCbasic and I am really very impressed.
So my questions to you experts:
What is your experience in comparison melabs to GCbasic?
How difficult would it be to migrate existing PBP code?
I could not find a discusion MPLAB XC8 vs GCbasic (I know C is hardly comparable to basic)
but what are your pros and cons?
When are you prefering XC8 and when GCbasic?
I have many years experience with assembler, pic-basic and other languages, except C. My programms have around 1000 lines of code and I use it for controlling I/Os and serial communication. Migrating this software to a new system might be an issue.
So I guess GCbasic would be quicker to start with?
many thanks for you answers.
BR from Austria,
Herb.
@Herb
Great questions.
My assumption is that https://melabs.com/samples/LABX1-16F1934/adcin10_1934X.htm are examples of MELAB.
I have not see MELAB - Please confirm that the URL and the samples on that page represent MELAB, No point in my starting from the wrong example of the MELAB language.
Meanwhile have a look at an example to compare and contrast MELAB and Great Cow BASIC.
Evan
a port to Great Cow BASIC. This took about two minutes over a coffee. :-)
What else? There must a mega list of questions that you can add to this list.
Hello,
many thanks for your detailed answers!
about the comparison code above:
It seems both are similar, great cow basic seems even easier to set up.
as I understand: GCB is taking care about your TRISA, ANSEL etc registers, so less traps when starting a new project. And you dont have to go too often into the PIC datasheet.
I wonder how far a C compiler (e.G XC8) supports you to find the right register settings. I fear that more pitfalls are possible?
So as I see it -please add your experience:
melabs picbasic: (I have 20 years experience, but not too intensely)
+ simple and easy to start and understand
+ special debugging over serial port
+ debugging over MPLAB IDE integration (but never tried)
- not too many examples / libraries
- maybe not too many users nowadays, not much present in internet
gread cow basic (have not yet tried)
+ simple and even easier to start
+ open source with all its benefits -GREAT !
+ my impression so far: pretty good community support
+ many answers one can find by searching in internet
? debugging possibilities
- maybe the name creates confusion among engineers :-)
C-compiler e.G MPLAB XC8 (have not yet tried)
+ used by professional programmers
+ debugging possibilities
+ I guess thousands of libraries and examples
+ no limitations - only you own time and brain maybe...
- maybe tricky to start with ? Especially when one is not yet familiar with C?
or is the learning curve comparable to picbasic/gcbasic???
- free version limited (not sure how far this is a disadvantage)
BR from Austria
Herb
Last edit: Herb Sgm 2020-04-07
Re debugging. See this thread https://sourceforge.net/p/gcbasic/discussion/579125/thread/3ec7fe0760/
Many thanks, Amobium!
The debugging over RS232+Terminal is in my opinion the easiest and a very efficient method. Thanks also for the video to debug over ASM code in MPLAB, very interesting.
just for information,
PBP offeres some integration into MPLAB to debug the basic code directly, but not sure if one can read the memory/ registers also, I never tried it. This is the only video I could find:
https://www.youtube.com/watch?v=2tHxbGHVR_4
I think, I will install both GBC and XC8 and try a simple bink + serial out program. Then I can compare to PBP on my own and will report my experience.
BR from Austria
Herb.
https://www.youtube.com/watch?v=IuYqMOYyD50&feature=youtu.be
If it takes more than 4 minutes to flash an LED get back to us.
Hi Herb,
I have been working on an enhanced method of debugging over RS232 that eliminates, or greatly reduces, the memory overhead of serial debugging and at the same time emulates some of the features of hardware debugging.
It uses a custom application in place of the terminal emulator to cut down on the overhead of VT100 code strings but also to add features that exceed the capabilities of a normal serial port debugger.
I have had it on the back burner for a while now but as my overseas holiday is no longer possible and I still have another two weeks of Lockdown to look forward to now may be a good time to revisit it.
I will create a thread soon to cover the development for those who would like to beta test it and comment on the project, I hope you will contribute.
Cheers
Chris
Hi,
what I really like on GCB, its kept simple and smart, no fat, no bloatware. no overengineering. Perfect, quick and reliable for many control tasks.
This is real engineering !
I will definitely use it for my next projects, where IO control, timing, serial etc is necassary.
Then I would like to come back to your offer, chris to test the enhanced debugging.
But in near future I will also have to do a more complex project:
- to read wave files from a flash memory (or SD card, which might be more complex)
- output this signal as PWM over a filter or over a DAC.
please give me your opinion to this. I am not sure if this would be possible with GCB.
are there examples for SPI flash reading or handling SD cards?
many thanks and greetings,
Herb