I figured it out. I'm using CCS compiler. The #rom 0x1800 = {1234,34,34,654,549} does it just fine. Thanks for the input. Jim -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of John J. McDonough Sent: Thursday, February 26, 2004 10:14 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC:] Can I put values into a block of program memory at design time? The path of least resistance is to store a string of RETLW's, but that costs one word per byte. You can define a bunch of them with a dt directive. You can get it back via an index with the old ADDWF PCL,F. Sort of homely, but it is simple. f'rinstance: sub addwf pcl,f dt 0x0,0x3,0x6,0x9,0xc,0xf,0x12 movlw D'2' ; get number call sub ; multiply by three sub will return with the corresponding literal in W. The catch is the table needs to be in the first page, or with a little dancing around, in an even numbered page, which limits the size of the table somewhat. Can you fit it in EEPROM? Might be a little nicer. --McD ----- Original Message ----- From: "Jim Monteith" To: Sent: Thursday, February 26, 2004 10:58 AM Subject: [PIC:] Can I put values into a block of program memory at design time? > Hi All, > > I'm working with an 16f877. I would like to store data in upper program > memory. This data when be read and transmitted by the chip. > > What I'm looking for is a way to assign this data to memory locations at > design time. The data is too large to put in an array. It exceeds the > capacity of the RAM. It has to go in ROM. > > I'll basically be using the unused program memory as an eeprom, but I'd like > to have the data already there when the chip starts up, and not have to > write it to memory once it is running. > > Thanks for any ideas, > > Jim Monteith > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads