Need to convert a PicAxe Basic interpreter program to a faster GCBasic compiler. What's the best way to do this?
How much increase in speed can be expected? With the interpreter it completes a loop through the program 130 times a second. Uses a lot of "if" statements and some increment statements.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The best way to learn GCBasic in my mind is to try out mini projects including leds, a-d, PWM, LCD, digital inputs, USART etc. Keep a close eye on the help file in the GCBasic directory or web page, as there are lots of examples to try out. Hopefully the syntax won't be all that different from the PICAxe.
No clue as to what kind of speed increase you will see. The fastest available 8 bit PIC is the 18FxxK series at 64Mhz or 16Mips. A meaningless example would be a bit toggle loop that takes 3 instructions (two at 1 cycle, and one at 2 cycles) for a top speed of 4Mhz.
When you have the PICAxe program ported to GCBasic, throw the compiled assembler file in the Microchip MPLAB Simulator/stopwatch, and out pops the number of instructions and elapsed time. Then get back to us on how much faster it is :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I'm not getting anywhere. Downloaded CGBasic into C/program file, Can't find anywhere to run it, no icon or exe file that starts it, just a list of files. What's wrong here?
Trying to download Crimson ends up very unclear what to do in source forge to get a download. It lists some new version. Whats wrong here?
Does GCBasic support inc and dec?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, GCBasic doesn't present itself as a 'desktop' application. GCBasic does all the background work necessary to generate the compiled.HEX file in the GCBasic directory. The compiled.HEX file is the one to import to your programmer, and burn to your PIC.
Once you have the GCBasic 9.3 downloaded, then be sure to download the , and paste that into the GCBasic folder/directory for all the latest.
If you are using Crimson Editor, and have followed the instructions from the section of the GCBasic website, then you are ready to start programming. Realize that Crimson Editor, or some other IDE, will be the face/desktop of GCBasic.
Go to File > New in CE, or other IDE, and paste the following 'blink led' code in and press the compile hotkey (or Ctl 9). A few seconds later you will have compiled.HEX file in the GCBasic folder ready for download/import to your programmer. Write the file to the PIC, and the blinky should appear if all went right. Get back with results, or status of any errors.
#chip 12f683,8
#config _INTRC_OSC_NOCLKOUT
#define led GPIO.2
dir LED out
start:
Set led on
wait 1 s
set led off
wait 1 s
goto start
Notes: substitute your processor, and clock speed as required. If an external oscillator is involved, then comment out, or remove the #config line for the internal oscillator. Double check the chipdata folder for proper oscillator configurations for other device families like 18f.
Need to convert a PicAxe Basic interpreter program to a faster GCBasic compiler. What's the best way to do this?
How much increase in speed can be expected? With the interpreter it completes a loop through the program 130 times a second. Uses a lot of "if" statements and some increment statements.
The best way to learn GCBasic in my mind is to try out mini projects including leds, a-d, PWM, LCD, digital inputs, USART etc. Keep a close eye on the help file in the GCBasic directory or web page, as there are lots of examples to try out. Hopefully the syntax won't be all that different from the PICAxe.
No clue as to what kind of speed increase you will see. The fastest available 8 bit PIC is the 18FxxK series at 64Mhz or 16Mips. A meaningless example would be a bit toggle loop that takes 3 instructions (two at 1 cycle, and one at 2 cycles) for a top speed of 4Mhz.
When you have the PICAxe program ported to GCBasic, throw the compiled assembler file in the Microchip MPLAB Simulator/stopwatch, and out pops the number of instructions and elapsed time. Then get back to us on how much faster it is :-)
Well, I'm not getting anywhere. Downloaded CGBasic into C/program file, Can't find anywhere to run it, no icon or exe file that starts it, just a list of files. What's wrong here?
Trying to download Crimson ends up very unclear what to do in source forge to get a download. It lists some new version. Whats wrong here?
Does GCBasic support inc and dec?
1) You need an integrated development environment (IDE). Try prithvi.sourceforge.net.
2) INC: variable = variable+1
3)DEC: variable = variable-1
Yes, GCBasic doesn't present itself as a 'desktop' application. GCBasic does all the background work necessary to generate the compiled.HEX file in the GCBasic directory. The compiled.HEX file is the one to import to your programmer, and burn to your PIC.
Once you have the GCBasic 9.3 downloaded, then be sure to download the , and paste that into the GCBasic folder/directory for all the latest.
If you are using Crimson Editor, and have followed the instructions from the section of the GCBasic website, then you are ready to start programming. Realize that Crimson Editor, or some other IDE, will be the face/desktop of GCBasic.
Go to File > New in CE, or other IDE, and paste the following 'blink led' code in and press the compile hotkey (or Ctl 9). A few seconds later you will have compiled.HEX file in the GCBasic folder ready for download/import to your programmer. Write the file to the PIC, and the blinky should appear if all went right. Get back with results, or status of any errors.
#chip 12f683,8
#config _INTRC_OSC_NOCLKOUT
#define led GPIO.2
dir LED out
start:
Set led on
wait 1 s
set led off
wait 1 s
goto start
Notes: substitute your processor, and clock speed as required. If an external oscillator is involved, then comment out, or remove the #config line for the internal oscillator. Double check the chipdata folder for proper oscillator configurations for other device families like 18f.
: http://gcbasic.sourceforge.net/update.html
: http://gcbasic.sourceforge.net/update.html