SW006010 Microchip Technology, SW006010 Datasheet - Page 19

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
 2002 Microchip Technology Inc.
2.3.2
#include <p17c756.h>
#include <adc16.h>
#include <stdlib.h>
#include <delays.h>
#include <usart16.h>
SetChanADC (Continued)
Remarks:
Return Value:
File Name:
Code Example:
}
void main(void)
{
int result;
char str[7];
// configure A/D convertor
OpenADC(ADC_INT_OFF&ADC_FOSC_32&
// configure USART
OpenUSART1(USART_TX_INT_OFF&
Delay10TCYx(5);
ConvertADC();
result = ReadADC(); // read result
itoa(result,str);
putsUSART1(str);
CloseADC();
CloseUSART1();
return;
Example of Use
ADC_RIGHT_JUST&ADC_VREF_INT&
ADC_ALL_ANALOG,ADC_CH0);
USART_RX_INT_OFF&
USART_ASYNCH_MODE&
USART_EIGHT_BIT&USART_CONT_RX, 25);
This function first clears the channel select bits in the
register, which selects channel 0. It then ORs the value channel
with
None
adcset.c
SetChanADC(ADC_CH0);
ADCON0
// Close Modules
// Delay for 50TCY
// Start Conversion
// convert to string
// Write string to USART
Hardware Peripheral Library
register.
apRNOVS^-page 15
ADCON0

Related parts for SW006010