Hello Srig,

Srig>>Yes I am talking about the 8K program memory that is in the 16F77.....what do you mean by fixed data?... do you mean that the data is not going to change if I try to write to it?<<

No, you cannot write to it....You can only write to it during your programming of your chip. Then you are out of luck.
A good example to use this upper part of your memory, is for table lookup. For example...

If you are receiving data via a serial port, and the data are the numbers 1-25, you can write a table and put it out at teh very end of your memory, and use this to covert your 1-25 into meaningful data.

Table:
1,a
2,7
3,d
4,r
5,m
..
..
..
25,#FF 'end of table


You cannot chang this data while the chip is running. You can only do a "Look-Up" and/or "Cross-reference" by reading only.

Srig>> if that is the case.. then how does the PWM work...<<

The PWM is a "Hardware" situation. It is built into the chip by the MANUFACTURER!, not the Programmer (which is you). And the Hardware PWM will continuously put out a train of pulses while the chip does other things. Once the HPWM is turn on, it will continuously (without intervention) output its pulses.

the HPWM is "Hardware" and the Table on the end of your memory is *Like* hardware. The table cannot be changed, only during programming of the chip(notice is is the PROGRAMMER who is changing this table, not the manufacturer). thus the table is a constant and is unchangeable.

The HPWM is changeable (via a variable by the manufacturer) that the chip will recognize and react by changing the Pulses of a HPWM.

Lets say we want to build a Secret Code between you and I.....for a "A" we want a different letter..Lets build the Table, so that we always know the the table is good.

Table1:
A,J 'assign every letter A to the letter J
B,O ' assign ever letter B to the letter O
C,I
D,P
..
..
..
Z,U 'assign every letter Z to the letter "U"

I will do this in Psuedo code.

1st. I will tell the compiler to put that tabe at the end of the 8k.(hey that table will never change will it? We dont' want it to change do we?, If we change it in any way, I will not be able to decode your letter to me). So the table is "fixed", and unchangeable. I "can" put it at the end of my 8k, because I will never have to change it.

Message[100] var byte
Decoded[100] var byte

for s=1 to 100
Message[s]=Letter from Srig
Next s

'Message now contains your message you sent from me.

Now decode it!

For s = 1 to 100
Decoded[s]=TableLookUp(Message[s])
Next s

'If Message[1]="C" then Decoded[1]="I"
'etc etc.

Now lets output our decoded message to the LCD

LCDout, Decoded 'output decoded message to lcd!



Now what this means, if you decided to change the letters to mean a new set of letters, *I* must reprogram the chip with a new table. I cannot "change" the table any other way.

***********************************************
Now, lets use EEPROM...
With using EEPROM, you can "SEND" me the table BEFORE sending me the message.

I then put the Table into EEPROM, and decode your message using the table *YOU* sent me via the serial port. I don't have to reprogram my chip...I just want you message print out on the screen.

If you decide to change the table, that is ok... the table will be sent, and my chip will automatically load the NEW table into EEProm, and decode your message... I sit back and watch your message come through.