Sei sulla pagina 1di 158

1526 CCS

Using the CCS C Compiler


for Rapid Development of
Microcontroller Applications
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

Class Objective

When you finish this class you will:


Be able to use your C knowledge and
write applications using the CCS C
Compiler
Know the ways the CCS C Compiler
speeds up development time
Develop new application and coding
ideas

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

Agenda

Compiler Overview
Design Goals, Compiler Products

Compiler Methodology
Differences to Common C
Data Types

Programming Details
Required Setup, Interrupts

Built-In Functions
GPIO, Delays, Serial (Asynch, I2C, SPI)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

Agenda
Hands-on Labs

Lab 1: 0 to blinky LED in 60


seconds
Lab 2: The CCS IDE Debugger
Lab 3: Analog to Digital peripheral
Lab 4: Stopwatch using interrupts

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

Compiler Overview

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

Design Goals

Ease of use compile and go!


Quick development time (with
built-in functions,
drivers/libraries, extensive
examples)

Easy PIC MCU to PIC MCU


migration
Optimization comparable vs.
assembly

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

CCS Command Line Compiler

Product Line:
-

PCB - Baseline PIC MCUs


PCM - Mid-range PIC MCUs
PCH - PIC18 Family PIC MCUs
PCD - PIC24/dsPIC30/dsPIC33

Integrates into MPLAB IDE

Linux and Windows versions

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

PCW Windows IDE

C Aware Editor
Debugging
Integrated RTOS
Linker and Relocatable Objects
Document Generator
Flow Chart Editor

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

CCS Support Policy

E-Mail / Phone Support


Duration is Unlimited!

Updates (new devices, drivers)


Requires Maintenance Contract
Maintenance can be extended any time

Large Customer Base


Rapid Releases
Average once per week

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

Compiler
Demonstration

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

10

Hands-on Lab #1
Blinky LED
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

11

Lab 1 Objectives

Hands-on experience with


compiler
Use tools and development
board
Use CCS Project Wizard
Create blinky-LED

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

12

Prototyping Hardware

PIC16F887
ICD Connection
Pot on AN0
Button on RA4
LEDs on RA5, RB4 and RB5
RS232 driver and mini-connector
Header to all GPIO

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

13

Lab 1: Project Wizard


Project Wizard Overview

Creates an initial framework


Assists in the initial
configuration of internal
peripherals
Configuration screen for all
internal peripherals
Windows IDE Only

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

14

Lab 1 Hints

LED will blink at 1Hz rate


Follow handout
Verify:
Correct PIC MCU selected
Correct #FUSEs selected
Correct #use delay() specified
Fix any compile errors

Bored? Try Extra Credit

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

16

Compiler
Methodology
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

17

Differences to Common C

Case insensitive
#case will make it case sensitive

Variables not initialized to zero


#zero_ram inits all variables to 0

const places variable into ROM


By default, const strings cannot be
parameter
SomeFunc(Hello) is usually illegal
#device PASS_STRING=IN_RAM

#device ANSI

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

18

ANSI Non-Compliance

No fopen(), fclose(), etc


fprintf() supported, methodology a
little different

printf() formatting string must be


known at compile time
Recursion allowed on some

PIC MCUs

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

19

Data Types
short
char
int

PCB/PCM/PCH
1-bit
Unsigned 8-bit
Unsigned 8-bit

PCD
1-bit
Unsigned 8-bit
Signed 16-bit

long

Unsigned 16-bit

Signed 32-bit

long long

Unsigned 32-bit

Signed 64-bit

float

MCHP 32-bit

IEEE 32-bit

double

NO SUPPORT

IEEE 64-bit

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

20

Data Types

#type can change default size


#TYPE SHORT=8, INT=16, LONG=32

Optimization Tips
Use int over char/long as much as possible
If you must use float, use only one type

Non-standard data types


int1
int8
int32
int48*
float32
float48*
__address__

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

int16
int64*
float64* (PCD ONLY)

1526 CCS

Slide

21

Bit Arrays

Array of bits:
int1 flags[30];
flags[i] = TRUE;
if (flags[10]) { /* some code */ }

Bits are packed


Pointers not supported

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

22

Fixed Point Decimal

Decimals with integers, not floats!


Faster, Smaller
100% precision

Stores value in 10 power


Declaration:
[type] _fixed(y) [declarator]
int16 _fixed(2) money

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

23

Fixed Point Examples

int16 _fixed(2) money;


Range: 0.00 to 655.35

money = 20.50;
money += 5;
//adds 5.00
money += value;
printf(%w, money);

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

24

RAM Allocation
first come, first served in this
Allocated
order:

- globals
- static
- local
Call tree finds RAM that can be reused
User can force RAM placement
Struct/array cannot be larger than bank
- Enhanced PIC16, PIC18, 16-bit PIC MCUs
exempt

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

25

const vs. rom

const has two modes:


#device CONST=ROM DEFAULT
#device CONST=READ_ONLY

const is always read-only


rom places variable in ROM
rom writable if supported by PIC MCU
Examples
const int lookup[16] = {0...15};
const char string[] = Hello;
rom char *cptr = Hello;

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

26

Program Space Visibility (PSV)

PIC24, dsPIC30, dsPIC33


Mix RAM and ROM pointers
#device PSV=16
const/rom will ignore odd byte
Example:

rom char str[] = Hello;


char *ptr = str;

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

27

Borrowed from C++


Reference Parameters

Pass address, not value


Values can be changed in function
Similar to using pointers
Efficient for large structures
Optimizes better than pointers, compiler
may inline function

Declare reference parameters with &


void Inc(int &i) {
}

i++;

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

28

Borrowed from C++


Default Parameters

Default value passed to function


if no value specified
Examples:
void Get(char *c, int time=200);
Get(&c);
time will be 200

Get(&c, 500);
time will be 500
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

29

Borrowed from C++


Function Overloading

Multiple functions, same name


Different parameters
Example:
Three different functions called Inc
int Inc(int *i);
long Inc(long *l);
float Inc(float *f);

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

30

In-Line Assembly

#asm
Starts an assembly block

#endasm
Ends an assembly block

_return_
Assign return value
May be corrupted by any C code
after #endasm

Supports all opcodes


C variables can be accessed
Automatic banking
#asm ASIS - disables
auto-banking

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

int find_parity (int data)


{
int count;
#asm
movlw
0x8
movwf
count
movlw
0
loop:
xorwf
data,w
rrf
data,f
decfsz count,f
goto
loop
movlw
1
addwf
count,f
movwf
_return_
#endasm
}
Slide

31

Output Files

HEX Compiled Application


COF Debug Application
ERR Compile output messages
LST C to Assembly comparison
SYM Memory Map
STA Statistics
TRE Call Tree

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

32

Programming
Details
Required Setup
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

33

Pre-processor

Design Goal: All in front of you


Everything is in the source code
No linker scripts

Pre-processor commands
change compiler-behaviour:
Methodology
ROM/RAM placement
Library configuration

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

34

#device

Loads personality for PIC MCU


#device PIC18F4520

Can alter low-level specifics


#device ICD=TRUE

PIC MCU header files have #device


If creating multiple compilation units
(linking), must be defined in each file
Put it in a common include file

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

35

#fuses

Define the configuration bits


#fuses HS, NOWDT, NOLVP

To get list of valid fuses:


In IDE, use View Valid Fuses window
Header file for the device has list

To get a description of each fuse:


In IDE, use View Valid Fuses window
fuses.txt

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

36

#use delay

Set PIC

MCU clock speed

- #use delay(clock=value)

Configures compilers libraries


- Serial, Delays, Timers

Configures PLL and config bits

- #use delay(crystal=8Mhz, clock=40Mhz)

Multiple clock speeds supported


2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

37

Programming
Details
Memory Placement
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

38

#byte / #word

Force location of RAM:


int val;
#byte val=0xA0

Overlaying variable onto SFR:


#byte STATUS=0x03
#word TMR1=0x0E

Repeat, but using getenv():


#byte STATUS=getenv(SFR:STATUS)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

39

#bit

#bit ident=X.b
Declares boolean at address X, bit b
Examples:

#bit CARRY=STATUS.0
#bit CARRY=getenv(BIT:C)

Dont forget:
Compiler will pack int1 variables
You can use struct to pack bits

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

40

#org

Fix placement in ROM

#org start, end


Place following function/constant in
specified program memory
#org 0x400,0x4FF
SomeFunction() { /*code*/ }
#org 0x500, 0x5FF
const someStruct[] = { }

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

41

Hands-On Lab #2
Debugging a Calculator
Application
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

42

Lab 2 Objectives

Learn basic debugging use


Breakpoints
Watches
ROM and RAM view
Peripheral Status

Learn advanced debugging use


Logging
1Wire RS232 on RB3

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

43

Lab 2 Directions

Program provided is a simple

calculator
Follow the directions on the
handout

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

44

BREAK TIME!

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

45

Programming
Details
Built-In Functions
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

46

Built-In Functions

Compiler provides functions to:


Control Peripherals (A/D, Serial, etc.)
Perform logic optimized to PIC MCU

Internal to compiler, not linked


Simplify PIC MCU to PIC MCU
migration
Follow any errata work arounds

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

47

#if defined(__PIC24__)
#include <24FJ64GA004.h>
#elif defined(__PIC18__)
#include <18F4520.h>
#elif defined(__PIC16__)
#include <16F887.h>
#endif
#fuses HS, NOWDT, NOLVP
#use delay(clock=20000000)
void main(void) {
while(TRUE) {
output_toggle(PIN_C0);
delay_ms(500);
}
}

getenv()

Assists in making portable code


Returns chip information
Program Memory Size
Bulk Erase Size
Configuration Bits Set

Options can be conditionally compiled:


#if getenv(ADC_CHANNELS) > 0
setup_adc_ports(NO_ANALOGS);
#endif

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

49

Built-In Functions
General Purpose Input / Output

output_high(PIN_XX)
output_low(PIN_XX)
Sets the pin to desired level
PIN_XX (ex PIN_C0, PIN_B5, etc.) are
defined in the device header file

output_toggle(PIN_XX)
Toggle high/low state of the pin

bool = input(PIN_XX)
Read value of pin

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

51

Built-In Functions
General Purpose Input / Output

output_X(value)
Sets the port X (A to J) to the value

byte = input_X()
Read value of port X

set_tris_X(value)
val = get_tris_X()
Get/Set the tristate setting

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

52

Built-In Functions
General Purpose Input / Output

#use standard_io(X)
Output functions set TRIS to output
Input functions set TRIS to input
This is the default operation

#use fast_io(X)
Compiler does not alter TRIS

#use fixed_io(port_outputs=pins)
#use fixed_io(d_outputs=PIN_D7)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

53

Built-In Functions
Bit Manipulation

bool = bit_test(var, bit)


Returns the value of the specified bit

bit_clear(var, bit)
bit_set(var, bit)
Set/clear the specified bit

The above bit_XXX() functions

use the PIC MCUs bit operation


opcodes for maximum efficiency

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

54

Built-In Functions
Delays

delay_cycles(x)
delay_us(x)
delay_ms(x)
Uses a series of loops and NOPs
Timing based on #use delay()
Multiple #use delay() allowed

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

55

#use delay(clock=125K)

//1 second delay @ 125kHz


void Delay1s125Khz(void) {
delay_ms(1000);
}
#use delay(clock=8M)
//1 second delay @ 8MHz
void Delay1s8Mhz(void) {
delay_ms(1000);
}

#use timer()

Creates a timing system


#use timer()
-

tick, set timing period in us, ms or s


timer, specify which timer to use
bits, size of tick counter
NOISR, ISR

defined by
TICKS_PER_SECOND
compiler
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

57

#use timer() Example


#use timer(timer=0, tick=50ms, bits=32)
unsigned int32 start;

start = get_ticks();
while(
(get_ticks() start) <
(TICKS_PER_SECOND*3)
)
{

// code processed for 3 seconds


}
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

58

Built-In Functions
Serial Libraries
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

59

Pop Quiz

You need to add another


serial port to your project,
but you have used all of the

PIC MCUs peripherals.

What do you do?


2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

60

UART

Powerful UART library built into


compiler
#use rs232(baud=xxxx, xmit=PIN_XX,
rcv=PIN_XX, stream=yyyyy)
TX/RX pins can be any pins
Many more options exist

Enable bit, parity, collision detection,


open-collector mode, etc.

Timing is based on #use delay()


2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

61

UART (Continued)

Standard C I/O

- printf(string, );
- char = getc();

Standard C I/O, streams

- fprintf(stream, string, );
- char = fgetc(stream);

bool = kbhit(stream);
setup_uart(newBaud, stream)
- Dynamically change the UART

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

62

Dual UART Example


#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,
stream=HW_UART)

#use rs232(baud=9600, xmit=PIN_D0, rcv=PIN_B0,


stream=SW_UART, disable_ints)
fprintf(HW_UART, HELLO HARDWARE UART\r\n);
fprintf(SW_UART, HELLO SOFTWARE UART\r\n);
if (kbhit(HW_UART)) {
c=fgetc(HW_UART);
fputc(c,SW_UART);
}
if (kbhit(SW_UART)) {
c=fgetc(SW_UART);
fputc(c,HW_UART);
}

printf() Redirection

printf() can be redirected to a


user-defined function

Example:
void LCDPut(char c);
printf(LCDPut, %U, val);

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

64

getc() Timeout

#use rs232(timeout=5)
v = getc();
If no character within 5ms:
- getc() returns 0x00
- RS232_ERRORS is 0x00

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

65

I2C Library

Multiple I C channels on any I/O pins


#use i2c(master, sda=pin_XX,
scl=pin_XX, address=YY,
stream=id)
The SDA and SCL pins can be any pins
Slave Mode is HW MSSP only
Address Is only needed in slave mode

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

66

I2C Library (Continued)

i2c_start()
Can also be used to send a restart signal

char = i2c_read(ack)
Ack is an optional parameter

ack = i2c_write(char)
bool = i2c_available()
Slave only command

i2c_stop()

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

67

SPI

Configurable SPI Library


#use spi(parameters)
HW or SW pins
Multiple streams
Clock rate and clock mode
configurable

in = spi_xfer(out)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

68

Built-In Functions
Peripherals and More
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

69

#use touchpad()

Capacitive Touch (CSM, CTMU)


#use touchpad()

- Options for current range, frequency

threshold, scan time, character output,


and more.
- #use touchpad(PIN_B0=A)

boolean = touchpad_hit()
char = touchpad_getc()
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

70

Internal Data EEPROM

Access internal data EEPROM


Reading:
- v = read_eeprom(address)

Writing:

- write_eeprom(address, v)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

71

A/D Converter

setup_adc(mode)
Configure the ADC; mode varies for each
PIC MCU

setup_adc_ports(config)
Configure the pins for analog or digital
mode

set_adc_channel(channel)
Set the channel for subsequent reads

val = read_adc()

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

72

Getting Help
So many peripherals,
how do I get help?
1.

2.

In PCW IDE, press F1 for


context sensitive help
In manual, look for section
labeled Functional Overviews

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

73

Dont forget Drivers and


Examples!

Drivers provided for complex features or


external peripherals
EEPROMs, LCDs, USB, FAT, etc.

Many example programs provided to


showcase built-in functions/drivers
Always kept up-to-date with latest
peripherals
Before you start a project, examine the
libraries and example programs CCS
provides you to reduce your development
time

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

74

Lab #3
Analog to Digital
Conversion
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

75

Lab 3 Objective

Read A/D Conversion


Light LEDs based upon voltage

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

76

Lab 3 Hints

Handout has help, finished


example
ADC Troubles?
Did you enable A/D with
setup_adc()?
Did you set the channel?

Bored? Try Extra Credit

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

77

Programming Details
Interrupts
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

78

Pop Quiz

What does your ISR


need to do?

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

79

Interrupt Service Routine

CCS C provides an ISR


Saves status and scratch registers
Checks enable/flags, goes to user
ISR function for that flag
Clears interrupt flag (if needed)
Restores status/scratch registers

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

80

Interrupt Service Routine


API

enable_interrupts(INT_*)
enable_interrupts(GLOBAL)
enable_interrupts(INT_TIMER0)

disable_interrupts(INT_*)
clear_interrupt(INT_*)
bool = interrupt_active(INT_*)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

81

Interrupt Service Routine


API

#INT_*
The following function will be processed
for that interrupt
#INT_TIMER0
void isr_timer0(void)
{
//HANDLE TIMER0 OVERFLOW
}

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

82

Interrupt Service Routine


Special Identifiers

#INT_GLOBAL
Function overrides CCS ISR
User must save and restore all
registers altered by their ISR (W,
STATUS, scratch used by compiler,
etc.)

#INT_DEFAULT
Traps unknown interrupt

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

83

Interrupt Service Routine


Options

These keywords may follow #INT_*:


high (PIC18) Interrupt is high priority
fast (PIC18) Same as high, but no save
fast (PCD) Uses shadow registers
level=(0..7) (PCD) Sets interrupt level
noclear ISR will not clear interrupt flags

#device HIGH_INTS=TRUE
Must set to use high/fast ISR on PIC18

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

84

#include <18F46K22.H>
#device HIGH_INTS=TRUE
#INT_RDA HIGH
void IsrUartRx(void)
{
/* some code */
}

#INT_TIMER0 NOCLEAR
Void IsrTimer0(void)
{ clear_interrupt(INT_TIMER0);
//some code

}
void main(void)
{
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA);
enable_interrupts(INT_TIMER0);
// some code
}

Lab #4
Interrupts
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

86

Lab 4: Objectives

Learn how to use the CCS ISR


Learn how the CCS built-in

functions control Timer0 and


GPIO
Implement a stopwatch that
measures button press time

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

87

Lab 4 Hints

Handout has help and finished example


TIPS:
Press F1 to get compiler help manual
#INT_TIMER0

Following function is called on a Timer 0 overflow

setup_timer_0(RTCC_DIV_256)

Configures Timer 0 to use a divide by 256 prescalar

enable_interrupts(INT_xxxx)

INT_TIMER0 Enables Timer 0 Interrupt


GLOBAL Enables Global Interrupt

input(PIN_XX)

Returns TRUE if PIN_XX is high, else returns FALSE


Button is RA4, or PIN_A4 in CCS

Bored? Try Extra Credit

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

88

Class Summary

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

89

Class Summary

Leaving this class you should:


Be able to use your C knowledge and
write applications using CCS C
Know how to use the CCS software to
load your code onto a PIC MCU and
debug it
Know the ways the CCS C Compiler
speeds up development time with built-in
functions, drivers, example files and
context sensitive help
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

90

Q&A

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

91

Thank You!
Please fill out
the evaluation form
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

92

Appendix
Frequently Asked
Questions
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

93

Why do I get an out of ROM


error, when there is ROM left?

A function must fit into one bank


On 14-bit this is 2K
Split large functions, and main(),
into several smaller functions
This is good programming practice
anyway!

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

94

How Can I Reduce Code


Space?

Use int1 or bit fields for flags


Use fixed point decimal, not float
Divide large functions
Avoid ->, move structure to local
Use access bank mode
#device *=8
read_bank(b,o), write_bank(b,o,v)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

95

Why is My Math Clipped at


8-bits?

Examine the following code:


val16=val8 * val16;

The optimizer will use the


smallest data type for math; in
this case int8
Typecasting forces math into
proper mode:
val16=(int16) val8 * val16;

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

96

Appendix
Programming Details
Miscellaneous
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

97

Pre-Processor Miscellaneous

__pcb__
__pcm__
__pch__
__pcd__
Returns the version of specified compiler

__date__
__time__
Time/Date project was compiled

#id CHECKSUM
#id value
Place this value (or checksum) into ID location

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

98

String Parameters

String can be function parameter


LCDPuts(Hello);
Example (RAM):
#device PASS_STRINGS=IN_RAM
void LCDPuts(char *str);

Example (Const RAM):


#device PASS_STRINGS=IN_RAM
#device CONST=ROM
void LCDPuts(const char *str);

Example (ROM):
void LCDPuts(rom char *str);

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

99

#import

Import various files into project.


#import(File=name, Type)
Type = Relocatable (.o, .cof)
only and except specifies what C
symbols

Type = HEX (.hex)


range parameter specifies range

Type = RAW
location gets or sets location
size parameter gets size

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

100

Appendix
Output Files
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

101

Output Files

HEX Compiled Application


COF Debug Application
ERR Compile Output Messages
LST C to Assembly Comparison
SYM Memory Map
STA Statistics
TRE Call Tree

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

102

SYM Memory Map

First section is RAM memory map


005-014
na

main.buffer
main.index

na indicates no RAM
Following sections include:
Other Input files
ROM memory map
PIC MCU / Compiler Settings

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

103

STA Statistics
Review ROM/RAM/Stack used
Statistics for each function:
Page ROM % RAM Functions:
---- --- --- --- ---------0
26
0
1 @delay_ms1
0
284
1
3 ee_reset

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

104

STA Statistics
Statistics for each segment:
Segment
Used
Free
---------------00000-00006
4
4
00008-000B2
172
0
000B4-03FFE
15826
378

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

105

TRE Statistics

Review call tree


Function Name - Segment/ROM RAM

project
main 0/84 Ram=0
init 0/194 Ram=1
RELAY_INIT 0/16 Ram=0
RELAY1_OFF (Inline) Ram=0
@delay_ms1 0/26 Ram=1

Segment will be ? if it wont fit

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

106

Out of ROM

Full output:
Out of ROM, A segment or the program is too
large: XXXXXX
Seg w-x, y left, need z
Seg 0-3ff, 12C left, need 12F

Tips:
Be aware of processor segment size
Seg 0-3FF, 3FF left, need 412
Optimize code
Split large functions
Reduce stack usage (allows more CALLs)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

107

How Can I Reduce Code


Space?

Use int1 or bit fields for flags


Use fixed point decimal, not float
Divide large functions
Avoid ->, move structure to local
Use access bank mode
#device *=8
read_bank(b,o), write_bank(b,o,v)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

108

Out of RAM
Full error message:
Not enough RAM for all
variables
Review SYM file
Tips:

Be aware of PIC MCU bank size


Use bit flags
Use local variables (not global)
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

109

Programming Details
addressmod
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

110

Pop Quiz

You need to store 128 values

but your PIC MCU only has


80 bytes of RAM.

What do you do?


2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

111

addressmod

Application defined storage


What is normal storage?

typemod, on steroids!
Can be used on any data type
Pointers, structs, unions and arrays
const and rom not allowed

ISO/IEC TR 18037 (Embedded C)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

112

addressmod Syntax

addressmod(identifier,[read,write,]start,end)

identifier is the new qualifier


read(int32 addr, int8 *ptr, int8 len)
write(int32 addr, int8 *ptr, int8 len)

The IO method to access this memory


Optional

start/end are the memory range

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

113

addressmod Declaration
addressmod(nv, read_nv, write_nv,
0, NV_SIZE);
void read_nv(int32 addr,
int8 *ram, int8 n)
{ /* read n from addr */ }
void write_nv(int32 addr,
int8 *ram, int8 n)
{ /* write n from ram */ }

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

114

addressmod Usage
nv char NVBuffer[8192];
nv char NVID;
nv char *NVPtr;
#locate NVID=0
NVBuffer[i]=55;
*NVPtr++ = 0;
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

115

addressmod Block

#type default=qualifier
Following declarations will use this
qualifier
If qualifier blank, goes back to default
#type default=nv
char buffer[8192];
#include <memoryhog.h>
#type default=

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

116

addressmod Ideas

External RAM / Flash


Character/Graphic LCD access
through a multi-dimensional
array
Debug/trap critical variables

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

117

Appendix
Other Built-In Functions
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

118

Built-In Functions
Byte Manipulation

int8 = make8(variable, offset)


Returns one byte from variable

int16 = make16(i8MSB, i8LSB)


int32 = make32(iMSB..iLSB)
Returns the combined value

swap(value)
Swaps nibble, saves to value

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

119

Read / Write Program Memory

Treat program memory like data


EEPROM
v=read_program_eeprom(a)
write_program_eeprom(a, v)
Size of v depends on architecture

read_program_memory(a, ptr, num)


write_program_memory(a, ptr, num)
erase_program_memory(a)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

120

Capture / Compare / PWM

setup_ccpX(mode)
Mode contains configuration,
examine header for full options
setup_ccp1(CCP_PWM)

set_pwmX_duty(new_duty)
% = new_duty / (4 * period)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

121

Timers

setup_timer_X(mode)
Mode contains configuration info, such as
prescalar, postscalar, period, etc.
setup_timer_1(T1_INTERNAL | T1_DIV_BY_4);

set_timerX(new_count)
current_count=get_timerX()
Set/Get Timer count
Word Safe

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

122

Peripheral Control
Parallel Slave Port

setup_psp(mode)
Mode is PSP_ENABLED or
PSP_DISABLED

full=psp_output_full()
avail=psp_input_full()
isOverflowed=psp_overflow()
psp_data
A variable mapped to the PSP I/O port

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

123

Built-In Functions
Miscellaneous

ext_int_edge(which, mode)
ext_int_edge(0, H_TO_L)

port_X_pullups(boolean)
setup_oscillator(mode, finetune)
finetune is optional
setup_oscillator(OSC_2MHZ)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

124

Appendix
Fixed Memory Placement
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

125

#inline and #separate

#inline
Makes following function inline
Best if used with reference parameters

#separate
Makes following function separate (called)

Generally you should let the


optimizer determine if a function
should be separate or inline

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

126

#locate

Force location of variable


#locate ident=X
Assigns the C variable ident to location X
X can be a literal, or variable identifier
If not specified, ident is treated as a byte
Compiler allocates X
Can be any structure or type (not const)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

127

#locate examples

Overlaying variable onto SFR:


#locate STATUS=5

Repeat, but using get_env():


#locate STATUS=get_env(SFR:STATUS)

Overlaying two variables:


char buffer[512];

struct { /*protocol */} header;


#locate header=buffer+2
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

128

#byte and #bit

#byte ident=X
Same as #locate, but no allocation

#bit ident=X.b
Declares boolean at address X, bit b
Examples:

#bit CARRY=STATUS.0
#bit CARRY=get_env(BIT:C)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

129

#rom

Place raw data into program memory


#rom address={data.data}
Application Ideas:
Place strings into ROM

Initialize the internal data EEPROM


Manually set configuration bits

Manually set ID location


2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

130

#inline and #separate

#inline
Makes following function inline

#separate
Makes following function separate (called)
Disables stack overflow check

Generally you should let the


optimizer determine if a function
should be separate or inline

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

131

#org

Create segment, force code


into segment
#org start, end

Place following function/constant in


this segment

#org start
Continue previous segment

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

132

#org Example

Force following code into 0x100-0x1FF

#org 0x100, 0x1FF


void func1(void) {/*code*/}
#org 0x100
const cstring[]=Hello;
#org 0x100
void func2(void) {/*code*/}

//Valid Protoype
#seperate void func1(void);
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

133

#org

#org start, end DEFAULT


Forces all following
function/constants into this segment

#org DEFAULT
Terminate previous DEFAULT

#org start, end { }


Reserve ROM

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

134

#org Example 2

Force following code into


0x100-0x1FF

#org 0x100, 0x1FF default


void func1(void) {/*code*/}
const cstring[]=Hello;
void func2(void) {/*code*/}
#org default
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

135

#org

View .STA to view current


segment usage:
Segment
0000-0003:
0004-00FF:
0100-01FF:
0200-07FF:

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

Used
4
250
190
1337

1526 CCS

Free
0
2
66
199

Slide

136

#build

Can change reset and interrupt segment


#build(segment=start:end)
Valid segments:
reset the location of the reset vector
interrupt the location of the interrupt vector
memory external memory for CPU mode

Examples:
#build(reset=0x800, interrupt=0x808)
#build(memory=0x10000:0x1FFFF)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

137

#rom

Place raw data into program memory


#rom address={data.data}
Application Ideas:
Initialize the internal data EEPROM

Manually set configuration bits


Manually set ID location

Place strings into ROM


2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

138

Appendix
Bootloader Example
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

139

Bootloader Overview

Two programs:
Loader
Application

Each program #orgd


to their own space
Loader in low memory
(0-7FF)
Application high
memory (800-end)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

140

Bootloader/Application
Common Code
#define BOOT_END

(0x7FF)

#define APP_START

(BOOT_END+1)

#define APP_ISR

(APP_START+8)

#define PROGRAM_END
getenv(PROGRAM_MEMORY)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

141

Bootloader Example
Loader Code
//prevent bootloader from using application
#org APP_START , PROGRAM_END { }
#int_global
void isr(void) {
//goto interrupt in application
jump_to_isr(APP_ISR);
}
void main(void) {
if (IsBootloadEvent())
Bootload();
#asm
goto APP_START
#endasm
}
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

142

Bootloader Example
Application Code
#import(file=loader.hex, range=0:BOOT_END)
#build(reset=APP_START,interrupt=APP_ISR)
#org 0,BOOT_END { }
#int_timer0
void timer(void) { /* do timer0 isr */ }
Void main(void)
/* code */
}

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

143

Appendix
RTOS
2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

144

RTOS Basics

Multitasking through
time-sharing
Tasks appear to run at same time

Real Time
Task is in one of three states:
Running
Ready
Blocked

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

145

The CCS RTOS

Cooperative Multitasking
Tightly integrated with compiler

Supports ALL PIC MCUs with a


Timer
Available to IDE customers

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

146

RTOS Setup

#use rtos(timer=X,
[minor_cycle=cycle_time])
Timer can be any timer available
Minor_Cycle is rate of fastest task
Example:
#use rtos(timer=1, minor_cycle=50ms)

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

147

RTOS Tasks

#task(rate=xxxx,
[max=yyyy], [queue=z])
Following function is RTOS task
Will be called at specified rate
Max is slowest execution time, used
for budgeting
Queue defines RX message size

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

148

RTOS Start and Stop

rtos_run()
Starts the RTOS
Will not return until rtos_terminate()

rtos_terminate()
Stops the RTOS

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

149

#use rtos(timer=1)
#task(rate=100ms, max=5ms)
void TaskInput(void)
{ /* get user input */ }
#task(rate=25ms)
void TaskSystem(void)
{ /* do some stuff */ }
void main(void) {
while(TRUE) {
rtos_run();

sleep();
}
}

RTOS Task Control

rtos_enable(task)
rtos_disable(task)
Dynamic task control
Enable/Disable the specified task
Task is the function name
All tasks are enabled at start

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

151

RTOS Messaging

rtos_msg_send(task, char)
Sends char to task

avail=rtos_msg_poll()
TRUE if a char is waiting for this task

byte=rtos_msg_read()
Read next char destined for this task

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

152

RTOS Yielding

rtos_yield()
Stops processing current task
Returns to this point on next cycle

rtos_await(expression)
rtos_yield() if expression not TRUE

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

153

#task(rate=100ms, max=5ms)
void TaskInput(void) {
if (KeyReady())
rtos_msg_send(TaskSystem, KeyGet());
}
#task(rate=25ms, queue=1)
void TaskSystem(void) {
SystemPrepare();
rtos_await(rtos_msg_poll());
SystemDo(rtos_msg_read());
rtos_yield();
SystemVerify();
}

RTOS Semaphores

Semaphore
Determine shared resource availability
A user defined global variable
Set to non-zero if used
Set to zero if free

rtos_wait(semaphore)
rtos_yield() until semaphore free
Once free, sets semaphore as used

rtos_signal(semaphore)
Release semaphore

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

155

RTOS Timing Statistics

overrun=rtos_overrun(task)
TRUE if task took longer than max

rtos_stats(task, rtos_stats)
Get timing statistics for specified task

typedef struct
int32 total;
int16 min;
int16 max;
int16 hns;
} rtos_stats;

{
//
//
//
//

total ticks used by task


minimum tick time used
maximum tick time used
us = (ticks*hns)/10

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

156

RTOS Application Ideas

User I/O
Communication Protocols

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

157

Trademarks

The Microchip name and logo, the Microchip logo, dsPIC, KeeLoq, KeeLoq logo,
MPLAB, PIC, PICmicro, PICSTART, PIC32 logo, rfPIC and UNI/O are registered
trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MXDEV, MXLAB,
SEEVAL and The Embedded Control Solutions Company are registered trademarks
of Microchip Technology Incorporated in the U.S.A.

Analog-for-the-Digital Age, Application Maestro, chipKIT, chipKIT logo, CodeGuard,


dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR,
FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM,
MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code Generation, PICC,
PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, Total
Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their respective companies.

2011, Microchip Technology Incorporated, All Rights Reserved.

2011 Custom Computer Services, Inc., Microchip Technology Incorporated. All Rights Reserved.

1526 CCS

Slide

158

Potrebbero piacerti anche