gnupic: Thread: Re: [gnupic] gpasm - __CONFIG


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Re: [gnupic] gpasm - __CONFIG
From: Peter ####@####.####
Date: 31 Oct 2005 08:22:23 +0000
Message-Id: <q.pk.eidf@jkwc.zraa>

On Sun, 30 Oct 2005, Scott Dattalo wrote:

>
> Does anyone know if the order is supposed to matter for __CONFIG
> directives in 18F devices? In absolute mode, gpasm doesn't care about the
> order of the __CONFIG directives. However in relocatable mode it does.

I think that it depends on how the __CONFIG code (constant) handling
is implemented in the linker. I assume that there is a bug that causes 
it to concatenate the words instead of combining them (or guesses the 
storage type wrong from the combined data size).

You could look at the object file constants from the assembly output of 
each source file and compare and see if they are identical to confirm 
whether they gplink is the problem.

hope this helps,
Peter
Subject: RE: [gnupic] gpasm - __CONFIG
From: Chen Xiao Fan ####@####.####
Date: 31 Oct 2005 09:13:34 +0000
Message-Id: <3B8AEFFADD3DD4118F8100508BACEC2C0A289366@spex>

Hi Scott,

It is not a bug of gpasm per se. Microchip MPASM will fail as well
but it will issue an error. The use of "__config" for PIC18 is now
deprecated for MPASM. It is better to use "config" instead.

Regards,
Xiaofan

1) __config addr, expr for PIC18 is now deprecated
From MPASM Help:

"Although this directive may be used to set configuration bits for PIC18 
MCU devices, it is recommended that you use the config directive 
(no underline characters.)

Note: Configuration bits must be listed in ascending order."

If not,MPASM will issue a error code 174 if the order is violated.

	LIST P=18F2520, F=INHX32 ;directive to define processor and file
format
	#include <P18F2520.INC>	 ;processor specific variable definitions

;***************************************************************************
***
;Configuration bits
; The __CONFIG directive defines configuration data within the .ASM file.
; The labels following the directive are defined in the P18F2520.INC file.
; The PIC18FXX20 Data Sheet explains the functions of the
; configuration bits. Change the following lines to suit your application.

	__CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L 
	__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L 
	__CONFIG _CONFIG5H, _CPB_OFF_5H 
	__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L 
	__CONFIG _CONFIG6H, _WRTB_OFF_6H & _WRTC_OFF_6H
	__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L 
	__CONFIG _CONFIG7H, _EBTRB_OFF_7H & _DEVID1 & _IDLOC0
	__CONFIG _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H 
	__CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOREN_OFF_2L 
	__CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_1_2H 
	__CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H &
_CCP2MX_PORTBE_3H 
...

Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q
/p18F2520 "2520tmpo.asm" /l"2520tmpo.lst" /e"2520tmpo.err" /o"2520tmpo.o"
Error[174]   C:\TESTING\2520TMPO.ASM 53 : __CONFIG directives must be listed

in ascending order
Halting build on first failure as requested.
BUILD FAILED: Mon Oct 31 17:00:12 2005

2) The recommened way is now to use "config" directive.

Simple Example 
#include p18f452.inc        ;Include standard header file
                            ;for the selected device.
;code protect disabled
CONFIG     CP0=OFF
;Oscillator switch enabled, RC oscillator with OSC2 as I/O pin.
CONFIG     OSCS=ON, OSC=LP
;Brown-OutReset enabled, BOR Voltage is 2.5v
CONFIG     BOR=ON, BORV=25
;Watch Dog Timer enable, Watch Dog Timer PostScaler count - 1:128
CONFIG     WDT=ON, WDTPS=128
;CCP2 pin Mux enabled
CONFIG     CCP2MUX=ON
;Stack over/underflow Reset enabled
CONFIG     STVR=ON

-----Original Message-----
From: Scott Dattalo 
Sent: Monday, October 31, 2005 12:19 PM
To: ####@####.####
Subject: [gnupic] gpasm - __CONFIG 

Does anyone know if the order is supposed to matter for __CONFIG
directives in 18F devices? In absolute mode, gpasm doesn't care about the
order of the __CONFIG directives. However in relocatable mode it does.
...
Does MPASM behave the same way? Is this a bug in gpasm?

Scott
Subject: Re: [gnupic] gpasm - __CONFIG
From: Scott Dattalo ####@####.####
Date: 31 Oct 2005 17:01:58 +0000
Message-Id: <43664DFD.2090100@dattalo.com>

Chen Xiao Fan wrote:
> Hi Scott,
> 
> It is not a bug of gpasm per se. Microchip MPASM will fail as well
> but it will issue an error. The use of "__config" for PIC18 is now
> deprecated for MPASM. It is better to use "config" instead.

Hi Xiaofan,

Thanks for pointing this out. I verified that gpasm does not support the 
"config" directive. I also filed a bug report. Meanwhile, I'll continue 
to use the __config directive and just make sure that the order is correct.

Scott
Subject: RE: [gnupic] gpasm - __CONFIG
From: "Chen Xiao Fan" ####@####.####
Date: 12 Jan 2006 08:20:38 +0000
Message-Id: <7D4AB72251D4D949AB2732ABEABDA54F12FFAF@PFSG-MX1.ap.p-f.biz>

> -----Original Message-----
> From: Scott Dattalo ####@####.####
> Sent: Tuesday, November 01, 2005 1:02 AM
> To: ####@####.####
> Subject: Re: [gnupic] gpasm - __CONFIG
> Chen Xiao Fan wrote:
>> It is not a bug of gpasm per se. Microchip MPASM will fail as well
>> but it will issue an error. The use of "__config" for PIC18 is now
>> deprecated for MPASM. It is better to use "config" instead.
> 
> Hi Xiaofan,
> 
> Thanks for pointing this out. I verified that gpasm does not 
> support the "config" directive. I also filed a bug report. 
> Meanwhile, I'll continue to use the __config directive and 
> just make sure that the order is correct.
> 
> Scott

Any updates on this? Starting from MPASM 4.02 (comes with
MPLAB 7.22, released 17 July 2005), __CONFIG does not
support the PIC18J device and this __CONFIG is really
deprecated for MPASM. I guess they will obsolete it
slowly when they introduce new PIC18F device. Maybe it 
is a good idea to support CONFIG under gpasm.

From the release notes of MPASM(TM) 4.02:
"Starting with this release, the __CONFIG directive is not supported
for PIC18 J Flash devices. An error will be given if the __CONFIG
directive is used. Use the CONFIG directive instead.
The __CONFIG directive has been deprecated for all other PIC18
devices. A warning will be issued if the __CONFIG directive is used
with one of these devices."

Regards,
Xiaofan
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.