Ich weiß jetzt nicht, welchen Compiler du benutzt.
Ich verwende nur die PIC24 mit den Tools von Microchip. Die #defines für die Config-Bits sind in den jeweiligen p24xxx.h. Da findet sich dann sogar noch eine kleine Doku dazu. Beispiel:
Das wird für die kleineren so ähnlich sein, kann das aber nicht nachvollziehen, da ich nichts für die 8-Bitter installiert habe.Code:/* -------------------------------------------------------- */ /* Macros for setting device configuration registers */ /* -------------------------------------------------------- */ /* Register FBS (0xf80000) */ extern __attribute__((space(prog))) int _FBS; #define _FBS(x) __attribute__((section("__FBS.sec"),space(prog))) int _FBS = (x); /* ** Only one invocation of FBS should appear in a project, ** at the top of a C source file (outside of any function). ** ** The following constants can be used to set FBS. ** Multiple options may be combined, as shown: ** ** _FBS( OPT1_ON & OPT2_OFF & OPT3_PLL ) ** ** Boot Segment Write Protect: ** BWRP_ON Enabled ** BWRP_OFF Disabled ** ** Boot segment Protect: ** BSS_HI5K High Security Boot Protect 000200h - 002BFEh ** BSS_HI2K High Security Boot Protect 000200h - 0015FEh ** BSS_HI1K High Security Boot Protect 000200h - 000AFEh ** BSS_STD5K Standard Security Boot Protect 000200h - 002BFEh ** BSS_STD2K Standard Security Boot Protect 000200h - 0015FEh ** BSS_STD1K Standard Security Boot Protect 000200h - 000AFEh ** BSS_OFF No boot program flash segment ** */ #define BWRP_ON 0xFFFE #define BWRP_OFF 0xFFFF #define BSS_HI5K 0xFFF1 #define BSS_HI2K 0xFFF3 #define BSS_HI1K 0xFFF5 #define BSS_STD5K 0xFFF9 #define BSS_STD2K 0xFFFB #define BSS_STD1K 0xFFFD #define BSS_OFF 0xFFFF
Wo kommt denn das #define für "__CONFIG" her? Dort in der Nähe wäre ein guter Platz.
Die *.inc sind Include Files für Assembler.
MfG Klebwax







Zitieren

Lesezeichen