Hello,

I want to store and recall 2 Bytes from Flash on a PIC18F27J13 for pairing up a remote control to a mobile unit.
These are RadioID(RF Address) and RadioCH (Channel#) which are both just 8 bit VARs each.
I think I have the basic idea as below but I cannot figure out how to configure Flash programming.
The (2) memory locations ($1800 and $1900) I picked as it looks like my main code is way below.

Although I think this wastes a whole 64Byte block per each, I do not care at the moment.
I did try setting the above VARs to Words instead of Bytes but that did not help.
Reading through various posts I think I need to define an area of memory for these (2) bytes and un-protect them from being written to. However, I have be unable to find any simple examples and am stumped.

Thanks,


'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''
'' Flash Experiments


Flash:


If Push = 0 Then ' Should Increment ID & CH by 1
Pause 10
If Push = 1 Then ' Noise
Return
EndIf
Do
Pause 10
Loop Until Push = 1 ' Wait for User Release
GLED = 1
EraseCode $1800 ' Whole Block of 4 Words $1800 to $1864?
EraseCode $1900
RadioID = RadioID + 1
RadioCH = RadioCH + 1
WriteCode $1803, RadioID ' Writes to 4th Word in Block
WriteCode $1903, RadioCH
ReadCode $1803, RadioID ' Reads from 4th Word in Block
ReadCode $1903, RadioCH
hserout2["RadioID: ", dec RadioID, 13,10]
hserout2["RadioCH: ", dec RadioCH, 13,10]
GLED = 0
EndIf


GoTo Flash


'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''