PIC16F62X outputs


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    >> Ports in question are
    >> RA4
    >> RB6
    >> RB7

    ---
    RA4 is multiplexed with T0CKI and CMP2. You've already taken care of CMP2 with the CMCON = 7. The T0CKI input is controlled by the T0CS bit in the OPTION_REG which defaults to 1 (Timer0 input is T0CKI). You can turn this off by setting OPTION_REG.5 = 0. However This will not affect the operation of RA4 as an output, which appears to be the problem.

    RA4 is an open collector type output. It requires a Pull-Up resistor on the output to be used as a normal digital output.

    ---
    RB6 is multiplexed with T1OSO, T1CKI and PGC. T1OSO and T1CKI are controlled by T1CON bits 1 (TMR1CS) and 3 (T1OSCEN). Both of these bits default to 0, which means that the multiplexed functions are disabled. PGC is only used during programming, but if you leave a programmer connected during operation, you may have problems.

    However, in your program you have ...

    TRISB=%01000000

    With a 1 in the bit 6 position, RB6 is set to INPUT. As we found out in your other thread, you want RB6 to be an output.

    ---
    RB7 is multiplexed with T1OSO and PGD. Again, T1OSO is disabled by default (T1OSCEN). and the previous mention of the programmer applies here too.

    It may be that you grabbed an old file for this post. But the correction from the "other" thread is incorrect in this listing.

    pLcd_dat = glcd_dat
    PORTB.6 = glcd_dat.4
    PORTB.5 = glcd_dat.5

    change to

    pLcd_dat = glcd_dat
    PORTB.6 = glcd_dat.6
    PORTB.5 = glcd_dat.7

    ---
    Also, like mat says, RA5 is input only, so it will have to be moved to a different pin.

    HTH,
       Darrel

  2. #2
    Deadeye's Avatar
    Deadeye Guest


    Did you find this post helpful? Yes | No

    Default

    thanks so much for your help.

    I found a sample that had a pull up on A5. This i tested and it fixed the problem.

    The TRISB=%01000000 was a mistake on my part. I thought it was %01234567 and i your saying that it should be 76543210
    I need B1 as a input so i chnaged to TRISB=%00000010

    Oviously i have much to learn.

Similar Threads

  1. DMX512 Reception + 3 * 8-Bit PWM Outputs
    By JEC in forum Code Examples
    Replies: 5
    Last Post: - 16th February 2015, 15:21
  2. 30 PWM outputs on one chip?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th September 2009, 16:32
  3. help with multiple outputs...
    By rickvan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th November 2007, 17:34
  4. Setting up analogue outputs with picbasic pro
    By Jhdgkss in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th September 2005, 23:36
  5. making ports outputs on a 12F629
    By bartman in forum mel PIC BASIC
    Replies: 2
    Last Post: - 14th November 2004, 17:47

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