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 support@ccsinfo.com

External Eeprom 24LC01B with 16F877 and WDT enabled

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







External Eeprom 24LC01B with 16F877 and WDT enabled
PostPosted: Mon Jun 16, 2003 12:16 am     Reply with quote

<font face="Courier New" size=-1>Hello Everyone,

I am having some major troubles with the 24LC01B serial eeprom. I enabled WDT because the program that I am using requires wdt to work correctly. I am using the device driver 2401.c include file. I have changed the

#define EEPROM_SDA PIN_B6
#define EEPROM_SCL PIN_B7

to match my program settings.

Here is my setup:

PCM 3.102

24LC01B:
Pin 1 Floating
Pin 2 Floating
Pin 3 Floating
Pin 4 Gnd
Pin 5 Data - PIC B6 - 10k pullup
Pin 6 Clk - PIC B7
Pin 7 WP - Gnd
Pin 8 Vcc

The PIC will read in random data if I do not have the eeprom inserted in its circuit. With the eeprom the PIC keeps on reseting. I do a restart_wdt(); before the read_ext_eeprom(address).

Any help will be highly appreciated. Sorry if my question is hard to follow. I am 15 and it is hard to think correctly after having the eeprom problem for 2 days.

<blink><marquee>Please Help :(</marquee></blink>

Harrison Pham</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515274
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: External Eeprom 24LC01B with 16F877 and WDT enabled
PostPosted: Mon Jun 16, 2003 2:42 pm     Reply with quote

:=I am having some major troubles with the 24LC01B serial eeprom. I enabled WDT because the program that I am using requires wdt to work correctly. I am using the device driver 2401.c include file. I have changed the
:=
:=#define EEPROM_SDA PIN_B6
:=#define EEPROM_SCL PIN_B7
:=
:=to match my program settings.

So that means you are using pins B6 and B7 ?
Are you using an ICD debugger ?
Those pins are used by the ICD.

Also, have you tested your program without the WDT ?
Does it work ?
:=
:=Here is my setup:
:=
:=PCM 3.102
:=
:=24LC01B:
:=Pin 1 Floating
:=Pin 2 Floating
:=Pin 3 Floating
:=Pin 4 Gnd
:=Pin 5 Data - PIC B6 - 10k pullup

I always put a pull-up on the clock pin.
According to the Microchip appnote, it might
not be necessary, but do it anyway, for this test.

:=Pin 6 Clk - PIC B7
:=Pin 7 WP - Gnd
:=Pin 8 Vcc
:=
:=The PIC will read in random data if I do not have the eeprom inserted in its circuit. With the eeprom the PIC keeps on reseting. I do a restart_wdt(); before the read_ext_eeprom(address).

What period are you using for the WDT ?
I suggest that you initially set it to the maximum,
while debugging this problem. Put this line
near the start of your program:

setup_wdt(WDT_2304MS);

Also, the 2401.C file has a "delay_ms(11)" statement.
So I suggest that you add the "restart_wdt" parameter
to your "#use delay()" statement
#use delay(clock=4000000, restart_wdt)

What crystal frequency are you using ?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515304
Harrison P
Guest







Re: External Eeprom 24LC01B with 16F877 and WDT enabled
PostPosted: Mon Jun 16, 2003 2:49 pm     Reply with quote

:=:=I am having some major troubles with the 24LC01B serial eeprom. I enabled WDT because the program that I am using requires wdt to work correctly. I am using the device driver 2401.c include file. I have changed the
:=:=
:=:=#define EEPROM_SDA PIN_B6
:=:=#define EEPROM_SCL PIN_B7
:=:=
:=:=to match my program settings.
:=
:=So that means you are using pins B6 and B7 ?
:=Are you using an ICD debugger ?
:=Those pins are used by the ICD.
:=
I am not using a debugger but I am using a bootloader but those pins are not used.
:=Also, have you tested your program without the WDT ?
:=Does it work ?
:=:=
:=:=Here is my setup:
:=:=
:=:=PCM 3.102
:=:=
:=:=24LC01B:
:=:=Pin 1 Floating
:=:=Pin 2 Floating
:=:=Pin 3 Floating
:=:=Pin 4 Gnd
:=:=Pin 5 Data - PIC B6 - 10k pullup
:=
:=I always put a pull-up on the clock pin.
:=According to the Microchip appnote, it might
:=not be necessary, but do it anyway, for this test.
:=
I will try a pullup on the clk pin also.
:=:=Pin 6 Clk - PIC B7
:=:=Pin 7 WP - Gnd
:=:=Pin 8 Vcc
:=:=
:=:=The PIC will read in random data if I do not have the eeprom inserted in its circuit. With the eeprom the PIC keeps on reseting. I do a restart_wdt(); before the read_ext_eeprom(address).
:=
:=What period are you using for the WDT ?
:=I suggest that you initially set it to the maximum,
:=while debugging this problem. Put this line
:=near the start of your program:
:=
:=setup_wdt(WDT_2304MS);
I have tried that and the PIC waits about 2.5 seconds before the wdt kicks in and restarts the PIC which sounds right.
:=
:=Also, the 2401.C file has a "delay_ms(11)" statement.
:=So I suggest that you add the "restart_wdt" parameter
:=to your "#use delay()" statement
:=#use delay(clock=4000000, restart_wdt)
:=
:=What crystal frequency are you using ?
I am using a 20 mhz crystal.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515305
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: External Eeprom 24LC01B with 16F877 and WDT enabled
PostPosted: Mon Jun 16, 2003 3:22 pm     Reply with quote

If you try those things and it doesn't work, then post
a short, but complete program that demonstrates the problem.

Be sure to post all compiler pre-processor directives.

Also, post what bootloader you are using, and the
power supply voltage that you're using for the PIC
the and eeprom.

___________________________
This message was ported from CCS's old forum
Original Post ID: 144515307
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