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

2404.c not working

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



Joined: 21 Jun 2006
Posts: 2

View user's profile Send private message

2404.c not working
PostPosted: Wed Jun 21, 2006 9:15 pm     Reply with quote

Dear ALL,

I'm using the Atmel AT24c04 ( 5V ), attached to a 16f876a and the following code:

#include <16f876a.h>
#fuses HS,NOWDT,NOPROTECT,PUT, NOBROWNOUT, NOLVP
#use delay(clock=6000000)

#define EEPROM_SDA PIN_A4
#define EEPROM_SCL PIN_B0

#include "lcdd.c"
#include <2404.c>

#ZERO_RAM
void main(void){
int i;

set_tris_c(0x80);

lcd_init();
port_b_pullups(TRUE);

lcd_putc("\fTest...\n");

delay_ms(1000);

lcd_putc("\f");

init_ext_eeprom();

for (i = 0; i < 255; i++){
write_ext_eeprom(i, i);
printf(lcd_putc,"\f%x -> %x",i, read_ext_eeprom(i));
delay_ms(500);
}
while(1){};
}

The lcd shows the address and the data, as following:

00 -> 00
01 -> 01
02 -> 02 and so on.

But, when i reaches 0x0e, the lcd shows:

0e -> ff
0f -> ff
10 -> 10

:O

Any ideas?
marcellus26



Joined: 21 Jun 2006
Posts: 2

View user's profile Send private message

PostPosted: Wed Jun 21, 2006 9:39 pm     Reply with quote

I found the error... :T

There was no *external* pullup resistor on pin B0...

Now it's working fine, thank you all, guys.
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