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.

Functional Overview<br />

External Memory<br />

Some PIC18 devices have the external memory functionality where the external memory can be<br />

mapped to external memory devices like (Flash, EPROM or RAM). These functions are<br />

available only on devices that support external memory bus.<br />

General Purpose I/O<br />

These options let the user configure and use the I/O pins on the device. These functions will<br />

affect the pins that are listed in the device header file.<br />

Relevant Functions:<br />

output_high(pin)<br />

output_low(pin)<br />

output_float(pin)<br />

output_x(value)<br />

output_bit(pin,value)<br />

input(pin)<br />

input_state(pin)<br />

set_tris_x(value)<br />

input_change_x( )<br />

Relevant Preprocessor:<br />

#USE STANDARD_IO(port)<br />

#USE FAST_IO(port)<br />

#USE FIXED_IO<br />

(port_outputs=;in,pin?)<br />

Sets the given pin to high state.<br />

Sets the given pin to the ground state.<br />

Sets the specified pin to the input mode. This will allow the pin to<br />

float high to represent a high on an open collector type of<br />

connection.<br />

Outputs an entire byte to the port.<br />

Outputs the specified value (0,1) to the specified I/O pin.<br />

The function returns the state of the indicated pin.<br />

This function reads the level of a pin without changing the<br />

direction of the pin as INPUT() does.<br />

Sets the value of the I/O port direction register. A '1' is an input<br />

and '0' is for output.<br />

This function reads the levels of the pins on the port, and<br />

compares them to the last time they were read to see if there was<br />

a change, 1 if there was, 0 if there wasn't.<br />

This compiler will use this directive be default and it will<br />

automatically inserts code for the direction register whenever an<br />

I/O function like output_high() or input() is used.<br />

This directive will configure the I/O port to use the fast method of<br />

performing I/O. The user will be responsible for setting the port<br />

direction register using the set_tris_x() function.<br />

This directive set particular pins to be used an input or output,<br />

and the compiler will perform this setup every time this pin is<br />

used.<br />

Relevant Interrupts:<br />

None<br />

53

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

Saved successfully!

Ooh no, something went wrong!