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.

Function:<br />

Restarts the watchdog timer. If the watchdog timer is enabled,<br />

this must be called periodically to prevent the processor from<br />

resetting.<br />

The watchdog timer is used to cause a hardware reset if the<br />

software appears to be stuck.<br />

The timer must be enabled, the timeout time set and software<br />

must periodically restart the timer. These are done differently on<br />

the <strong>PCB</strong>/<strong>PCM</strong> and <strong>PCH</strong> parts as follows:<br />

<strong>PCB</strong>/<strong>PCM</strong> <strong>PCH</strong><br />

Enable/Disable #fuses setup_wdt()<br />

Timeout time setup_wdt() #fuses<br />

restart restart_wdt() restart_wdt()<br />

Availability:<br />

Requires:<br />

All devices<br />

#FUSES<br />

Examples:<br />

#fuses WDT // <strong>PCB</strong>/<strong>PCM</strong> example<br />

// See setup_wdt for a<br />

// PIC18 example<br />

main() {<br />

setup_wdt(WDT_2304MS);<br />

while (TRUE) {<br />

restart_wdt();<br />

perform_activity();<br />

}<br />

}<br />

Example<br />

Files:<br />

Also See:<br />

ex_wdt.c<br />

#FUSES, setup_wdt(), WDT or Watch Dog Timer Overview<br />

rotate_left( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

rotate_left (address, bytes)<br />

address is a pointer to memory<br />

bytes is a count of the number of bytes to work with.<br />

undefined<br />

Rotates a bit through an array or structure. The address may be an array<br />

identifier or an address to a byte or structure (such as &data). Bit 0 of the<br />

lowest BYTE in RAM is considered the LSB.<br />

254

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

Saved successfully!

Ooh no, something went wrong!