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 w/r speed.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
asmallri



Joined: 12 Aug 2004
Posts: 1679
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Nov 19, 2004 5:30 pm     Reply with quote

In the #fuses statement you have the Watchdog timer enabled but you never reset it. So the WDT is resetting the CPU

When the and External EEPROM write occurs that crosses a page boundary a 5ms delay is required to enable the EEPROM to perform the write from its internal buffer to its internal flash memory. If you attempt to wite to it doing this time the EEPROM responds with a NAK - it is up to you to test for this or do the delay_ms(5) - better to test it.

Also I note your program appears to "erase" the external EEPROM by writing 0x00 to it. In the erased state the EEPROM contents will be 0xff.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Guest








PostPosted: Mon Nov 22, 2004 12:15 pm     Reply with quote

How to reset WDT as you adviced.
I put some code like this, it still just blink the led (connected to PIN_A2) once and stop there, not sign of continuity.
Code:
   init_ext_eeprom();
   for(j=0;j<1023;j++)
   {
     write_ext_eeprom1(j,data1);
     output_high(PIN_A2);
     delay_ms(5);
   }
 
Guest








PostPosted: Mon Nov 22, 2004 12:17 pm     Reply with quote

what you mean by in erased states, and how could I put them in an erased state and then put them in a write state. I original want to init the eeprom, (to init them as either 0 or 0xFF) .
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Nov 22, 2004 4:20 pm     Reply with quote

Quote:
How to reset WDT as you adviced.

Let me ask you a question: if you don't know how to reset a watchdog, are you sure you need one?

What is a watchdog?
Watchdogs are a very important security safeguard in critical applications that are not allowed to freeze because of a programming error. The watchdog timer is used to cause a hardware reset if the software appears to be stuck. Depending on how critical your application is you set this timer from a few miliseconds to seconds. At carefully chosen locations in your application you reset the watchdog timer. If the program enters an infinite loop, the watchdog is never reset again and causes a hardware reset.

Watchdogs have their value, but there are also good reasons for not using them, for example a watchdog consumes power and can be a pain in the *ss during development.

Returning to your original question on how to restart the watchdog: If you would have tried a search command on the CCS manual you would have found the command restart_wdt().

But I recommend to remove the WDT if not strictly required.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Nov 22, 2004 4:30 pm     Reply with quote

Quote:
what you mean by in erased states
Most eprom's, eeprom's and flash eprom's will read as 0xff when erased. This has to do with some physical properties of these devices.
Most eeprom's have an erase command to erase large blocks of memory, but the 24FC515 doesn't. This eeprom combines the erase and write command, so there is no need for a seperate erase command. There is no technical reason as to why you should initialize the device to a certain value, but it seems with this device that you are free to choose whatever value you like; I would choose as it's 0xff more compatible to other eeproms.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Jul 07, 2005 1:12 pm     Reply with quote

That's what I2C is for. Yes, it supports multiple devices on the same bus. The devices need to be addressable if you have more than 1 of the same type. Not all eeproms are this way. You can find the information in the data sheet of the IC that you are using.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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