Programming Microcontrollers in C

Discussion in 'Embedded Systems and Microcontrollers' started by CVMichael, Jul 15, 2008.

  1. CVMichael

    Thread Starter AAC Fanatic!

    Aug 3, 2007
    I need some advice:

    At the moment I program PIC16F877 using the demo MikroC, hex output is limited to 2k of program words:

    It has a price tag of $249 for the full one...

    Wich I would buy.... but... I also have a dsPIC30F1010, and for that they have a different compiler:

    And that one is again $249...

    So... to program the 2 microchips that I have, I have to pay $500 !!

    And guess what... today I reached the 2K limit of the demo MikroC I'm using...
    I tried to cut some parts of the code to make it shorter, but that cripples the whole thing... so I can't...

    I like MicroC, so I'm thinking to get it... but then I have to pay again when I want to buy the MikroC for dsPIC30/33.

    What are your suggestions ?
  2. nanovate

    Distinguished Member

    May 7, 2007
    This is why many people prefer the AVR -- free full strength compilers with no restrictions. Atmel's credo is "we sell chips not development tools". That being said... Microchip has student versions for many of the chips. These are full featured for 60 days and then they lose some of the optimization functionality -- increases code size. In most applications this is not a problem.

    IIRC if already have one mickroC compiler then you can get a discount on the second one.
  3. n9352527

    AAC Fanatic!

    Oct 14, 2005
    Microchip does not have any C compiler for the PIC16 series microcontrollers.
  4. AlexR

    Well-Known Member

    Jan 16, 2008
    Take a look at SourceBoost C. If your code exceeds 2K words you will still need to get a "payed-for" version for the code to compile, but its a lot cheaper than MicroC and in my opinion its just as good.

    The other option is to change your design to use a PIC18 chip and then get the C18 free student version compiler from the Microchip site.
  5. roddefig

    Active Member

    Apr 29, 2008
    I second the recommendation of the AVR. You could also take a look at the MSP430 line from TI. Both have ports of GCC and libc available and a large amateur community. If you want to continue working with C I wouldn't continue using the PIC, which is more suited to programming in assembly.
  6. CVMichael

    Thread Starter AAC Fanatic!

    Aug 3, 2007
    Do AVR have the same processing power as PICs ?

    I looked around in the past, and I saw that AVR's osscilators are low frequencies... therefore I am to assume that the MIPS is lower on AVRs than PICs

    Doing a quick search on the net, PICs go up to 40 MIPS (I think that's what I saw the highest), and 90 MIPS for 32 Bit PICs, while AVRs I saw up to 20 MIPS.

    I know that AVR's MIPS = osscilator frequency, and I find that very nice... but still PICs seem to be faster overall...
  7. nanovate

    Distinguished Member

    May 7, 2007
    Just about all the AVRs go from 16 MIPS to 32 MIPS (XMEGA) at 2.7V.

    The PIC12/16/18 are 10 to 16 MIPS at 3V.

    At 1.8V to 2.7V the AVRs range from 4 MIPS to 12 MIPS while AFAIK the PICs are 4 MIPS.

    The PIC32 is 90 DMIPS and the AVR32-AP7 is 210 MIPS and the AVR32-UC3 is 83 DMIPS

    The 40 MIPS PICs are their 16-bit devices-- PIC24 and dsPIC33

    In the 8-bit range the AVRs are potentially faster but often the difference is more academic since the deciding factor for which device to use depends on all the other things-- price, tools, already written code, size, etc...
  8. John Luciani

    AAC Fanatic!

    Apr 3, 2007
    I would also recommend the AVR. There is a large software community (arduino) and a lot of examples. The tools are available on Linux, MAC and Windows.

    I also use the MSP430 and GCC. Getting some of the tools (e.g. USB-FET) to work
    on Linux can be problematic. Also there seems to be a lag in GCC support
    for newer MSP430 chips.

    (* jcl *)