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

how to store data using PIC16F877A?

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



Joined: 14 Feb 2011
Posts: 8

View user's profile Send private message

how to store data using PIC16F877A?
PostPosted: Sat Mar 26, 2011 1:22 am     Reply with quote

Hello, anyone can help me how to store data inside PIC? Currently I just made project about fruit indicator that show the parameter of sweetness/sourness fruit. So I need to store data that I already done test on the fruits. I hope anyone can help out how to figure my problems.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 1:52 pm     Reply with quote

See this thread. It has two example programs which show how to write
to the internal data eeprom in the PIC. The programs are for the 16F690
but they will also work with the 16F877A:
http://www.ccsinfo.com/forum/viewtopic.php?t=32722
matcobra



Joined: 14 Feb 2011
Posts: 8

View user's profile Send private message

PostPosted: Mon Mar 28, 2011 10:50 am     Reply with quote

thks, I have read your link but I just get blur. How I must supposed to combine the coding from the link with my original coding?

my original coding:
Code:


#include <16F877A.h>
#device adc=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)

#include <lcd.c>

#define x input (pin_b0) // ph output
#define y input (pin_b1) // voltage output
//#define z input (pin_b2) // glucose output

void main()
{
int16 adc_value;
float value1;
float value2;
float volt;


lcd_init();

setup_adc_ports(AN0);
setup_adc(ADC_CLOCK_DIV_8);
set_adc_channel(0);

while(1)

{
value1=read_adc();
value2=(value1*5)/1023;
volt=value2*2 ;
 
   lcd_putc("\f----:FRUITi:----\n");
   delay_ms(3100);
 
   
if(x==1)
   {   
     if((volt>5.00)&&(volt<=10.00))
     
      {
      printf(lcd_putc,"T:SWEET   \n",);delay_ms(3200);
      printf(lcd_putc,"G:MANY    \n",);delay_ms(3200);}
     else if((volt>3.00)&&(volt<=5.00))
     {printf(lcd_putc,"T:SWEETSOUR      \n",);delay_ms(3200);
      printf(lcd_putc,"G:MEDIUM        \n",);delay_ms(3200);}
     else if((volt>0.00)&&(volt<=3.00))
     {printf(lcd_putc,"T:SOUR        \n",);delay_ms(3200);
        printf(lcd_putc,"G:LITTLE      \n",);delay_ms(3200);}
   }

if(y==1)
   {

   {
      printf(lcd_putc,"pH:%3.2f",volt);delay_ms(3200);}

   }


 }
}

ok, if I managed to do this, i want to ask, are the data will be save inside PIC?...or we need to used external memory card to save the data?... Can you explain my problems..I just get blur, do we need to used external memory card too if we can save data inside PIC...
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