Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/25/08 23:30
Read: times


 
#152527 - IAP to save settings
Hi,

I was hoping someone would be kind enough to explain some of the basics of IAP to me. I'm coming close to the end of my project (Home Alarm System) and I decided way back to use IAP to alter settings such as passwords and phone numbers to call in case of an alarm.

Of course, back when I decided on IAP it seemed a lot simpler than it does now. Turns out my instructors examples are worthless and my textbook doesn't cover IAP. Sweet.

The reason I'm using IAP is so in case my system is reset, I don't have to set all my variables again. I could just hard code them, and reprogram the controller everytime I want to change them, but that wouldn't be as flexible. Also, I'm apparently expected to be using IAP for this purpose in my project.

Anyway, here are some basic questions I'm wondering about:

1. SST says you shouldn't program to a block that it's currently reading from. So if I save my settings starting at F000, and everything else runs from below that... Would that be ok? In other words, can I just put this snippet at the end of my main.a51 and write to it safely with my regular code?

CSEG		AT	0F000H
U_PHONE:	DB	"13065555555"
U_LONG_DIST:	DB	11
U_LONG_SKIP:	DB	0
U_CODE:		DB	"1234"
U_SENSOR1:	DB	5
U_SENSOR2:	DB	10
U_SENSOR3:	DB	4
U_SENSOR4:	DB	8


2. I'm not sure I'm clear on whether I have to do a sector erase first, does anyone have any experience with the SST89C54? I read somewhere that "The portion of the memory array to be programmed should be in the erase state" so that sounds like a yes to me... Anyway, can I just stick a CSEG AT F0xx (where xx increases by 64) between each of my settings and thus erase each setting with a sector erase separately? I have a menu system planned that allows the user to change one setting at a time, so I don't want to erase multiple settings (which a sector erase of 64 bytes would).

If anyone could shed some light on this, it would be very much appreciated.

List of 6 messages in thread
TopicAuthorDate
IAP to save settings            01/01/70 00:00      
   Disregard that...            01/01/70 00:00      
      options            01/01/70 00:00      
         Re: options            01/01/70 00:00      
            to make the long story short...            01/01/70 00:00      
               Thanks            01/01/70 00:00      

Back to Subject List