CCS Accelerates Embedded Development with New Code Optimizing C Compiler 4.1XX

Version 4.1 of the CCS code optimizing C compiler frees developers to concentrate on design functionality instead of having to become MCU architecture experts. It provides support for Microchip's Enhanced Mid-Range core architecture and enhances developer productivity with a rich library of capacitive touch functions and improved Microchip library compatibility. Code size reductions of up to 18% are realized through optimized string handling and new syntax extensions.

Accelerate Your Productivity Download Version 4.1xx Demo

Compiler version 4.1 also features a host of general productivity enhancements. These include eliminating the requirement that function pointers be dereferenced, expansion of #build and #export to improve interfacing to bootloaders and resident libraries and new functions to find port pins that have changed state. Compiler version 4.1 is immediately available in product configurations priced from $50 to $600 running on Windows and Linux computing platforms, and can be purchased in conjunction with CCS application or device specific development kits. CCS customers with a current software maintenance agreement can also download version 4.1 at no charge.

Microchip Enhanced Mid-Range core architecture support

The CCS code optimizing C compiler has been enhanced to support up to 56K instructions and 4K RAM for these new 14-bit opcode devices. The Enhanced Mid-Range core's 16-level hardware stack is supported by the compiler's new 16-level call stack, reducing the number of inlined system functions that must be coded. Built-in system functions are provided for all of the enhanced peripherals including A/D converters and comparators, SPI and I2C serial busses, PWM, mTouch™, non-volatile memory, op-amp and LCD drive.

Rich Library of Capacitive Touch Sensing Functions

The CCS Library of touch sensing functions facilitates the implementation of touch keys and sliders.

#include <16lf727.h>
#fuses INTRC_IO,NOWDT
#use delay(INTERNAL=8Mhz)
#use rs232(baud=9600,rcv=PIN_E0,xmit=PIN_E1)

#use touchpad(scantime=32ms,threshold=6,PIN_B1='0',PIN_B0='1',PIN_D7='2',PIN_D0='3')

void main()
{
   char c;

   enable_interrupts(GLOBAL);
   
   while(TRUE)
   {
      if(touchpad_hit())
      {
         c=touchpad_getc();
         putc(c);
      }
   }
}

Better Support for Microchip Style Source Code Compilation

Better support for Microchip style source code compilation makes it easier to port code from Microchip libraries.

New syntax extensions

New syntax extensions permit the use of strings in switch statements, simplifying string comparisons and reducing program memory size up to 18%

#include <18F452.h>
#fuses HS,NOWDT
#use delay(clock=20M)
#use rs232(baud=9600,UART1)

#include 

#define RED_LED      PIN_B5
#define YELLOW_LED   PIN_B4
#define GREEN_LED    PIN_A5

#define STRING_BUFFER   10

#define red_on()     output_low(RED_LED);
#define red_off()    output_high(RED_LED);
#define yellow_on()  output_low(YELLOW_LED);
#define yellow_off() output_high(YELLOW_LED);
#define green_on()   output_low(GREEN_LED);
#define green_off()  output_high(GREEN_LED);

void main()
{
   int8 i;
   char string[STRING_BUFFER];

   while(TRUE)
   {
      i=0;
      printf("nnrEnter LED to turn: ");
      get_string(string,STRING_BUFFER);
      
      switch(string)
      {
         case "RED":
         case "red":
            red_on();
            yellow_off();
            green_off();
            break;
         case "YELLOW":
         case "yellow":
            red_off();
            yellow_on();
            green_off();
            break;
         case "GREEN":
         case "green":
            red_off();
            yellow_off();
            green_on();
            break;
         case "ALL OFF":
         case "all off":
            red_off();
            yellow_off();
            green_off();
            break;
         default:
            red_off();
            yellow_off();
            green_off();
            printf("nrInvalid LED");
            break;
      }
   }
}

MPLAB® ICD 2 , dsPIC® DSC and PIC®MCU are a registered trades of Microchip Technology Inc in the U.S.A and other countries.