1936 ra.7 i/o ???


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219

    Default 1936 ra.7 i/o ???

    So I’m stumped over this one. Using a PIC16F1936 on a lighting project. Trying to run some simple code to blink A.7, A.6, C.0, C.1, C.2, …….. All lights are blinking except PortA.7.

    Code:
    ;    MPASM
    asm
     __config _CONFIG1,_FOSC_INTOSC & _CLKOUTEN_OFF & _MCLRE_ON & _BOREN_OFF & _WDTE_OFF & _FCMEN_OFF & _CP_OFF & _CPD_OFF & _IESO_OFF
     __config _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LVP_OFF
    endasm
     
    define  osc 8 
    ;--[ Set Hardware ]---------
        OSCCON=%01110000                                                    
        ANSELA=$0   
        ANSELB=$0    
        ADCON0=$0
        PortA=0
        PortB=0                                      
        PortC=0 
        TrisA=0                                                                                
        TrisB=0   
        TrisC=0
    
    Start:    
        PortA.7=1
        pause 500
        PortA.6=1
        pause 500
        PortC.0=1
        pause 500
        PortC.1=1
        stop
        END
    RA.6 and RA.7 are also oscillator pins and must be set to I/O outputs in CONFIG1 with CLKOUTEN=1 (_CLKOUTEN_OFF) and FOSC= INTOSC (CLKOUTEN_OFF). According to the data sheet this should give digital I/O on both RA.6 and RA.7. RA.6 is responding as expected. RA.7 is NOT giving me a digital output. I have tried on multiple 1936’s on my design board and LAB-X2. No 5V output on RA.7. What have I overlooked?
    Thanks,
    Wayne

  2. #2
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: 1936 ra.7 i/o ???

    Usually when a single pin doesn't do what you expect it's a configuration error. A quick look at the datasheet suggests the only other possible use for the pin is OSC1/CLKIN. You should be able to test the idea by changing OSCCON from %01110000 to %01110010. If that's the case, your configuration words are not getting loaded for some reason.

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 1936 ra.7 i/o ???

    Instead of using the PORTA.7 directive, why not use the LATA.7 directive? You maybe seeing the Read/Modify/Write problem. Try it....
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: 1936 ra.7 i/o ???

    Thanks guys, I'll give it a try.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts