I don't trust what MCC is doing to initialize the PIC unless you've been through the disassembly line by line to confirm it is *NOT* enabling the FVR. The debugger says FVRCON:FVREN is zero, but that requires faith in the debugger. I *generally* trust it, but not when I need to *prove* that hardware is Go/NoGo. You can generally assume that the simulator doesn't reliably (if at all) support analog(ish) peripherals . . .
Here's the MPASM version of that minimal firmware:
#include "p12f1840.inc"
; PIC12F1840 Configuration Bit Settings
; CONFIG1
; __config 0xC9E4
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
; CONFIG2
; __config 0xFCFF
__CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_LO & _LVP_ON
errorlevel -302 ; disable 'Register in operand not in bank 0' warning
RES_VECT CODE 0x0000 ; processor reset vector
GOTO Start ; go to beginning of program
MAIN_PROG CODE ; let linker place main program
Start:
BANKSEL LATA ; Data Latch
CLRF LATA ; cleared
BANKSEL TRISA ;
MOVLW B'011111' ; Set RA<5> as output - only pin without ADC
MOVWF TRISA ; and set RA<4:0> as inputs
; fortunately FVRCON and LATA are in the same bank,
; so don't need to mess with FVR/INDF!
BANKSEL LATA ; *** correction by 1001 ***
Loop:
BTFSS FVRCON,FVRRDY ; Copy FVRRDY to RA5
BCF LATA, 5
BTFSC FVRCON,FVRRDY
BSF LATA, 5
GOTO Loop ; loop forever
END
You'll need either MPLAB v8.92 or MPLAB X v<=5.35 as MPASM support was dropped from later MPLAB X versions.
Connect a 10K pullup to /MCLR and the LED (+ series resistor) from RA5 to Vss.
Alternatively if you are sticking with XC8 + MCC, turn off the FVR with:
FVRCONbits.FVREN=0;
before your loop, and use a real LED, not the debugger!
Edit: Code fixed, see below.