pot command


Closed Thread
Results 1 to 23 of 23

Thread: pot command

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default His Book

    Quote Originally Posted by lerameur
    I am going to try this today thanks.
    I am following John Iovine,s book, he usesa F84a pic. He always uses the portB by default, I wanted to try using port A , but on a F88.
    Also I was reading the command CMCON=7 meaning th three first bit are set to one. When I read the legend it says 1 is for Setting th bit, I would of first thought setting would be for setting for comparator mode.

    k
    Hi Lerameur,
    I have his book too, I thought that was where you got that code. He , in my opinion, left too many loose ends in his code as he neglected to put in all the needed little setup routines, like the trisa and trisb etc. he relies on pbp defaults
    and that sorta leaves beginners out in the cold, if you do not rely on defaults and write in everything your code will always be usable and only require minor tweaking to port to other PICs
    Cheers
    JS

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    yes thats what I am beginning to realize too , lots of stuff missing in the book, then when you use another chip, I'm screwed.
    Abou tthe A/D, doesn't that read a voltage ? whereas the Pot read a resistance ?

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    both cde works,
    i am trying to figure out one thing now.

    I am replacing this command line:
    HIGH PORTB.0
    PAUSE 1000
    LOW PORTB.0

    by this one:
    serout 2,n9600,(2)

    i am getting errors:
    C:\PBP\POT_TRY.BAS ERROR Line 39: Bad expression.
    C:\PBP\POT_TRY.BAS ERROR Line 33: ID LED2 is not a LABEL.
    C:\PBP\POT_TRY.BAS ERROR Line 34: ID LED3 is not a LABEL.
    C:\PBP\POT_TRY.BAS ERROR Line 35: ID LED4 is not a LABEL.

    suddenly my labels are not labels ??

  4. #4
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Sometimes the error messages bear no relation to the actual error.

    Try changing serout 2,n9600,(2)

    to serout 2,n9600,[2]
    Keith

    www.diyha.co.uk
    www.kat5.tv

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    yes thanks,

    those french keyboards...

    k

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    yeah i know what you mean. It's always handy to have English(United State) driver installed too. Just need to press Shift+Alt to switch between language
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by lerameur
    yes thanks,

    those french keyboards...

    k
    Hi,

    For once one can say it's the Keyboard's error ...

    Mhhhh, have something against French Goose liver, Sauternes, Camembert, Cognac, ... and so on ...

    Ahhhh, I see ... that was just a "glitch" ...

    Alain

    PS: In French, as I've read here, your should be called " Le Ramier " ... and not "Lerameur" ....
    LOL !!!!
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    wow shift-alt, thats cool.

    I am still confused about one part. The default selection from the compiler is great but very specific for me. Lets say you are using the Pic16F877, with port A, B, C,D,
    I then use the command serout, IS there a problem using the exact port?
    Ex: serout portC.2,N9600,[3]
    instead of 2,N9600,[3] . ( by which I know the pin number, but I dont know the port)
    For me it looks like its taking a random port, obviously , the one by default...

    ken

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 21:31
  2. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 21:23
  3. PBP2.50b and POT command problem ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2008, 18:14
  4. Replies: 4
    Last Post: - 24th January 2007, 23:20
  5. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 19:57

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