18F4520 A/D working weird


Closed Thread
Results 1 to 18 of 18

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    depending wich configuration you have play with... did you use a simple buffer circuit (inverted input => to the output)?

    what is the actual frequency of this signal???

    Personnaly, for that kind of signal, i'll prefer to use multiple external or internal voltage comparators instead. Faster than a/d IMO
    Last edited by mister_e; - 7th April 2005 at 06:01.
    Steve

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

  2. #2
    Warrier's Avatar
    Warrier Guest


    Did you find this post helpful? Yes | No

    Default A/D on 18F4520

    Well, may be I am all wrong but here is what I see as some fundamental problems!

    The Kodak chip is outputting video signal at a typical frequency of 4MHZ and this is before any anti-aliasing filter which means high edge transitions from the CCD.

    Even at 20MHz, A/D acquisition time is about 2.4usec - refer to data on page 230-231. This is defined by the internal S/H cap =20pF and the sampling switch impedance. You haven't given the settings for ADCON2?

    You are trying to use LF411 or LM741 - these op amps CANNOT handle the signal bandwidth as they will slew rate limit the signal with heavy distortion. But this is academic as you cannot sample the input signal adequately (remember Nyquist) with a Tacq=2usec and even with a minimum Tad =2.

    So unless your read out clock is slowed down so that CCD analog output is limited to around 400kHz, I think you are out of luck with the PIC. They don't have video bandwidth ADC.

    As Ralph and Steve are trying to figure out from your posting, there is really no info on signal amplitude and shape! Oscilloscope can obviously show these waveforms as it has adequate input bandwidth. Hence my discouraging input..... Anyway, please read datasheet Section 19 and you will get a better idea of how the ADC is configured.

    -warrier

  3. #3
    Warrier's Avatar
    Warrier Guest


    Did you find this post helpful? Yes | No

    Default ADC acting up...

    Oh, I forgot to mention another point. LF411 or LM741 CANNOT be used with single rail supply unless you bias the input up half way and ac couple the input....Then you are going to lose dynamic range (video signal is referenced to zero so you need balck level clamping).

    If you are using the 741/411 with 0-5volt supply then your output will be "stuck" high or low depending on input and no signal will be seen at the output of the buffer!

    - warrier

  4. #4
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    First of all about the frequency, this CCD is being run very slow... approximately 3.6kHz and as such, the frequency of the vout signal is also 3.6khz.

    I will definitely take a look at the adcon 2 register to see if maybe that will fix the problem.

    We were using a simple buffer with a negative feedback loop and powered with positive 18V and negative 18V.

    I also read in the manual that the maximum input impedance for an analog signal is 2.5kohms. Does anyone know what the minimum or recommended impedance is>?

    Thanks for everyone's help. Hopefully I can figure out a way to get the PIC to work with this setup.
    Last edited by TurboLS; - 7th April 2005 at 15:35.

  5. #5
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    Well, I slope coupled the input with a 1200pF cap and a 10k resistor and if go directly from that into a non-inverting x10 opamp circuit and then to the PIC, I can actually see a signal. As of yet, all I can get is noise on the A/D tho, so it may just be that I have to change the point at which I do the A/D operation in the software. I will be trying a combination of circuits with the slope coupler, amplifier, buffer, and sampling opamp circuitry.

    Also, since I am running the chip so slow, I don't think the slew rate nor the ADCON2 register would be a problem.

  6. #6
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    also, do i expressly need the following line in my code?

    ADCON0.0 = 1 ' enable a/d

    Cuz I can do A/D without it, but I was just wondering if it might have been a config error. thanks.

  7. #7
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default Best way to measure input impedance on a PIC?

    I am pretty sure I just measure the impedance in parallel, but how do I do that (on the PORTA.0 A/D channel) with the PIC? thanks.

Similar Threads

  1. 12f675 A/d Miseries
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 16th December 2008, 02:16
  2. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 14:39
  3. Need advice on A/D
    By james in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th August 2007, 19:30
  4. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 18:57
  5. Replies: 2
    Last Post: - 13th September 2005, 18:23

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