Go to Post Think Tolerant. - petek [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 26-01-2005, 20:09
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
EEPROM Problems

Or maybe its I don't know what to expect. Will EEPROM remain throughout program downloads? I'm hoping it does through controller resets.. but it doesnt seem to be.

I've got this code, that I got from somewhere on these forums
Code:
	char readEE(unsigned short address) {
		EEADRH = ((address>>8)&0x03);
		EEADR = (address&0xFF);

		EECON1bits.EEPGD = 0;
		EECON1bits.CFGS = 0;
		EECON1bits.RD = 1;
	
		return EEDATA;
	}
	char writeEE(unsigned short address, char data) {
		EEADRH = ((address>>8)&0x03);
		EEADR = (address&0xFF);
		EEDATA = data;

		EECON1bits.EEPGD = 0;
		EECON1bits.CFGS = 0;
		EECON1bits.WREN = 1;
		INTCONbits.GIE = 0;
		EECON2 = 0x55;
		EECON2 = 0xAA;
		EECON1bits.WR = 1;
		INTCONbits.GIE = 1;
		EECON1bits.WREN = 0;
	}

I have funtions that should be reading and writing to functions.. but the data doesn't seem to be staying though controller resets and program downloads. Any help?
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
read/write EEPROM on 18F8520 WizardOfAz Programming 39 22-03-2004 13:32
Problem with reading and writing EEPROM DKolberg Programming 4 16-03-2004 19:29
Do you all have problems with.... Munkaboo Website Design/Showcase 19 03-03-2003 19:51
Joystick problems archiver 2001 3 24-06-2002 02:40


All times are GMT -5. The time now is 19:47.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi