mpasm unable to modify CONFIG settings for 18F2xK50/4xK50

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

mpasm unable to modify CONFIG settings for 18F2xK50/4xK50

Post by Jerry Messina » Fri Aug 23, 2019 9:33 am

This isn't really a compiler issue... it's a problem with mpasm.

The MPASM/MPASMX assembler (all versions, up to mpasmx 5.85) does not correctly identify the nLPBOR and nPWRTEN
config settings in CONFIG2L, and will leave them at the default setting.

This appears to be a problem with the way these two settings are defined in the mpasm 8bit_device.info database.
For the 18F2xK50/18F4xK50, the above two config fuses are defined as:

Code: Select all

   <SWITCH_INFO_TYPE><nPWRTEN><Power-up Timer Enable><1><2>
   <SWITCH_INFO_TYPE><nLPBOR><Low-Power Brown-out Reset><40><2>
Note the use of lowercase chars in the SWITCH_INFO_TYPE name (ie 'nPWRTEN')

To correct this, you can edit the 8bit_device.info file with a text editor (notepad.exe) and change those names to uppercase...

Code: Select all

   <SWITCH_INFO_TYPE><NPWRTEN><Power-up Timer Enable><1><2>
   <SWITCH_INFO_TYPE><NLPBOR><Low-Power Brown-out Reset><40><2>
Be careful not to change/add anything else. As always, make a backup copy first.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: mpasm unable to modify CONFIG settings for 18F2xK50/4xK5

Post by David Barker » Fri Aug 23, 2019 2:30 pm

Thanks for that info Jerry...

Post Reply