Mosaic
Well-Known Member
Can anyone using Proteus ISIS verify whether the 16f882 RA6 digital output works in the simulator? All the other PORTS/pins seem fine.
I can't get it to respond to bsf PORTA,6 or bcf PORTA,6. It's holding at an indeterminate gray color state. Not red (hi) or Blue (lo).
If I place a 10K pulldown resistor on it , it will pulldown. But no response to coded outputs at all.
I did the TRISA settings and the ANSEL settings and disabled the clockout etc.
Here's the fuses & port setup code I used
__CONFIG _CONFIG1, _PWRTE_ON & _WDT_OFF & _INTOSCIO & _BOR_OFF & _LVP_OFF & _CP_OFF &_CPD_OFF & _MCLRE_OFF &_INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
;Setup Ports & ADC
Lastly, the code I have runs the port fine with the Oshonsoft PIC Simulator.
Any advice on this?
I can't get it to respond to bsf PORTA,6 or bcf PORTA,6. It's holding at an indeterminate gray color state. Not red (hi) or Blue (lo).
If I place a 10K pulldown resistor on it , it will pulldown. But no response to coded outputs at all.
I did the TRISA settings and the ANSEL settings and disabled the clockout etc.
Here's the fuses & port setup code I used
__CONFIG _CONFIG1, _PWRTE_ON & _WDT_OFF & _INTOSCIO & _BOR_OFF & _LVP_OFF & _CP_OFF &_CPD_OFF & _MCLRE_OFF &_INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
;Setup Ports & ADC
Code:
banksel ANSEL
movlw b'00000011'; prepare to set bits A0,A1 to analog.
movwf ANSEL; apply a/d input settings - PORTA
clrf ANSELH; PORTB all digital
Banksel TRISA
movlw b'10000011' ; set bits ,0,1,7 as inputs, rest as outs. 7 is Sw1 digital
movwf TRISA
bsf TRISE,3; make E3 (IC pin1) an input- sw0 digital
clrf TRISB ; Portb all outs.
CLRF TRISC ; make portC outputs
movlw b'01111100'
movwf OSCCON ; set 8Mhz, Osc setup based on config fuses .
banksel ADCON1
clrf ADCON1; left justify ADRESH, Vdd & Vss as Vrefs.
banksel ADCON0
clrf ADCON0
bsf ADCON0,7 ; set sample period to 4 us (8 instruction cycles) @ 8Mhz, An0 is input.
BankSel HoldL ; back to general variable bank
Lastly, the code I have runs the port fine with the Oshonsoft PIC Simulator.
Any advice on this?