Page 1 of 1

Free "PIC" BASIC compiler: GCBASIC

PostPosted: Mon Feb 02, 2009 4:58 pm
by jfmain
Hi all,

Last year I had a look at a free open source BASIC compiler called Great Cow BASIC specifically for use with the PIC devices anf it worked quite well i.e. it generated code. The main disadvantage is that it does not have an IDE (although there is another sowftware download IDE which I did not try - an IDE for GCBASIC) - I just used an editor, the note pad and a command line prompt.

I have not looked at it since as I don't use basic a great deal. (Coukd change depending on the forum comments etc. ;) )

  • Free
  • unlimited code size

  • When I used it it would not partition a program across the 16F877 segmented memory correctly : Solution is probably to only use a non-segmented memory (or less segmented) 18F series device - this issue may have been solved as there have been many updated since I last had a look at it.
  • Command line based (probably the IDE can be setup for command execution)
  • No simulation

Hey it's free! :mrgreen:

Remember it's pobably a bit buggy and will have less support than a commercial offering (you could wade in and help out ;) that way it will improve) but regardless of that, it is an interesting project.

Here's some of the details "Follwing is a quote from the site: " :

The syntax of Great Cow BASIC is based on that of QBASIC/FreeBASIC, but with some alterations to suit the vastly different system that it compiles for. The assembly code produced by Great Cow BASIC can be assembled and run on almost all 10, 12, 16 and 18 series chips. Please see "Supported chips" for a list of chips that GCBASIC is intended to work with.


Simple, useful language:

* Standard BASIC flow control statements - If, Select Case, Do, For, Goto
* Support for multiply, divide, add, subtract, boolean operations and comparisons.
* Bit, Byte, Word and String data types, in addition to byte arrays.
* Subroutines and Functions
* Inline assembly, in most cases without any special directives
* Data tables

Portable, reusable code:

* Supports most 8-bit PIC microcontrollers
* Write code for a 10F, easily adapt it for an 18F!
* Wait command, which gives the same length delay regardless of clock speed.

I/O capabilities:

* Standard 2x16 LCD routines
* Routines for on-chip A/D, PWM, SPI, EEPROM and Timers
* RS232 communications - rates between 300 and 19200 bps with user configurable parity, start and stop bits.
* PS/2 keyboard reading
* 4x4 Keypad

Other features:

* Ample support - help file, example programs, forum and email
* Several translations
* Generates standard MPASM compatible assembly code.
* Free, both in the free beer way and the free speech way!

Supports : 10, 12, 16 and 18 series chips.

You can find it here:


Re: Free "PIC" BASIC compiler: GCBASIC

PostPosted: Sun Nov 28, 2010 5:44 am
by James1
Hi -

I am trying to program PIC16F877A(16Mhz) bootloader. The language in which I have written the code is Basic, and the compiler is Microcode studio.
The program gets compiled correctly producing a hex file. Now when I download the hex fie in the controller the controller doesn't respond to the code.

The code is :

'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 11/23/2010 *
'* Version : 1.0 *
'* Notes : *
'* : *

* device PIC16F877A,HS_OSC
* device PIC16F877A,WDT_OFF
* device PIC16F877A,PWRT_OFF
* device PIC16F877A,DEBUG_OFF
* device PIC16F877A,CPD_OFF
* device PIC16F877A,PROTECT_OFF

loop: high 1
pause 20
low 1
pause 20
goto loop


Is this the problem with the configuration bits or it is something else(compiler). If you know some other Basic compiler, please send me the link so that I can
download it.