• AVR Freaks

pic 16f887 adc vref+ cannot be accessed

Author
Barryann
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2017/05/06 18:31:58
  • Location: 0
  • Status: offline
2019/08/22 22:23:17 (permalink)
0

pic 16f887 adc vref+ cannot be accessed

Novice in need of help.
I am using mplabx 5.25 with the simulator. PIC 16F887 was chosen for the job. I have set up 8 adc inputs each to be read in turn. I have attempted to use a 4v external reference to pin 3. All inputs are successfully read with the response transferred appropriately . A little arithmetic shows that 5v rail is the unwanted reference. Changing the supply volts confirms this. No matter my code to adcon 1 I am unable to use the external reference. I have varied the value of the reference to other values between 1 and 4.8v without effect. What is my omission??
#1

4 Replies Related Threads

    ric
    Super Member
    • Total Posts : 23591
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: pic 16f887 adc vref+ cannot be accessed 2019/08/22 22:53:16 (permalink)
    +2 (2)
    Forget about the simulator and try it on a real chip.
    I really don't think the simulator is much good for simulating analog voltages.
     
    n.b. do you really want to use a PIC16F887?
    There are much nicer, cheaper, faster, more powerful PIC16F chips available now.
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    Barryann
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/05/06 18:31:58
    • Location: 0
    • Status: offline
    Re: pic 16f887 adc vref+ cannot be accessed 2019/08/22 23:54:29 (permalink)
    0
    Thanks for the response. That may well be the easier option. From your experience which chip would you recommend. I have very limited experience in this field. Being from the back-blocks of Qld. Aus its important that the chip is readily available.
    Thanks
    #3
    ric
    Super Member
    • Total Posts : 23591
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: pic 16f887 adc vref+ cannot be accessed 2019/08/23 01:31:35 (permalink)
    +1 (1)
    What are your requirements?
    Do you need a 40 pin chip?
    Do you want DIP or surface mount?
    Note, if you spend A$50 at www.digikey.com.au, you get free freight and access to just about any chip Microchip make. Delivery is only 3-4 days.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    mpgmike
    Super Member
    • Total Posts : 254
    • Reward points : 0
    • Joined: 2014/01/23 17:27:06
    • Location: NJ
    • Status: offline
    Re: pic 16f887 adc vref+ cannot be accessed 2019/08/24 05:48:02 (permalink)
    0
    Barryann, the newer PIC offerings have special functions that simply weren't available on the early 16Fs like the one you're using.  For example, there are upwards of 12 timers, some with special features that get them to turn & off based on hardware events.  The analog ADC can be 12-bits (which divides your result by 4096 instead of 1023 max of 10-bits) with other automated features (ADC2).  Configurable Logic Cell is like a built-in 74xx series logic chip of old, but fully configurable.  There are many communications protocols like UART (with more modern specialty protocols), I2C, SPI, CAN, and even USB.  Zero Cross Detect is a fascinating feature that enables you to monitor AC sine waves (yes, below Vss!).  Even simple things like external interrupts have been expanded; your old PIC has INT0 (and perhaps INT1 & 2) while the new versions can trigger an interrupt when ANY of the I/O pins change state...and you can specify interrupt on Positive and/or Negative edge.
     
    The list goes on and on.  I suggest starting with Microchip's Selector (https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=30048) to see what is available.  If you are new to PICs, many of the acronyms won't mean much to you.  Download a couple data sheets and read about what these features can do.  Get familiar with the features you might want to use.  Buy a couple different PICs & play with them on a breadboard.  Have fun.  This is an exciting world you're moving in too.

    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5