I needed to brush the cobwebs off my PIC stuff for a project and things have 
changed at lot in the last 4 years.  What doesn't seem to have changed is 
documentation on the correct way to configure the config word in the PIC.  Last 
time I played I could write a specific value to the program memory address 
0x2007 (for 16F876) using this magic:

word at 0x2007 __CONFIG = 0x3f72;

However, this no longer compiles:
[EMAIL PROTECTED]:~/electronics/pic/2007$ sdcc -mpic14 -p16f876 count.c
count.asm:99:Warning [205] Found directive in column 1.
count.asm:99:Error [128] Missing argument(s).

I can't find any documentation that explains these error codes?

If I change the variable name to something different
word at 0x2007 ___CONFIG = 0x3f72;
with 3 underscores, it compiles fine.

However, the config word section in the asm is not set.
;--------------------------------------------------------
; config word
;--------------------------------------------------------
        __config 0x3fff

My understanding is that the program can not write to the config register as 
the program will not execute until it is set correctly, so it must be loaded in 
a special way by the picp software.

So what is the official and correct way to the config word?

I'm surprised to see that the most comprehensive tutorial to using pic14 + sdcc 
is still my pic-tricks page from 2002.  I guess I should add a few more things 
to that -- once I get the config word working again :)

njh

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to