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

Displaying ADC sensor data on lcd.

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



Joined: 10 Apr 2008
Posts: 109
Location: Cape Town, South Africa

View user's profile Send private message

Displaying ADC sensor data on lcd.
PostPosted: Tue Apr 15, 2008 1:10 pm     Reply with quote

I solved the problem feeling like an idiot. Used 16x2 code instead of 20x4.
But o well...

My new problem arise i am currently building an electronic scale using strain gauges i have already conditioned my signal for a 0kg 0v and full scale 2kg 2v when i try to display the result i get gibberish on the lcd.

Code:
void scale_measure()
{
  uchar CNT;
   
   set_adc_channel(0);

   VBP_VAL = 0xFFFF;
       

   while(1)
   {
  delay_us(20);
   VBP_VAL = Read_ADC(ADC_START_AND_READ);
   VBP_VAL = VBP_VAL * 1000
   

}


To be honest i dont know what im doing...
I have set up

// Configure Port_A for Analog I
Setup_ADC_Ports( AN0_AN1_AN2_AN3_AN4 );


// Setup AD clock
SETUP_ADC( ADC_CLOCK_INTERNAL );

Ps how do i delete an old post!!
_________________
"THE ONLY EASY DAY WAS YESTERDAY"
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 15, 2008 1:27 pm     Reply with quote

Quote:
when i try to display the result i get gibberish on the lcd.

See this post. It shows how to read the ADC value, do some math on it,
and display it on an LCD:
http://www.ccsinfo.com/forum/viewtopic.php?t=32168&start=1

Quote:
Ps how do i delete an old post!!

Edit the post, change the title to Please Delete. The moderator
will delete it later.
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