Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC 16f886 brain F@rt

Status
Not open for further replies.

olly_k

Member
So I have programmed 876's in the past and now using what we have am using this pic to send data to a transparent latch. Now I have configured PORTC as all outputs
but when I come to manipulate PRTC,0 I get no high output. However, in resistance, the meter 'sounds' continuity for every pulse but there is no high output, i.e. switching between hiZ and ground only. PRTC,1,2,3 etc ok
Oh and tried 3 chips, nothing connected to the output either.
I thought I had configured outputs properly, my header is below...

Can anyone help me see wood for trees?

Code:
    org 0
    clrf    PORTA
    clrf    PORTB
    clrf    PORTC
;    clrf    PORTD
    clrf    PORTE

    banksel    CM2CON0        ;B2
    clrf    CM1CON0
    clrf    CM2CON0

    banksel    OSCCON        ;B1
    movlw    b'01110000'    ;8Mhz selected
    movwf    OSCCON
    
    banksel ANSEL        ;B3
    movlw    0x00        ;Set portA to digital I/O
    movwf    ANSEL

    banksel    TRISA        ;B1
    movlw    0xFF
    movwf    TRISA        ; all portC OUTPUTS
    movwf    TRISE
;    movwf    TRISD
    movlw    0x00
    movwf    TRISB
    movwf    TRISC

    banksel    OPTION_REG    ;B1/3
    movlw    b'10000111'    ;use Prescale 256:1     **NOT YET DEFINED**
    movwf    OPTION_REG

    clrf    T1CON
 
You've only posted a snippet of your code and not the bit that sets the output.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top