Sid2286
Joined: 12 Aug 2010 Posts: 119
|
Example and MCP3204 |
Posted: Wed Nov 03, 2010 7:03 am |
|
|
Hi,
I was using the given example EX_AD12.C and MCP3204. With all the required changes.
All the communication parameters where also proper, However I'm constantly getting pppppppp pppppppppp.
I'm struggling to guess what i've missed on.
Do revert back as soon as possible.
my code is as follows
Code: |
lif defined(__PCH__)
#include <18F452.h>
#device ICD=TRUE //ADC=10
#fuses HS,NOLVP,NOWDT
#use delay (clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#endif
//#include <ltc129.c>
#include <MCP3204.C>
void display_data( long int data ) {
char volt_string[6];
convert_to_volts( data, volt_string );
printf(volt_string);
printf(" (%4lX)",data);
}
void main() {
long int value;
adc_init();
printf("Sampling:\r\n");
do {
delay_ms(1000);
value = read_analog(0);
printf("\n\rCh0: ");
display_data( value );
value = read_analog(1);
printf(" Ch1: ");
display_data( value );
} while (TRUE);
}
|
|
|