help!!!!


Closed Thread
Results 1 to 11 of 11

Thread: help!!!!

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hi lokanand,
    I don't think there are any specific values for SCALE - it's sort of a try it and see kind of thing. There is a bit of code in the PBP manual for calibrating the SCALE value - give it a try.

    Arch

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Smile

    Also, 200k pot with 100n is not a good combination.

    As Archilochus said, check the manual.

    Play with 50k, 5k and 10n, 100n.


    -----------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I favour 100n for the POT Capacitor (same one's I use for decoupling sprinkled around the PCB - saves loading another component reel onto the board stuffing machine). With a 10K variable, the scale value is about 95.

  4. #4
    Join Date
    Nov 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    does this mean a 100nanoFarad???

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    yes
    100 nF = 0.1 uF
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  6. #6
    Join Date
    Nov 2006
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Thanks!!! BTW, I am trying to execute the code supplied in the PICBasic manual, but it doesn't seem to work.

    This is the code in the manual.

    B0 Var Byte
    scale Var Byte

    For scale = 1 To 255
    POT 0, scale, B0
    If (B0 > 253) Then calibrated
    Next scale

    Serout 2,0,[" Increase R or C.", 10,13]
    Stop

    calibrated:
    Serout 2,0,[" Scale= ",# scale, 10,13]

    This is my modified code:

    B0 var byte
    scale var byte
    LED var PORTB.1
    Potpin var PORTB.2

    for scale = 1 to 255

    LCDout $FE, 1, "calibrating", $FE, $C0, "Scale=", DEC scale, "B0=", DEC B0
    pot Potpin, scale, B0
    If (B0 > 253) then calibrated
    next scale

    Lcdout $FE, 1, "Increase R or C"
    stop
    calibrated:
    lcdout $FE, 1, "Scale=", scale

    As you can see, I have the pot connected to PORTB2.

    When I run the code, I can see the scale and B0 incrementing on the LCD, however, before B0 or scale reaches 255 it starts over from scale=0 & B0=0.

    Anyone have experience with this???

    I know it's possible to do this manually but I would like to do it with automation because I will need to calibrate the scale for several different pots in the future. Thanks!!!

  7. #7
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    At first glance, before other possibilities, "then calibrated" will work like GOTO; not like GOSUB.

    I would suggest that you use "calibrated" as a subroutine with a "return" and change all "then calibrated" to "then GOSUB calibrated".

    Then we can talk about the rest of the code.

    ------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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