Hello Matelda,
M>>how i can make pic work as d/a converter
thanks<<
1. Make *sure* your chip has a ADC on it. Some pics do not. Some have comparators instead of AD's on them.
2. Make *sure* you are using the pin that has the AD on it.
3. Make *sure* you set your flags correctly to use the ADC.
Here is some code for a 12F675
number var word
ANSEL=0
CMCON=%00000111
TRISIO=%00001010
' Define ADCIN parameters
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
Loop:
ADCIN 1, number 'Read value.
'Output your data to whatever device you want
'LCDout number
goto Loop
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks