A/D converter fails?


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You can use all the pause statements you want inside a BASIC interrupt, however, I don't recommend you place gosubs in your interrupt handler.

    This exits the interrupt handler, and if it lands in a sub routine where you are not disabling PBP's auto-insertion of interrupt checking stubs, then it's going to go totally nuts on you.

    Place all of your routines inside the interrupt handler, or set/clear some type of flags to indicate the interrupt source, then return, then act on the other sub routines as needed.

    Also note that RCIF can NOT be cleared with RCIF = 0. The only way to clear RCIF is to read the fifo USART buffer until it's empty. Trying to clear this flag like you are, you're leaving it set, and never clearing the USART interrupt flag bit.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    egberttheone's Avatar
    egberttheone Guest


    Did you find this post helpful? Yes | No

    Default

    ah! the gosubs seems to be the problem ! but now I have the problem that the a/d conversion some times fluctuates(value's are not the same every querying + 1000 some times). Where can I begin to debug? Thx !

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


    Did you find this post helpful? Yes | No

    Default

    A/D readings will pretty much always fluctuate. A small RC filter on each A/D input may help. If not, you might consider putting the PIC to sleep prior to A/D readings to reduce in-circuit noise from the oscillator & internal switching.

    If you think "code" may be causing the fluctuations, then simply strip down the program to nothing but reading & displaying A/D values. If it works smoothly, then take a hard look at the rest of your code.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Replies: 9
    Last Post: - 31st July 2008, 09:56
  2. A/D converter sample
    By allan josephus in forum mel PIC BASIC
    Replies: 5
    Last Post: - 23rd February 2008, 20:44
  3. A/D converter with pic16f84, i need a help
    By micro in forum General
    Replies: 0
    Last Post: - 13th December 2005, 22:17
  4. help with pic16f870 a/d converter
    By cammo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 22nd March 2005, 06:16
  5. Re Cs5532 A/d Converter
    By massquip in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th April 2004, 17:31

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