PIC16F767 IOs


Closed Thread
Results 1 to 13 of 13

Thread: PIC16F767 IOs

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Adcon1

    As I understand it, you should do adcon1=7 to make all analog pins digital. Thats how I do it. ports a and e are both affected by adcon1 reg and adcon1 = 7 will make port a digital so it should make both digital.

    Travin

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Thanks Travin.
    So, I should be safe using ADCON1=7 annd no strange behavior from the analog IOs?
    Regards,
    Nick

  3. #3
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Maybe

    Pin a.4 is an open drain. Read page 11 in the PBP manual if you intend on using that pin as an output.

    Travin

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I'm using this code and I do not get any action from Pin 7 (RA5).
    I know about Pin 6 (RA4 open collector output)

    ADCON1=7
    CMCON=7

    main:


    Toggle PORTA.0
    Pause 300
    Toggle PORTA.1
    Pause 300
    Toggle PORTA.2
    Pause 300
    Toggle PORTA.3
    Pause 300
    Toggle PORTA.4
    Pause 300
    Toggle PORTA.5
    GoTo main
    End
    Am I missing something?
    Regards,

    Nick

  5. #5
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Code

    Is that your entire code. You might want to try and establish a know condition of the pins at the beggining. What osc are you using?

    cmcon=7
    adcon1=7

    trisa = %00000000 ' makes them outputs
    porta = %11111111 ' makes them high

    main:
    Toggle PORTA.0
    Pause 300
    Toggle PORTA.1
    Pause 300
    Toggle PORTA.2
    Pause 300
    Toggle PORTA.3
    Pause 300
    Toggle PORTA.4
    Pause 300
    Toggle PORTA.5
    GoTo main
    End
    Last edited by Travin77; - 29th May 2006 at 00:10.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    The code is only for testing A port.
    Am I wrong assuming that ADCON1=7 takes care only of A0-3 ports?
    Should I extend it to ADCON1=15 or ADCON1=31 to cover higher bits?
    Regards,

    Nick

  7. #7
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Adcon1

    Adcon1 should set all of port a to digital. Is there a good conection on porta.5?

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Yes, connection is good, it just does not toggle.
    I used ADCON1=15 and the port A5 works(?!?!?!?!).
    With ADCON1=7 it does not work.
    All other A ports work in both cases.
    What about CVRCON register?

    Nick

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. 8+8 IOs controlled via sms
    By aratti in forum GSM
    Replies: 15
    Last Post: - 11th December 2008, 11:29
  3. PIC16F767 blinking code
    By DanPBP in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 16th October 2006, 14:25
  4. problem ont hpwm on the pic16f767!!
    By oscar in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th May 2005, 10:41

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