17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

set_timer3(value)<br />

set_timer4(value)<br />

set_timer5(value)<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Timers 1 & 5 get a 16 bit int.<br />

Timer 2 and 4 gets an 8 bit int.<br />

Timer 0 (AKA RTCC) gets an 8 bit int except on the PIC18XXX where it<br />

needs a 16 bit int.<br />

Timer 3 is 8 bit on PIC16 and 16 bit on PIC18<br />

undefined<br />

Sets the count value of a real time clock/counter. RTCC and Timer0 are the<br />

same. All timers count up. When a timer reaches the maximum value it will<br />

flip over to 0 and continue counting (254, 255, 0, 1, 2...)<br />

Timer 0 - All devices<br />

Timers 1 & 2 - Most but not all <strong>PCM</strong> devices<br />

Timer 3 - Only PIC18XXX and some pick devices<br />

Timer 4 - Some <strong>PCH</strong> devices<br />

Timer 5 - Only PIC18XX31<br />

Nothing<br />

Examples:<br />

// 20 mhz clock, no prescaler, set timer 0<br />

// to overflow in 35us<br />

set_timer0(81); // 256-(.000035/(4/20000000))<br />

Example Files:<br />

Also See:<br />

ex_patg.c<br />

set_timer1(), get_timerX() Timer0 Overview, Timer1Overview, Timer2<br />

Overview, Timer5 Overview<br />

set_tris_x( )<br />

Syntax:<br />

set_tris_a (value)<br />

set_tris_b (value)<br />

set_tris_c (value)<br />

set_tris_d (value)<br />

set_tris_e (value)<br />

set_tris_f (value)<br />

set_tris_g (value)<br />

set_tris_h (value)<br />

set_tris_j (value)<br />

set_tris_k (value)<br />

278

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!