Uniformity of 'POT' accross pins?


Results 1 to 7 of 7

Threaded View

  1. #6


    Did you find this post helpful? Yes | No

    Default

    Hi Anand. I had the same problem measuring resistors. And yes, I found that portc gave me entirely different results than portb on a 16F73. The portb pins were very close but 2 of the 4 used gave me a slightly different result. So, I modified the automatic calibration program shown in the PBP manual. Perhaps you can do a similar routine to calibrate your capacitors. Scale1, scale2, scale3 and scale4 get calibrated individually and I am getting consistent results reading resistors from 470 ohms to 47K. The gosub makesound simply beeps a sounder letting you know as each scale gets calibrated. I also have a program that will beep the scale value to let you know what the actual number is. Let me know if you want that.

    Clear 'ALL VARIABLES = 0
    LET SCALE1 = 1 'START CALIBRATION @ 1

    TEST1:
    Pot PORTB.7,SCALE1,Y 'START ADVANCING SCALE UNTIL THE DEFAULT RESISTOR 47K = 253
    IF (Y < 253) Then LET SCALE1 = (SCALE1 + 1): GoTo TEST1
    GoSub MAKESOUND 'CALIBRATION1 COMPLETED


    LET SCALE2 = 1 'START CALIBRATION @ 1

    TEST2:
    Pot PORTB.6,SCALE2,Y 'START ADVANCING SCALE UNTIL THE DEFAULT RESISTOR 47K = 253
    IF (Y < 253) Then LET SCALE2 = (SCALE2 + 1): GoTo TEST2
    GoSub MAKESOUND 'CALIBRATION2 COMPLETED

    LET SCALE3 = 1 'START CALIBRATION @ 1

    TEST3:
    Pot PORTB.5,SCALE3,Y 'START ADVANCING SCALE UNTIL THE DEFAULT RESISTOR 47K = 253
    IF (Y < 253) Then LET SCALE3 = (SCALE3 + 1): GoTo TEST3
    GoSub MAKESOUND 'CALIBRATION3 COMPLETED

    LET SCALE4 = 1 'START CALIBRATION @ 1

    TEST4:
    Pot PORTB.4,SCALE4,Y 'START ADVANCING SCALE UNTIL THE DEFAULT RESISTOR 47K = 253
    IF (Y < 253) Then LET SCALE4 = (SCALE4 + 1): GoTo TEST4
    GoSub MAKESOUND 'CALIBRATION4 COMPLETED
    Last edited by peterdeco1; - 23rd February 2009 at 15:32. Reason: shorten post

Similar Threads

  1. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 20:23
  2. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  3. A/D, Pot, Input, A,B So lost now....
    By Helmutt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th March 2008, 22:23
  4. Replies: 4
    Last Post: - 24th January 2007, 22:20
  5. pot controlled pwm -- help
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 29th January 2006, 12:29

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