piclist 2002\08\14\105127a >
Thread: MPLAB C18
www.piclist.com/techref/microchip/languages.htm?key=mplab
flavicon
face BY : Mike Mansheim email (remove spam text)



> I feel like I am talking to myself here, it seems that there are no
> MPLAB C18 users on this list, but I will give it one last chance.

I use CCS, so I can't help with C18 specifics.
However...

> 1. How do you set the configuration bits programmatically?

CCS uses a pragma called #FUSES - you might want to check your manual
for "fuses" - you might be missing it looking for "configuration bits".
That said, I suspect it is instead going to be a syntax variation on
responses you've already gotten.  There must have been example C files
included with the compiler - you can usually figure this kind of stuff
out from those even if it's not clear or seems to be missing from the
manual.

> 2. How do you write and read to eeprom (I tried
> "rom long eTest = 0x1234;" but that does not seem to work, although I
> get no compiler warnings/errors)

eeprom and rom are not the same!  If you can do inline assembly, just
use the short routines in the 18F data sheet for reading and writing to
eeprom - they work just fine.  The "rom" directive is like const - it
forces a variable into program memory (NOT eeprom).  I know this much
about C18 from the CD I got from the masters.  Couldn't find anything
on initializing eeprom data.
There are undoubtedly library functions for doing this - they will be
along the lines of:  x = read_eeprom(3);  try looking for something
similar.  Try searching through all the .h files for the string "eeprom"
to find the prototype.

> 3. How do you define default values in the eeprom in C?  In asm I just
> write (org 0x2100   de "testing",0)

Again, CCS uses a pragma (#ROM).  Perhaps check your list of non-standard
pragmas.

--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-requestTakeThisOuTspamspamBeGonemitvma.mit.edu


<OFCECF7E5C.A2551306-ON86256C15.004EE202@graco.com>

See also: www.piclist.com/techref/microchip/languages.htm?key=mplab
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) MPLAB C18

month overview.

new search...