View Single Post
  #6   Spotlight this post!  
Unread 11-03-2002, 13:38
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Unhappy Sounds like it must be a programming error.

Quote:
Originally posted by ChrisA
after writing a code to test each of the scratchpad ram locations we found that none of them seem to be bad... but if we use them in our coding they give us strange and also inconsistent values
if we switch from these bad sectors to what we have deemed as good locations the code works just fine and the values are what they should be.

the bad locations when used in our robots code will always give data in a patern such as the one that i posted earlier (0,3,2,1,0,3,2,1...etc) and have no relation to any data given to the locations by any piece of our code
I'm not sure what to make of your "pattern". Maybe you can post your code (or a snippet.)

My best guess is that you're saying that your program writes data to a scratchpad ram location, and when you read it back, the value is say a 0 (even though the value you had written was non-zero.) The next time you read it, the value is 3, and the next time it's 2 and so forth. Does this describe your situation at all? (Or are you storing data in a sequence of cells, and when you read them back, these are the values you're seeing in those cells?)

Some questions:
  • Are you writing data every time between reads?
  • Are you using scratchpad RAM in other places in your program? Is it possible you are overwriting your data elsewhere?

Some things to keep in mind:
  • You can only write BYTE data to scratchpad RAM. If you try to write a WORD value, it will get truncated to a byte. (I'm guessing that it's the high order byte that gets lopped off.)
  • Calculations are carried out internally to 16 bit precision. If you're writing the result of a calculation to scratchpad RAM, and the result is bigger than 8 bits, it will be truncated.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 11-03-2002 at 14:02.