I'm using MPLAB IDE + PBP 244 for compiling (if thats correct?)
I'm not using MPLAB IDE to compile because my BAS files are not in the compiler dir... so i used the approach listed here by creating a batch file to execute...
I'm using PIC16F877-20I/P 's...
I'm just asking what's the best way of doing the following items...
1) ADC initialization, I can't find much info on setting up the ADC's. What i've got so far is...
Code:
Define ADC_BITS 10 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS
Define ADCON0 %11000001
TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %10000010 ' Set PORTA analog and right justify result
First off, i need to correct the clock source to XT not RC so, will do that later once i found the value it should be...
My code is directly dependant on the ADC values that come in (nothing to run while it's waiting)... so i want the ADC to run as fast as possible... have i got it right? anything missing?
2) telemetry link to my laptop... laptop has IR port so I want IR link to PIC to recieve ADC valuse and io values etc...
i have the IR header (surfice mount mind!) the only way i can think of doing it is to direct drive the IR TX with a FET and use another FET on the reciever...
I'm also assuming i should be using serin/out at 9600 none inv...
I want it looping as fast as possible and give me as many ADC samples as possible per second...
3) i can't find much info on ADC calibration... aparently the ADC can only do upto 5V, after that you need to do something externally? but can't seem to find out exactly what? can someone kick me in the right direction?
Thanks everyone
Bookmarks