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

external eeprom program(24128)

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



Joined: 11 Sep 2006
Posts: 27

View user's profile Send private message

external eeprom program(24128)
PostPosted: Fri Feb 09, 2007 7:20 pm     Reply with quote

Hi all, I'm trying to write some value in eeprom and read back, but it doesn;t work. Below is my code, is here anything wrong? thanks.

Code:
#include <16F876A.h>
#use delay(clock=20000000)
#fuses hs,noprotect,nowdt,nolvp
#byte PORTB=6
#byte PORTC=7
#define EEPROM_SDA  PIN_C4
#define EEPROM_SCL  PIN_C3
#include <24128>
int i,d;
main()
{
d=0;
set_tris_b(0);
portb=0x01;
delay_ms(1000);
portb=0x00;
delay_ms(1000);
init_ext_eeprom(); 
delay_ms(1);
write_ext_eeprom(0x00,0x02); 
d = read_ext_eeprom(0);   
portb=d;
delay_ms(1000);

}

or can anyone just show me a simple but working read write program to eeprom which is similar to mine? thanks.
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