|
|
View previous topic :: View next topic |
Author |
Message |
Harrison P Guest
|
External Eeprom 24LC01B with 16F877 and WDT enabled |
Posted: Mon Jun 16, 2003 12:16 am |
|
|
<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
|
Re: External Eeprom 24LC01B with 16F877 and WDT enabled |
Posted: Mon Jun 16, 2003 2:42 pm |
|
|
:=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 |
Posted: Mon Jun 16, 2003 2:49 pm |
|
|
:=:=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
|
Re: External Eeprom 24LC01B with 16F877 and WDT enabled |
Posted: Mon Jun 16, 2003 3:22 pm |
|
|
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 |
|
|
|
|
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
|