16F676 Help?


Closed Thread
Results 1 to 6 of 6

Thread: 16F676 Help?

  1. #1
    vicce's Avatar
    vicce Guest

    Unhappy 16F676 Help?

    dear friends,

    I am using a 16f676 and I need help to configure the begin of the program.
    I will use porta.0 and porta.1 as analogical and the remaining as digital.
    I will use internal oscillator without master clear.

    friends help-me in these initial configurations

    thank you very much,

    vicente de paula neto(Sao Paulo-Brazil)

    excuse my terrible English.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Smile

    Hi, Vicce

    Everything you need is here : http://www.farnell.com/datasheets/41570.pdf

    or from Microchip main site : http://ww1.microchip.com/downloads/e...Doc/40039c.pdf

    Alain
    Last edited by Acetronics2; - 4th August 2005 at 12:38.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I don't want to soud like a broken record but...
    To get some example, begin a search with
    1. PORTA AND ADCON => this will lead you to some configuration
    2. Configuration AND fuse => this will lead you to the FAQ on a excellent thread who'll teach you how to find/use PIC fuses (internal osc and such)
    Later if you still need some tips, just send what you have tried.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    vicce's Avatar
    vicce Guest


    Did you find this post helpful? Yes | No

    Question 16f676

    friends,

    this is writing for a 16f873 and it is exactly this that I need for a 16f676

    Define ADC_BITS 10 ;Set number of bits in result
    Define ADC_CLOCK 3 ;Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ;Set sampling time in uS

    TRISA = %11111111
    ADCON1 = 4 ;Set PORTA analog and right justify result
    OPTION_REG = $7f ; Enable PORTB pullups

    in the place (pull-up) portb to configure for porta

    in advance thankful.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by vicce
    in the place (pull-up) portb to configure for porta
    There's no Pull-up on PORTA. Must use external one wich is always the best pratice... well IMHO.

    AND PIC16F676 have internal comparator on PORTA, as i thought, so you must add
    CMCON=7
    to the top of your code
    CMCON=7, click,CMCON=7, click,CMC, click,CMCON, click,CMCON=7, click...

    AND, the last one, ADCON1, is not the one you need to set A/D channel. You need to set ANSEL
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=406&stc=1">
    Attached Images Attached Images  
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Exclamation

    Quote Originally Posted by mister_e
    There's no Pull-up on PORTA. Must use external one wich is always the best pratice... well IMHO.
    Although I agree an external pull-up is better....
    TFM states...."Each of the PORTA pins, except RA3, has an individually configurable weak internal pull-up."
    Last edited by rhino; - 5th August 2005 at 05:31.

Similar Threads

  1. Unable to set fuses on 16F676
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th January 2012, 18:21
  2. PortA.2 on a 16F676
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th April 2007, 13:59
  3. SEROUT workaround for 16F676
    By rkeene0517 in forum Code Examples
    Replies: 0
    Last Post: - 12th February 2006, 03:39
  4. Using 16f676 with comms
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 28th October 2005, 20:01
  5. "Write" with 16F676
    By Jrocci in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2003, 17:38

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