CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Example and MCP3204

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Sid2286



Joined: 12 Aug 2010
Posts: 119

View user's profile Send private message

Example and MCP3204
PostPosted: Wed Nov 03, 2010 7:03 am     Reply with quote

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);

}
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Wed Nov 03, 2010 8:19 am     Reply with quote

Are you actually seeing the word 'sampling' at the start?. If not then we can ignore the ADC you have a serial communication problem and this needs to be sorted first.
Are you using ICD?.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group