This is a multi-part message in MIME format. ------=_NextPart_000_0057_01C24452.5E0CCF20 Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable Finally I did find it!!! Here are the configuration bits in ASM to be included in a C18 project. Don't forget to change the __config lines to your needs. Hope this helps. =D6mer YALHI oyalhi@teksan.com.tr http://www.teksan.com.tr Tel : +90 212 613 22 00 Fax: +90 212 544 70 35 -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Harold M Hallikainen Sent: Thursday, August 15, 2002 12:02 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: MPLAB C18 I'm running MPLAB C18. I'll see if I can answer some of this. 1. I have not yet found a way to set the configuration bits. I've tried an ASM file that was linked in, but that did not work. I've posted stuff here and on the Microchip web board. People on the web board suggested an asm file. People here suggested some fixes to the asm file to eliminate errors. If you look in the index of the C18 manual under "configuration bits," it gives you a definition of them, but nothing else. So, in answer to question # 1, I don't know! Let me know if you find out how to set the config bits from within C18. 2. Similarly, the manual on C18 only gives us a definition of eeprom. Since the eeprom is not in the memory map, but instead is treated as a peripheral, I'd expect there to be library functions to talk to the eeprom. You can define the initial values for eeprom in assembly (sample code below). I have not tried this in a C based project, though. The C18 libraries manual also includes eeprom in the glossary, but nowhere else. There are eeprom functions in the I2C library, but these talk to external eeprom on an I2C bus. I believe to write to internal eeprom, you'll have to define your own functions (in C or asm). Putting a rom qualifier in front of a type forces the constant to be in program memory instead of RAM. It does not force it into eeprom. 3. On default values in eeprom, you MIGHT be able to link in the asm file (like that below). I have not tried it, though. I know of no way to define eeprom values directly in C18. 4. don't know about the object file checksum errors. I've never gotten that on my Promate. Harold Sample eeprom intialization ASM below: ; -----------------------------------EEPROM Allocation------------------------------------------- LightMeterScaleHi equ 0 LightMeterScaleLo equ 1 ; Light meter scaling factor in eeprom CC1seconds equ 2 ; Store custom program curing mode 1 duration CC2seconds equ 3 CC3seconds equ 4 CC4seconds equ 5 ; Store custom program curing mode 4 duration RunTime0 equ 0x06 ; Run time counter advanced every 256us RunTime1 equ 0x07 ; RunTime2 equ 0x08 ; Advanced every 234uS or hours/256 RunTime3 equ 0x09 ; Hours lo RunTime4 equ 0x0a ; Hours hi LampStartCountHi equ 0x0b ; Lamp starts hi LampStartCountLo equ 0x0c ; Lamp starts lo org 0x2100 de 01, 00 ; Default light meter scaling factor of 1 ifdef xenon de d'1' ; minimum time for custom cure 1 de d'1' ; minimum time for custom cure 2 de d'5' ; minimum time for custom cure 3 de d'5' ; minimum time for custom cure 4 else de d'3' ; minimum time for custom cure 1 de d'10' ; minimum time for custom cure 2 de d'15' ; minimum time for custom cure 3 de d'25' ; minimum time for custom cure 4 endif de low(-d'3600'),high(-d'3600'),0, RevCodeMonth, RevCodeDay ; Runtime initialized at month/day of rev (reset during cal) de 0,0 ; Lamp cycle count initialized at zero FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com Reach broadcasters, engineers, manufacturers, compliance labs, and attorneys. Advertise at http://www.hallikainen.com/FccRules/ . ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/web/. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu ------=_NextPart_000_0057_01C24452.5E0CCF20 Content-Type: application/octet-stream; name="dzjcnfg.asm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dzjcnfg.asm" ; configuration file for PIC 18 series micros ; Author J Rowlatt ; Date 19th March 2002 ; To use change linelist p=3D18c452 to reflect the micro being used ; set the config as required see below, then add to project #define CONFIG1L 0x300000 #define CONFIG1H 0x300001 #define CONFIG2L 0x300002 #define CONFIG2H 0x300003 #define CONFIG3L 0x300004 #define CONFIG3H 0x300005 #define CONFIG4L 0x300006 #define CONFIG4H 0x300007 #define CONFIG5L 0x300008 #define CONFIG5H 0x300009 #define CONFIG6L 0x30000a #define CONFIG6H 0x30000b #define CONFIG7L 0x30000c #define CONFIG7H 0x30000d #define ENABLE_POWERUP_TIMER 0xfe #define DISABLE_POWERUP_TIMER 0xff #define ENABLE_BROWNOUT_DETECT 0xff #define DISABLE_BROWNOUT_DETECT 0xfd #define BROWN4_5 0xf3 #define BROWN4_2 0xf7 #define BROWN2_7 0xfb #define BROWN2_5 0xff #define CODE_PROTECT_ON 0x00 #define CODE_PROTECT_OFF 0xff #define OSC_SWITCH_ENABLE 0xdf #define OSC_SWITCH_DISABLE 0xff #define RC_OSC_OSC2_RA6 0xff #define HS_PLL_OSC 0xfe #define EC_OSC_OSC2_RA6 0xfd #define EC_OSC_OSC2_DIV4 0xfc #define RC_OSC 0xfb #define HS_OSC 0xfa #define XT_OSC 0xf9 #define LP_OSC 0xf8 #define WDT_ENABLE 0xff #define WDT_DISABLE 0xfe #define WDT1 0xf1 #define WDT2 0xf3 #define WDT4 0xf5 #define WDT8 0xf7 #define WDT16 0xf9 #define WDT32 0xfb #define WDT64 0xfd #define WDT128 0xff #define DUMMY 0xff #define CCP2_RC1 0xff #define CCP2_RB3 0xfe #define STACK_OVERFLOW_RESET_ENABLE 0xff #define STACK_OVERFLOW_RESET_DISABLE 0xfe #define DISABLE_ISDEBUG 0xff #define ENABLE_ISDEBUG 0x7f #define ENABLE_LV_ICSP 0xff #define DISABLE_LV_ICSP 0xfb #define CODE_PROTECT_B0 0xfe #define DISABLE_CODE_PROTECT_B0 0xff #define CODE_PROTECT_B1 0xfd #define DISABLE_CODE_PROTECT_B1 0xff #define CODE_PROTECT_B2 0xfb #define DISABLE_CODE_PROTECT_B2 0xff #define CODE_PROTECT_B3 0xf7 #define DISABLE_CODE_PROTECT_B3 0xff #define BOOT_BLOCK_PROTECT_ENABLE 0xbf #define BOOT_BLOCK_PROTECT_DISABLE 0xff #define EEPROM_PROTECT_ENABLE 0x7f #define EEPROM_PROTECT_DISABLE 0xff #define ENABLE_TABLE0_READ 0xff #define DISABLE_TABLE0_READ 0xfe #define ENABLE_TABLE1_READ 0xff #define DISABLE_TABLE1_READ 0xfd #define ENABLE_TABLE2_READ 0xff #define DISABLE_TABLE2_READ 0xfb #define ENABLE_TABLE3_READ 0xff #define DISABLE_TABLE3_READ 0xf7 #define ENABLE_BOOTBLOCK_READ 0xff #define DISABLE_BOOTBLOCK_READ 0xbf list p=3D18f452 __config CONFIG1L, CODE_PROTECT_OFF __config CONFIG1H, HS_OSC & OSC_SWITCH_DISABLE __config CONFIG2L, ENABLE_POWERUP_TIMER & BROWN4_2 & = ENABLE_BROWNOUT_DETECT __config CONFIG2H, WDT_DISABLE & WDT128 __config CONFIG3L, DUMMY __config CONFIG3H, DUMMY __config CONFIG4L, STACK_OVERFLOW_RESET_ENABLE & DISABLE_ISDEBUG & = DISABLE_LV_ICSP __config CONFIG4H, DUMMY __config CONFIG6L, DISABLE_CODE_PROTECT_B0 & DISABLE_CODE_PROTECT_B1 & = DISABLE_CODE_PROTECT_B2 & DISABLE_CODE_PROTECT_B3 __config CONFIG6H, EEPROM_PROTECT_DISABLE & BOOT_BLOCK_PROTECT_DISABLE=20 __config CONFIG7L, ENABLE_TABLE0_READ & ENABLE_TABLE1_READ & = ENABLE_TABLE2_READ & ENABLE_TABLE3_READ __config CONFIG7H, ENABLE_BOOTBLOCK_READ END ------=_NextPart_000_0057_01C24452.5E0CCF20-- -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads