'Calculate resistance from pic timer value'

def _calculateResistance(self, picTemp, calibrationPicTemp):

    scale = (1 << (self.tempScaler + 1))
    clock = (4000000.0 / (4.0 * scale))
    vRef = ((0.25 * self.vdd) + ((self.vdd * self.vRefFactor) / 32.0))
    T = (picTemp / clock)
    resistance = ((- T) / (math.log((1 - (vRef / self.vdd))) * self.cap))
    return resistance
