PDA

View Full Version : 18F4620 - Trying to modify CONFIG 3H



rswain
- 3rd March 2009, 07:03
I need the CCP2MX bit in CONFIG 3H turned OFF, allowing CCP2 to be assigned to port B. There's got to be a way to set it and forget it in the INCLUDE file. I'm sure this is simple, but all the obvious ways I've tried still haven't worked.:confused:

Any help would be appreciated!
Robert

Archangel
- 3rd March 2009, 08:07
Hi Robert,
Try this line this way:Red added:
__CONFIG _CONFIG3H, _PBADEN_OFF_3H <font color = red>& _CCP2MX_PORTBE_3H</font color>

Look in MPASM SUITE for the P18F4620.inc file, there you will find all the configs for this chip


;----- CONFIG3H Options --------------------------------------------------
_MCLRE_OFF_3H EQU H'7F' ; Disabled
_MCLRE_ON_3H EQU H'FF' ; Enabled

_LPT1OSC_OFF_3H EQU H'FB' ; Disabled
_LPT1OSC_ON_3H EQU H'FF' ; Enabled

_PBADEN_OFF_3H EQU H'FD' ; PORTB<4:0> digital on Reset
_PBADEN_ON_3H EQU H'FF' ; PORTB<4:0> analog on Reset

_CCP2MX_PORTBE_3H EQU H'FE' ; Multiplexed with RB3
_CCP2MX_PORTC_3H EQU H'FF' ; Multiplexed with RC1
;----- CONFIG5L Options --------------------------------------------------
_CP0_ON_5L EQU H'FE' ; Enabled
_CP0_OFF_5L EQU H'FF' ; Disabled

_CP1_ON_5L EQU H'FD' ; Enabled
_CP1_OFF_5L EQU H'FF' ; Disabled

_CP2_ON_5L EQU H'FB' ; Enabled
<font color=red>_CP2_OFF_5L EQU H'FF' ; Disabled</font color>

_CP3_ON_5L EQU H'F7' ; Enabled
_CP3_OFF_5L EQU H'FF' ; Disabled

rswain
- 4th March 2009, 04:54
Joe,

Thanks for not only providing the answer, but the reference as well. Now I won't ever ask that, or even a similar question, ever again! Great forum!:rolleyes:

Archangel
- 4th March 2009, 05:08
You are welcome Robert!<br>
and as a bonus, every newbie who sees this post while searching
for this problem will be served as well, so thank you for the question.<br> And Welcome to the forum.