Skip to content

Commit

Permalink
Contrary to the PIC16F88, enabling LVP doesn't disable the RB3 I/O fu…
Browse files Browse the repository at this point in the history
…nction.
  • Loading branch information
hvxl committed Feb 24, 2024
1 parent 1403fb0 commit 0c04c93
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion build.ctl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version 6.5
phase .
patch 4
bugfix 0
build 1
build 2
18 changes: 0 additions & 18 deletions gateway.asm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
;this file, and for a DISCLAIMER OF ALL WARRANTIES.

__config H'8007', B'00101111111100'
#ifndef LVP
__config H'8008', B'01101011111111'
#else
__config H'8008', B'11101011111111'
#endif

errorlevel -302

Expand Down Expand Up @@ -1035,8 +1031,6 @@ Start
;Port B
;Pins 2 and 5 are used by the USART.
;Pins 3, 4, 6, and 7 are used to indicate events for debugging
;RB3 can't be used when LVP is enabled, but the datasheet still
;advices to clear the TRISB bit to avoid problems with pull-ups.
clrf ANSELB ;No analog I/O on port B

banksel APFCON0 ;Bank 2
Expand Down Expand Up @@ -1311,11 +1305,9 @@ UnknownJump2 movlw b'111'

;Initialize the LED functions
clrf temp
#ifndef LVP
movlw FunctionLED1
call ReadEpromData
pcall SetLEDFunction
#endif
incf temp,F
movlw FunctionLED2
call ReadEpromData
Expand Down Expand Up @@ -3656,11 +3648,7 @@ SerialCmdTable goto SerialCmd00 ; AA, MM, RR, TT commands
goto SerialCmdLED ; LF command
goto SerialCmd0B ; CH command
retlw CommandNG
#ifndef LVP
goto SerialCmdLED ; LA command
#else
retlw CommandNG
#endif
goto SerialCmdLED ; LB command
goto SerialCmd0F ; CL, LC commands
goto SerialCmd10 ; CS, GW, SC commands
Expand Down Expand Up @@ -5290,15 +5278,9 @@ SavedSettings de 23 | 1 << 5 | 1 << 6 ;Set IgnoreErr1 and OverrideHigh
FunctionGPIO de GPIO_NONE | GPIO_NONE << 4
AwaySetpoint de 16, 0
PrintSettingL de "L="
#ifdef LVP
FunctionLED1 de '-'
FunctionLED2 de 'F'
FunctionLED3 de 'X'
#else
FunctionLED1 de 'F'
FunctionLED2 de 'X'
FunctionLED3 de 'O'
#endif
FunctionLED4 de 'M'
FunctionLED5 de 'P'
FunctionLED6 de 'C'
Expand Down
4 changes: 0 additions & 4 deletions selfprog.asm
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ SELFPROG
movlw b'11100111' ;Pins 3 and 4 are digital ouputs
movwf TRISA
;Set the LEDS as outputs
#ifndef LVP
movlw b'00000111'
#else
movlw b'00001111'
#endif
movwf TRISB

banksel ANSELA ;Bank 3
Expand Down

0 comments on commit 0c04c93

Please sign in to comment.