How can I adjust in USBDemo A/D converter from 8 to 10 Bit resolution?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    25


    Did you find this post helpful? Yes | No

    Default How can I adjust in USBDemo A/D converter from 8 to 10 Bit resolution?

    Hi Mr. Taylor,
    I made changes of USBDemo picbasic code according your advice and after compilation I obtain error messages:

    Error[113 ] c:\pbp_prog\usbdemo.asm 61 : Symbol not previously defined (ADRead)
    Error[113 ] c:\pbp_prog\usbdemo.asm 62 : Symbol not previously defined (ADRead)

    I do not know why is happen?

    Thanks,
    Kuba230

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Oops, I should have compiled it first.

    Try these 2 lines instead...
    Code:
        DATATOSEND[ADCON0.2*2]=ADRESL
        DATATOSEND[ADCON0.2*2+1]=ADRESH
    <br>
    DT

  3. #3
    Join Date
    Apr 2008
    Posts
    25


    Did you find this post helpful? Yes | No

    Default Two 10 Bits channels in USBDemo

    Hi Mr. Taylor,
    I did those changes to display 10 Bits value in Visual Basic program for USBDemo, it works perfectly, but only for one channel, AN0. What I have to change in picbasic USBDemo program to obtain two 10 Bits channels, AN0 and AN1?

    ;incomming ADC reading and PORTA status
    ----------------------------------------

    ;pAN0.Value = BufferIn(1) ' Display ADC results to the progress bars
    pAN0.Value = Val(BufferIn(1)) + Val(BufferIn(2)) * 256 'Display ADC for AN0
    ;pAN1.Value = BufferIn(2) ' Display ADC results to the progress bars

    '
    ;lValAN0.Text = Val(BufferIn(1)) ' Display Progress bars Values
    lValAN0.Text = Val(BufferIn(1)) + (Val(BufferIn(2)) * 256 'Display ADC for AN0
    ;lValAN1.Text = Val(BufferIn(2)) ' Display Progress bars Values

    Note:
    Also is necessary to change maximal value of progressbar properties pAN0 from 255 to 1023

    Thanks
    Kuba230

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    lValAN1.Text = Val(BufferIn(3)) + (Val(BufferIn(4)) * 256 'Display ADC for AN1
    DT

  5. #5
    Join Date
    Apr 2008
    Posts
    25


    Did you find this post helpful? Yes | No

    Default Two 10 Bits channels in USBDemo

    Hi Mr. Taylor,
    Everything is working very well.
    Thank you very much for your help.

    Kuba230

Similar Threads

  1. How do I use 10 bit A/D on 8 bit Pic? 12F675
    By polymer52 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 1st April 2020, 20:10
  2. MCP3208 12 bit A/D driver
    By polymer52 in forum Code Examples
    Replies: 0
    Last Post: - 5th February 2010, 11:59
  3. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  4. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 18:57
  5. Need help with 16f819 10 bit ADC
    By bannrikae in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 26th September 2005, 15:20

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