Pin control problems


Results 1 to 6 of 6

Threaded View

  1. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    BCF STATUS,RP0 ;Bank 0
    BCF STATUS,RP1 ;
    CLRF PORTA ;Init PORTA
    BSF STATUS,RP0 ;Bank 1
    BCF STATUS,RP1 ;
    MOVLW 07h ;Set RA<2:0> to
    MOVWF CMCON0 ;digital I/O
    CLF ANSEL ;Make all PORTA I/O
    MOVLW F0h ;Set RA<7:4> as inputs
    MOVWF TRISA ;and set RA<3:0>
    ; as outputs
    BCF STATUS,RP0 ;Bank 0
    BCF STATUS,RP1 ;
    Translated:

    PORTA = 0
    CMCON0 = 7
    ANSEL = 0 ; THE CLF on the ANSEL command you provide must be a typo - it should say CLRF
    TRISA=240 ; or =$F0 or =%11110000

    Adjust the TRISA the way you want it

    If you still get only RA4 and 5 to work with the pause in between, then it is most likely NOT a R-M-W problem.

    EDIT: Looks like you got it - nice work!
    Last edited by paul borgmeier; - 19th October 2007 at 21:04. Reason: Update noted in body of reply
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. My code for TV remote and MIBAM for RGB control
    By idtat in forum Code Examples
    Replies: 4
    Last Post: - 12th January 2013, 21:52
  2. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 14:55
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 18:27
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 18:07
  5. Port pin problems
    By sgreelish in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th March 2004, 19:56

Members who have read this thread : 0

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