Functional Overview
Example Code:
setup_dsm(DSM_ENABLED |
DSM_OUTPUT_ENABLED,
DSM_SOURCE_UART1,
DSM_CARRIER_HIGH_VSS |
DSM_CARRIER_LOW_OC1);
if(input(PIN_B0))
setup_dsm(FALSE);
else
//Enables DSM module with the output enabled and selects
UART1
//as the source signal and VSS as the high carrier signal and OC1's
//PWM output as the low carrier signal.
Disable DSM module
Enable DSM module
setup_dsm(TRUE);
External Memory
Some PIC18 devices have the external memory functionality where the external memory can be
mapped to external memory devices like (Flash, EPROM or RAM). These functions are
available only on devices that support external memory bus.
General Purpose I/O
These options let the user configure and use the I/O pins on the device. These functions will
affect the pins that are listed in the device header file.
Relevant Functions:
output_high(pin)
output_low(pin)
output_float(pin)
output_x(value)
output_bit(pin,value)
input(pin)
input_state(pin)
set_tris_x(value)
input_change_x( )
Sets the given pin to high state.
Sets the given pin to the ground state.
Sets the specified pin to the output mode. This will allow the pin
to float high to represent a high on an open collector type of
connection.
Outputs an entire byte to the port.
Outputs the specified value (0,1) to the specified I/O pin.
The function returns the state of the indicated pin.
This function reads the level of a pin without changing the
direction of the pin as INPUT() does.
Sets the value of the I/O port direction register. A '1' is an input
and '0' is for output.
This function reads the levels of the pins on the port, and
compares them to the last time they were read to see if there was
a change, 1 if there was, 0 if there wasn't.
Relevant Preprocessor:
#USE STANDARD_IO(port)
This compiler will use this directive be default and it will
automatically inserts code for the direction register whenever an
I/O function like output_high() or input() is used.
41
相关PDF资料
PCI-EXP-T42G5-N1 IP CORE PCI EXPRESS ORCA 4
PCM18XH2 PROCESSOR MODULE MPLAB-ICE 2000
PCM18XN0 PROCESSOR MODULE FOR ICE2000
PDA-B-24-615-E-2B1-1-C CIRCUIT BREAKER MAG 1P 15A
PFMF.260.2 PFMF PTC FUSE SMT 2.6A 1812
PFNF.200.2 PFNF PTC FUSE SMT 2A 1206
PFRY.375 PTC-FUSE RADIAL 72 VDC
PFSM.150.33.2 FUSE PTC 8A 15V FST-TRIP SMD
相关代理商/技术参数
PCD_09 制造商:MACOM 制造商全称:Tyco Electronics 功能描述:Low Profile PCB Relay PCD
PCD-00173-0C 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00173-0E 制造商:Molex 功能描述:Ethernet Cable Assembly
PCD-00173-0H 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00173-0K 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00174-0C 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY; Cable Length - Imperial:3ft; Cable Length - Metric:914.4mm; Connector Type A:RJ45 Plug; Connector Type B:RJ45 Plug; Jacket Color:Red; Approval Bodies:CSA / UL; Body Material:PVC; Cable Assembly Type:Ethernet ;RoHS Compliant: NA
PCD-00174-0E 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY; Cable Length - Imperial:3ft; Cable Length - Metric:914.4mm; Connector Type A:RJ45 Plug; Connector Type B:RJ45 Plug; Jacket Color:Grey; Approval Bodies:CSA / UL; Body Material:PVC; Cable Assembly Type:Ethernet;RoHS Compliant: NA
PCD-00174-0H 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY