I try to test portc with this portc.asm:
include "p16f690.inc"
__CONFIG ( _FCMEN_OFF & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT )
banksel ADCON0
clrf ADCON0
banksel ADCON1
clrf ADCON1
banksel ANSEL
clrf ANSEL
banksel ANSELH
clrf ANSELH
banksel TRISC
clrf TRISC
bcf TRISC,6
bcf TRISC,7
banksel SSPCON
bcf SSPCON,5
start
movlw B'11000001'
banksel PORTC
movwf PORTC
bsf PORTC,6
bsf PORTC,7
bsf PORTC,5
nop
goto start
end
But portc6 and portc7 never seem to switch from 0 to 1. Nor can I make portc6 or portc7 behave as digital inputs my setting the appropriate TRISC bits. Why?
Anonymous
I don't know well PIC asm, but it seems to me that portc6 and portc7 are always set, never clear...
movlw B'11000001' <--------------------------------------------
banksel PORTC
movwf PORTC
This appears to be a bug. I will look into it.
@dionysos-sf yeah, but in the Ram window, and when using 'dump', register 0x07 (portc, that is) never shows B'11000001', the last two bits [11]000001 always appear as zeroes [00]000001, regardless of whether bsf PORTC,6 &
bsf PORTC,7 get executed.
For me works editing p16f88x.cc, line 1076:
m_portc = new PicPortRegister(this,"portc","",8,0x3f);
Set the enable mask to 0x3f when should be 0xff
i think it should be:
m_portc = new PicPortRegister(this,"portc","",8,0xff);
Regards.
That works for the PIC16F690, arcachofo. Thank you.
arcachofo is correct; that is the fix I've just committed to trunk. Thanks for the report.