ADC for resistors

Discussion in 'Embedded Systems and Microcontrollers' started by metabolic7, Apr 7, 2011.

  1. metabolic7

    Thread Starter New Member

    Apr 7, 2011
    I need a code for a pic16f877a for a resistance test. It goes like this, the resistance is 4700 ohms. The pic needs to measure the resistor, which needs to have a accuracy of +/- 5. which uses the ADC. this is just one part of this. dose anyone have it in c like sourceboot software.
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    You can't code a project without knowing how the hardware works. Do you have a schematic of the external circuitry to measure resistance? what is the range of resistance?

    You mention an accuracy of +/- 5 (ohms?). That is going to determine the number of bits in your A to D, and will have to change if the upper range of resistance is above the stated value.
  3. nigelwright7557

    Distinguished Member

    May 10, 2008
    You could charge up a capacitor through the resistor and time how long it takes.