17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Also See:<br />

get_timer3(), set_timer3()<br />

setup_timer_4( )<br />

Syntax:<br />

Parameters:<br />

setup_timer_4 (mode, period, postscale)<br />

mode may be one of:<br />

T4_DISABLED, T4_DIV_BY_1, T4_DIV_BY_4, T4_DIV_BY_16<br />

period is a int 0-255 that determines when the clock value is reset,<br />

postscale is a number 1-16 that determines how many timer overflows<br />

before an interrupt: (1 means once, 2 means twice, and so on).<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

undefined<br />

Initializes timer 4. The mode specifies the clock divisor (from the oscillator<br />

clock).<br />

The timer value may be read and written to using GET_TIMER4() and<br />

SET_TIMER4().<br />

Timer 4 is a 8 bit counter/timer.<br />

This function is only available on devices with timer 4 hardware.<br />

Constants are defined in the devices .h file<br />

Examples:<br />

setup_timer_4 ( T4_DIV_BY_4, 0xc0, 2);<br />

// At 20mhz, the timer will increment every 800ns,<br />

// will overflow every 153.6us,<br />

// and will interrupt every 307.2us.<br />

Example<br />

Files:<br />

Also See:<br />

get_timer4(), set_timer4()<br />

setup_timer_5( )<br />

Syntax:<br />

Parameters:<br />

setup_timer_5 (mode)<br />

mode may be one or two of the constants defined in the devices .h file.<br />

T5_DISABLED, T5_INTERNAL, T5_EXTERNAL, or<br />

T5_EXTERNAL_SYNC<br />

306

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

Saved successfully!

Ooh no, something went wrong!