Tys0n
Newbie level 4
- Joined
- Apr 8, 2013
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,317
Hi
I'm using CCS PCWHD compiler,
What changeS should I make so as to keep my PIC ADC : +Vref = 1.2v and -Vref = ground
(which I kept using potential divider arrangement)
_______________________________________________
Transmitting side code
#include <16F877A.h>
#device *= 16
#device adc=8
#fuses HS, NOWDT, NOPROTECT,
NOLVP, PUT
#fuses NOBROWNOUT, CPD,
NODEBUG, NOWRT
#use delay(clock=10MHz)
#use rs232(baud=1200, xmit=PIN_
C6, bits=8, parity=N)
#include <lcd.c>
void main()
{
byte s=0;
lcd_init();
lcd_putc("\f");
setup_adc_ports(adc_clock_internal);
setup_adc(AN0);
set_adc_channel(0);
while(true)
{
read_adc(adc_start_only);
while(!adc_done());
s = read_adc(adc_read_only);
lcd_gotoxy(1,1);
printf(lcd_putc, "\fTx Data = %u" s);
putc(s);
delay_ms(100);
}
}
I'm using CCS PCWHD compiler,
What changeS should I make so as to keep my PIC ADC : +Vref = 1.2v and -Vref = ground
(which I kept using potential divider arrangement)
_______________________________________________
Transmitting side code
#include <16F877A.h>
#device *= 16
#device adc=8
#fuses HS, NOWDT, NOPROTECT,
NOLVP, PUT
#fuses NOBROWNOUT, CPD,
NODEBUG, NOWRT
#use delay(clock=10MHz)
#use rs232(baud=1200, xmit=PIN_
C6, bits=8, parity=N)
#include <lcd.c>
void main()
{
byte s=0;
lcd_init();
lcd_putc("\f");
setup_adc_ports(adc_clock_internal);
setup_adc(AN0);
set_adc_channel(0);
while(true)
{
read_adc(adc_start_only);
while(!adc_done());
s = read_adc(adc_read_only);
lcd_gotoxy(1,1);
printf(lcd_putc, "\fTx Data = %u" s);
putc(s);
delay_ms(100);
}
}