Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok, but what about this loop here, can i do that, having multiple a/d conversion on one chip ?

    loop:
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50

    From the definition of ADCON0, I can only choose one pin for A/D conversion. Maybe thats why it get mixed up .
    Last edited by lerameur; - 3rd January 2007 at 20:39.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    ok, but what about this loop here, can i do that, having multiple a/d conversion on one chip ?

    loop:
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50

    From the definition of ADCON0, I can only choose one pin for A/D conversion. Maybe thats why it get mixed up .
    You can do A/D on more than one pin, just not at the same time. I'm not sure why it didn't work for you in the one post. Maybe not waiting long enough between conversions and/or long enough between switching A/D channel assignment. I think you have to wait awhile, not only after the last conversion, but after you switch the channel, which ADCIN does for you. So, again, not sure. I'll think on it. Until then, double check your configuration, TRIS assignments, ADCON setup, etc.etc.
    And you shouldn't have to use more than one channel for your project, unless I missed something there too...

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI,
    I dont have to use more then one for this project, But I had this problem before and did not persue into it, so I asked the question just on the way. I read on a site, just like you said, adding a capacitor to the output of the sensor or battery will help. The thing I dont know why it works, I tried these two program they both works, just dont know why the program with just one ADCON0 works

    Two Adcon
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50


    One ADCON0
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    ADCIN porta.1, input2
    pause 50

    See they both work, but I did not configure port A.1.. why ?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    HI,
    I dont have to use more then one for this project, But I had this problem before and did not persue into it, so I asked the question just on the way. I read on a site, just like you said, adding a capacitor to the output of the sensor or battery will help. The thing I dont know why it works, I tried these two program they both works, just dont know why the program with just one ADCON0 works

    Two Adcon
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50


    One ADCON0
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    ADCIN porta.1, input2
    pause 50

    See they both work, but I did not configure port A.1.. why ?
    You're using the ADCIN command. Ya think maybe PBP sets it up for ya?
    I know the PBP manual doesn't explicitly say it that it sets it up for you, but it does say that ADCIN reads the 'channel' and also says all you have to do is set the required pins to inputs, it doesn't really say to select the channel you want to sample... I suppose the manual could be a little more informative in this respect.
    I just looked at the ADC section of the 'F88. It's a bit different than some of the other PICs. Not only do you have to TRIS the pins you want to inputs, but you also have to enable the A/D in the ANSEL register. I don't know if PBP does this for you or not.
    You can easily check for that in your .lst file after compiling the program. Just put a comment around the line you're wanting to check and search for that comment in the .lst file. Should make it a bit easier for ya...

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    hi,

    Ok I got the A/D working now.

    I bought another RF module kit from this web site:
    http://www.robotshop.ca/home/product...ity-tx-rx.html
    ( actuallyI just had to drive there).
    I use the exact program and configuraiton and I am getting contact output on the lcd :
    TempC : 0
    TempF: 32

    here is what I see on the scope:
    http://www3.sympatico.ca/lerameur/
    Last edited by lerameur; - 4th January 2007 at 17:27.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    hi,

    Ok I got the A/D working now.

    I bought another RF module kit from this web site:
    http://www.robotshop.ca/home/product...ity-tx-rx.html
    ( actuallyI just had to drive there).
    I use the exact program and configuraiton and I am getting no ouput
    here is what I see on the scope:
    http://www3.sympatico.ca/lerameur/
    A/D is working as expected? Values are what you need and all that?

    RF Modules - sounds like you should take them back and get another pair of the same thing you've already got.

  7. #7
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I bought three pair of them , They all act the same...
    it looks ok from the scope doesn't it ??

    A/D is working as expected? Values are what you need and all that?
    Yes
    Last edited by lerameur; - 4th January 2007 at 17:49.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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