• AVR Freaks

AnsweredHot!Initial EEPROM values using mpasm: 16F18344,

Author
Doug Fleenor
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2016/01/11 16:15:46
  • Location: 0
  • Status: offline
2018/09/28 12:44:01 (permalink)
0

Initial EEPROM values using mpasm: 16F18344,

How does one set initial EEPROM values on 16F18344 using mpasm?
#1
1and0
Access is Denied
  • Total Posts : 9287
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 13:16:32 (permalink) ☼ Best Answerby Doug Fleenor 2018/09/30 11:31:53
+4 (4)
Absolute mode:
        org     0xF000
        de      0,1,2,3,4,5,6,7

 
Relocatable mode:
        code    0xF000
        de      0,1,2,3,4,5,6,7

or
DEEPROM code
        de      0,1,2,3,4,5,6,7

#2
Doug Fleenor
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2016/01/11 16:15:46
  • Location: 0
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 14:30:41 (permalink)
0
Thanks for the reply.
 
The puzzle piece I was missing was the value for the ORG directive: 0xF000. Upon editing that value in my code (I'm porting code from an 18F2520). I verified it worked by looking at the EEPROM Data Memory (Window\Target Memory Views\EE Data Memory). I noticed that the EE Data Memory window displays the Address, and the first address is F000. Had I noticed that address earlier perhaps I could have guessed the ORG value.
 
Thanks again.
    Doug
#3
1and0
Access is Denied
  • Total Posts : 9287
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 14:52:00 (permalink)
+2 (2)
The EEPROM address on the enhanced mid-range devices is 0xF000.
 
#4
MBedder
Circuit breaker
  • Total Posts : 6767
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 15:45:45 (permalink)
+1 (3)
Doug, the EEPROM address on any device is stated in the appropriate datasheet. I can sell you some used and refurbished datasheets with good discount if you wish, and can read out loud these for you for some nominal fee LoL


#5
Doug Fleenor
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2016/01/11 16:15:46
  • Location: 0
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 16:17:23 (permalink)
+1 (3)
MBedder
Doug, the EEPROM address on any device is stated in the appropriate datasheet. I can sell you some used and refurbished datasheets with good discount if you wish, and can read out loud these for you for some nominal fee LoL

 
MBedder: There are 62 occurrences of the string EEPROM in the PIC16F18344 data sheet only one of which state the address as F000h (Table 11-3). One occurrence directs the user to use 0x7000 to access EEPROM through FSRs. Nowhere is it obvious that the user should ORG at 0xF000 to write initial values using DE. A search for F000 also shows that table 11-3 is the only occurrence of that number. So, no, the EEPROM address is not stated clearly in the data sheet, or I would have found it in my hour of research before I posted on this forum.
 
#6
1and0
Access is Denied
  • Total Posts : 9287
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 16:31:05 (permalink)
+1 (1)
Guys, guys, stop it! pink: pink
 
The EEPROM address can be found in the MPASM User's Guide under the DE directive. It is also stated in the device specific linker script file. Here are the EEPROM addresses:
 
Most PIC1X -- 0x2100
Enhanced mid-range -- 0xF000
Most PIC18 -- 0xF00000
PIC18FK4x -- 0x310000
 
#7
MBedder
Circuit breaker
  • Total Posts : 6767
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 16:33:11 (permalink)
0
No comment LoL
#8
1and0
Access is Denied
  • Total Posts : 9287
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/28 16:53:24 (permalink)
+2 (2)
I have suggested this in the past -- Microchip should include the EEPROM address in the device specific include file, such as

;----- EEPROM Equates --------------------------------------------------
_EEPROM                   EQU  H'F000'
_EEPROM_ADDR              EQU  H'F000'

post edited by 1and0 - 2018/09/28 16:56:21
#9
Jerry Messina
Super Member
  • Total Posts : 389
  • Reward points : 0
  • Joined: 2003/11/07 12:35:12
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2018/09/29 05:05:32 (permalink)
+3 (3)
Just fyi...
 
You can usually find all of this information in the device Programming Specifications document.
I find it worth a quick look through when I start with a new chip so there's no surprises... shows memory maps, page sizes, programming voltages, etc.
 
As always, watch out for the copy-paste errors.
#10
Joe Burch
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2014/12/10 21:31:25
  • Location: 0
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2019/06/24 11:27:57 (permalink)
0
Hey 1and0 - MANY thanks!
#11
1and0
Access is Denied
  • Total Posts : 9287
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Initial EEPROM values using mpasm: 16F18344, 2019/06/24 11:48:45 (permalink)
0
Joe Burch
Hey 1and0 - MANY thanks!

You're welcome.
 
#12
Jump to:
© 2019 APG vNext Commercial Version 4.5