Go to Post The kick-off is your opportunity to finally open the REALLY BIG box that has been sitting under the tree. - dlavery [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2007, 20:04
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
EEPROM Problem

Using Kevin's code, according to tests, either the write or the read is failing. The return from a read operation is 0.

Code:
void Process_Data_From_Master_uP(void)
 {
  static unsigned char i;

  Getdata(&rxdata);   /* Get fresh data from the master microprocessor. */

  /* Remote Program Loading */
  drt_prog_switch = !SW_PROG;

  Default_Routine();  /* Optional.  See below. */

  Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

  EEPROM_Write_Handler();
  Putdata(&txdata);             /* DO NOT CHANGE! */
 }
Code:
/* EEPROM Address Mapping */
#define EEP_ARM_POT_STOWED_LOW   0x0000
#define EEP_ARM_POT_STOWED_HIGH  0x0001
Code:
  ARM_POT_STOWED = EEPROM_Read(EEP_ARM_POT_STOWED_LOW);
  ARM_POT_STOWED += (unsigned int)EEPROM_Read(EEP_ARM_POT_STOWED_HIGH) << 8;
Code:
  if(need_eep_update)
   {
    if(EEPROM_Queue_Free_Space() > 2)
     {
      printf("Updating EEPROM\r\n");
      printf("ARM_POT_STOWED = %i\r\n", ARM_POT_STOWED);
      EEPROM_Write(EEP_ARM_POT_STOWED_LOW,  (byte)(ARM_POT_STOWED & 256));
      EEPROM_Write(EEP_ARM_POT_STOWED_HIGH, (byte)(ARM_POT_STOWED / 256));
      need_eep_update = 0;
     }
   }
Yes, ARM_POT_STOWED is a variable, not a #define, and it is not zero on the write. It is a two byte variable, thus, I split it up into two bytes for the EEPROM.

Need an answer as soon as possible. Thanks in advance.
__________________
Code:
void function(void)
 {
  function();
 }
Closed Thread


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
EEPROM Code Kevin Watson Programming 31 12-01-2006 11:37
EEProm Ryan Cumings Programming 2 01-02-2005 12:47
EEPROM Problems devicenull Programming 8 27-01-2005 15:07
Problem with reading and writing EEPROM DKolberg Programming 4 16-03-2004 19:29
Saving Data to EEPROM Phil Roth Programming 28 27-03-2003 22:29


All times are GMT -5. The time now is 10:59.

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