Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC languages other than MPASM that have free or limited versions?

Status
Not open for further replies.
I've wanted to explore other languages aside from assembler for the PIC. MeLabs has a demo version of their PICBASIC PRO. Although limited to 31 lines of code in the demo version it can be handy for the beginner or a bit of quick coding.

Are there other demo languages eg C that will compile small programs?
 
Bill,
Have a look at HiTech PicCLite. It's free and supports a few chips some with no restriction at all. The limitation on the 877 is that it limits you to 2K code!! It also integrates with MPLab so you can use the simulator and debugger.

Mike.
 
C can be used! See attachment.

The tutorial is created by someone from other forum.
 

Attachments

  • Quickguide for Installing the necessary software for PIC p….pdf
    336.3 KB · Views: 417
I just found it thanks. C is a language I've always wanted to learn. I'd like to put a book together with experiments for one of my next PCBs.

Not sure which to build first...

1. Tick (A ZIF socket programmer with a 16F88 tutor)
2. Dolphin (A 16F887 / 877A tutor with LCD, buttons, LEDs and a protoboard)

Tick about $40, Dolphin about $80
 

Attachments

  • tick B.png
    tick B.png
    67 KB · Views: 318
  • dolphin 87 partial.png
    dolphin 87 partial.png
    55.4 KB · Views: 262
I would recommend BoostC ( http://sourceboost.com ). Unlike PICClite, the free version does not limit what devices you can use, it just imposes a 2k code limit. And, if you decide you like it, licenses for the compiler are WAY cheaper than licenses for more commercial ones like PICClite; for example, a full (unlimited code size, etc) license of boostC is $70, or a more limited license that gives you more code space than the free version (but still not unlimited) is only $30. A full license of PICC is $950. you do the math ;)

Plus, you can do quite a lot with the 2k code limit in the free version of boostC; with most simple programs you never even come close to that.

the main difference as I see it is that BoostC uses its own IDE (sourceboost), whereas PICC integrates into MPLAB, so it supports in-circuit debugging. BoostC supports simulation, but doesn't support ICD. Personally the extra $900 or so for PICC doesn't seem worth it to me, just to get ICD support, but to each his own :)
 
Last edited:
Microchip makes C18 (aka "MCC18") for the PICC18 series and C30 for the dsPIC30F/33F series.

They have a free "student" version which is not limited by code size. After the trial period some of the optimizations are disabled so the code will not be quite as efficient.
 
Yeah, I forgot to mention that... Lately I have been dealing with the USB-capable 18F PICs, and I have been using C18 because most of the existing example code out there is written in it. BoostC does support the 18F series PICs, but since the free student edition of C18 is so good (unless you're quite seriously pushing the limits of the 18F's in terms of code size or raw speed, the optimizations you lose with the free version don't even matter) I haven't felt a need to use anything else. But for 12F or 16F series PICs (and probably 10F, though I haven't used them personally) I would still suggest BoostC.
 
Bill. I have PIC basic (not pro) and MBASIC standard/pro. I bought them and found out they are not quite what I wanted.

So what do I use outside of MPLABS? I am with WilliB.. I use Mikrobasic now, have not bought it. Wish I could trade in the other too I bought for a discount. MikroBASIC works well, you still have uC dependant stuff, handles inline ASM.

They also work with Atmel and Microchip.
 
An open-source C Compiler for MCU's

Hi,
there is a totally free, and open source C compiler named SDCC
it supports Intel 8051,Maxim 80DS390,Zilog Z80,Motorola 68HC08
But the work is in progress for PIC16 and PIC18.
It's perfect:)
http://sdcc.sourceforge.net/
hope to usefull
 
I was looking for a free 16F88 C compiler; is there anything odd about the Free B Knudsen CC5X compiler? https://www.bknd.com/cc5x/

I can't get it to compile from MPLAB. I get this error
Error[1] C:\PIC Demos\blink.c 1 : Unable to open file '16F88.h'

I've set the paths from within MPLAB. Not sure what I'm doing wrong.
 
Last edited:
Bill,

From the FAQ at CCX5.

The include files path $(INCDIR) found on "Project->Build Options->Project" need doublequotes ("...") if the path names contain spaces. Also, do not use a backslash+doublequote (\") at the end of the path name because the options forwarded to the compiler will not be right then.

Mike.
 
evandude said:
BoostC does support the 18F series PICs, but since the free student edition of C18 is so good (unless you're quite seriously pushing the limits of the 18F's in terms of code size or raw speed, the optimizations you lose with the free version don't even matter) I haven't felt a need to use anything else.

In my experience, C18 code ran FAR slower than PICC18 code. Both were about the same size.

I've never tried BoostC.
 
I did get some time up with the assembler language, and as far as im concerned, after getting Proton+ by crownhill **broken link removed** i'll never look back. The only downfall that I can perceive at the moment is the loss of counting cycles/pin changes over time periods while still performing other functions. It can still be done via

Variable = COUNTER Pin , Period

But you loose the ability to perform other functions at the same time. You can if you so desire build the interrupt routines, but hey, what makes up for it is the unbelievable in comparison math functions. you simple scan the port for 100ms or less, and do some math to scale the result. Sure it depends on you application, but for some of mine(digital tacho/baud tester) its suffice. Proton+ has complete support for 8/16/32 bit math operators, and its dead easy, eg

Dim Var1 as byte 'create an 8 bit variable
Dim Var2 as word 'create an 8 bit variable
Dim Var3 as dword 'create an 8 bit variable
Dim Result as dword

var1=10 'throw some data in them
var2=1000
var3=10000000

result = var3 / var2 * var1

print at 1,1, "Answer: ", result 'throw it up on an lcd

SEROUT PORTA.0 , T9600 , ["AZ", dec result,"M"] 'send it via 9600 baud
'********************************************************

For serial data receiving its as simple as:

SERIN PORTA.1 , T9600, 50, Time_Out,[wait("AZ"),dec result]
.
.
.

Time_Out:
'This is where it will end up should no data be recived within 50ms
'********************************************************

Theres a complete help file that breaks down every command, and gives examples on how to use every command.

It blew my mind when i could control a matrix keypad, 433Mhz Tx/Rx, and an LCD with pins to spare with only 2 pic micros, and the code is dead simple.. eg:

transmitter code:

Dim Variable as byte


Main:

Variable = INKEY 'If no key is pressed, the value returned is 16.

If Variable=16 then
Goto Main
Else
Variable=Variable+1 'Increment it as the value is 0-15 for key press
'but actual input is 1 - 16 for a 3*4 keypad

SEROUT PORTA.0 , T2400 , ["AZ", dec Variable,"M"] 'send it via 2400
'as my RF unit only supports upto 3K baud
End If


Delayms 20 'debounce for the keypad

goto Main

Reciever Code:

Dim Variable as byte


Main:

SERIN PORTA.1 , t2400, 80 , Time_Out,[wait("AZ"),dec Variable]
Print at 1,1, "Key Pressed:", Variable," "

Goto Main

Time_Out:

Goto Main

How easy is that.. just imagine the same simplicity with A/D conversions, graphics lcd interfacing the following math operators:

Addition '+'. Adds variables and/or constants.
Subtraction '-'. Subtracts variables and/or constants.
Multiply '*'. Multiplies variables and/or constants.
Multiply HIGH '**'. Returns the high 16 bits of the 16-bit multiply result.
Multiply MIDDLE '*/'. Returns the middle 16 bits of the 16-bit multiply result.
Divide '/'. Divides variables and/or constants.
Modulus '//'. Returns the remainder left after dividing one value by another.
Bitwise AND '&'. Returns the bitwise AND of two values.
Bitwise OR '|'. Returns the bitwise OR of two values.
Bitwise XOR '^'. Returns the bitwise XOR of two values.
Bitwise SHIFT LEFT '<<'. Shifts the bits of a value left a specified number of places.
Bitwise SHIFT RIGHT '>>'. Shifts the bits of a value right a specified number of places.
ABS. Returns the absolute value of a number.
ACOS Returns the ARC COSINE of a value in RADIANS.
ASIN Returns the ARC SINE of a value in RADIANS.
ATAN Returns the ARC TANGENT of a value in RADIANS.
COS. Returns the COSINE of a value in RADIANS.
DCD. 2 n -power decoder of a four-bit value.
DIG. Returns the specified decimal digit of a positive value.
LOG Returns the NATURAL LOG of a value.
LOG10 Returns the LOG of a value.
MAX. Returns the maximum of two numbers.
MIN. Returns the minimum of two numbers.
NCD. Priority encoder of a 16-bit value.
REV. Reverses the order of the lowest bits in a value.
SIN. Returns the SINE of a value in RADIANS.
SQR. Returns the SQUARE ROOT of a value.
TAN

copy and paste ftw

One difference that I did find between PICBASIC PRO and Proton+ is this:

PICBASIC Pro bit setting/clearing with a variable:

porta.0[Variable] = 1 'sets bit(variable) of porta
porta.0[Variable] = 0 'clears bit(variable) of porta

Proton+ :

doesn’t work..

If someone knows how to over come this - PLEASE let me know :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top