PCD COMMAND LINE COMPILER Custom Computer Services Inc (CCS), PCD COMMAND LINE COMPILER Datasheet - Page 76

PCD C-COMPILER PIC24, DSPIC

PCD COMMAND LINE COMPILER

Manufacturer Part Number
PCD COMMAND LINE COMPILER
Description
PCD C-COMPILER PIC24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet

Specifications of PCD COMMAND LINE COMPILER

For Use With/related Products
Microchip PIC24/dsPIC®
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1007
DAC
These options let the user configure and use the digital to analog converter module. They are only
available on devices with the DAC hardware. The options for the functions and directives vary
depending on the chip and are listed in the device header file.
Relevant Functions:
setup_dac(divisor)
dac_write(value)
setup_dac(mode, divisor)
dac_write(channel, value)
Relevant Preprocessor:
#USE DELAY
Relevant Interrupts:
None
Relevant Include Files:
None, all functions built-in
Relevant getenv() parameters:
None
Example Code:
int16 i = 0;
setup_dac(DAC_RIGHT_ON, 5);
While(1){
i++;
dac_write(DAC_RIGHT, i);
62
}
Sets up the DAC e.g. Reference voltages
Writes the 8-bit value to the DAC module
Sets up the d/a mode e.g. Right enable, clock divisor
Writes the 16-bit value to the specified channel
Must add an auxiliary clock in the #use delay preprocessor.
For example:
#USE DELAY(clock=20M, Aux: crystal=6M, clock=3M)
//enables the d/a module with right channel enabled and a
division of the clock by 5
//writes i to the right DAC channel

Related parts for PCD COMMAND LINE COMPILER