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.

Built-in Functions<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

bank is the physical RAM bank 1-3 (depending on the device)<br />

offset is the offset into user RAM for that bank (starts at 0),<br />

8 bit int<br />

Read a data byte from the user RAM area of the specified memory bank. This<br />

function may be used on some devices where full RAM access by auto<br />

variables is not efficient. For example, setting the pointer size to 5 bits on the<br />

PIC16C57 chip will generate the most efficient ROM code. However, auto<br />

variables can not be above 1Fh. Instead of going to 8 bit pointers, you can save<br />

ROM by using this function to read from the hard-to-reach banks. In this case,<br />

the bank may be 1-3 and the offset may be 0-15.<br />

All devices but only useful on <strong>PCB</strong> parts with memory over 1Fh<br />

and <strong>PCM</strong> parts with memory over FFh.<br />

Nothing<br />

// See write_bank() example to see<br />

// how we got the data<br />

// Moves data from buffer to LCD<br />

i=0;<br />

do {<br />

c=read_bank(1,i++);<br />

if(c!=0x13)<br />

lcd_putc(c);<br />

} while (c!=0x13);<br />

ex_psp.c<br />

write_bank(), and the "Common Questions and Answers" section for more<br />

information.<br />

read_calibration( )<br />

Syntax:<br />

value = read_calibration (n)<br />

Parameters: n is an offset into calibration memory beginning at 0<br />

Returns:<br />

Function:<br />

Availability:<br />

An 8 bit byte<br />

The read_calibration function reads location "n" of the 14000-calibration<br />

memory.<br />

This function is only available on the PIC14000.<br />

245

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

Saved successfully!

Ooh no, something went wrong!