Menu

#9 Can't use portc6 & portc7 digital I/O for p16f690

None
closed
None
5
2013-06-29
2012-02-27
Oscar Mier
No

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?

Discussion

  • Oscar Mier

    Oscar Mier - 2012-02-27
    • summary: Can't input digital data into pic16f690 an0, an1, ... , an12 --> Can't use portc6 & portc7 digital I/O for p16f69
     
  • Oscar Mier

    Oscar Mier - 2012-02-27
    • summary: Can't use portc6 & portc7 digital I/O for p16f69 --> Can't use portc6 & portc7 digital I/O for p16f690
     
  • Alain Portal

    Alain Portal - 2012-02-28

    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

     
  • Robert Pearce

    Robert Pearce - 2012-02-28

    This appears to be a bug. I will look into it.

     
  • Nobody/Anonymous

    @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.

     
  • Santiago

    Santiago - 2012-02-28

    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.

     
  • Nobody/Anonymous

    That works for the PIC16F690, arcachofo. Thank you.

     
  • Robert Pearce

    Robert Pearce - 2012-02-28

    arcachofo is correct; that is the fix I've just committed to trunk. Thanks for the report.

     
  • Roy Rankin

    Roy Rankin - 2013-06-29
    • status: open --> closed
    • assigned_to: Robert Pearce
    • Group: -->
     

Anonymous
Anonymous

Add attachments
Cancel