Electronic – Question about 1-bit Analog-to-Digital Converter

adccomparatorttl

I am working on a research project, and for a part of it I have to turn an analog signal into a digital one. Now, electronics is not my forte so I don't know what I am doing and am feeling around in the dark. I have been doing research all of yesterday and today to answer the specific way that I want to do this conversion and I think I have an answer, but I don't know what is best for my project.

Device 1 outputs an analog signal. This analog signal will stay at voltage low until it pulses for some time t to high. Then it will return to voltage low. This analog signal will always be either at voltage low or high.

Device 2 wants to read this signal. However, it can only receive signals with a UART protocol at its internal baud rate. The way that Device 2 will understand this signal is by having some Interpreter to parse the information for it at regular intervals into bits b0 and b1 representing "high at this moment" and "low at this moment".

Interpreter is what I want. Interpreter should check the voltage outputted by Device 1 once every 100 nanoseconds (ideally once every 2 nanoseconds). If the voltage is high then Interpreter should record a signal b1. If the voltage is low then Interpreter should records a signal b0. It should send these bits to Device 2 packaged in a UART protocol so that Device 2 can interpret the bits. Device 2 will have software to process the bits from there.

I don't know what device to use for Interpreter. I know that anything that I code would be too slow, so I was hoping to use some device that could do it faster. At first, I was trying to find a low-bit ADC with a high speed in the >500 MSPS range, but I think that a comparator would work as well. However, despite my research I haven't been able to settle on a product because I don't know what part would work best for my system. The only fast ADCs are expensive and I don't know if a comparator is fast enough for me or will output with a UART protocol. Or, I don't know if there is a part that I could purchase that does the job better than either of them. So if anyone has any good suggestions I will do research on them.

Thank you.

EDIT: Didn't know that TTL wasn't a protocol, and I realized that I wanted a UART protocol. Replaced TTL with UART in the post.

EDIT: If I have a sampling rate of 10MHz it will be sufficient, but a sampling rate of 500MHz is desired if it is affordable.

EDIT: If you vote my question down, please let me know why you did. I am learning and I want constructive feedback.

EDIT: Rewrote the post for clarity and included images below to clarify what I am asking.

enter image description here

enter image description here

  1. Line 1 above shows an example of what could be outputted by Device 1. Notice that the pulses come at random times but are all of length t (as best as I could draw)
  2. Line 2 above shows what the Interpreter may do before packaging start and stop bits. Notice that every voltage lines up with the blue lines. I use the blue lines to show the intervals.
  3. Line 3 above shows what the Interpreter should output to Device 2 after including start/stop bits.

Best Answer

I think I might understand what you're trying to do. You want to:

  1. Sample a pulse train at regular (fast) intervals that has two possible values, and they don't really correspond to any standard voltages for "normal" digital inputs.
  2. Report this data to another system.

If that's correct, here's my suggested circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

and my suggested theory of operation:

  1. Understand #2 of this list and setup the chip to do it with minimal instruction count and maximal instruction rate. (you might need to use assembly on a high-spec chip, which is not often done)
  2. Set up a timer interrupt in software to fire at your desired sample rate. When the interrupt fires:
    1. Shift a byte variable up (left) by 1.
    2. Read the Digital Input into the low bit of that variable. (empty because of #1)
    3. Decrement a counter variable.
    4. If the counter is now zero, move the byte (accumulator) variable into the UART Send register (whatever your chip calls it) and set the counter back to 8. The UART will send the byte all by itself while you capture the next 8 samples.

Some notes:

  • Some chips have the comparator built-in. (the triangle thingy by itself) This can reduce the parts count if it's fast enough. Either way, read the datasheet for the comparator that you intend to use.
  • The pulse in must be within the comparator's power supply. I showed 5V here because it's fairly common, but it could be anything allowed by the datasheet.
  • The comparator's output will use the entire supply available to it, unless it's an open-collector type (force-low, allow-high), in which case you can add a resistor between Out and your digital supply.
  • The UART will probably require 10 bits per byte of data - 1 Start, 8 Data, 1 Stop - so its baud rate will actually be faster than your sample rate. Make sure that works on both ends.
  • If the baud rate can't be that fast, you might look at some form of data compression. Perhaps send a report only on each event (not continuously) and include the time since the previous event? That would require a completely different theory of operation, and probably be much easier to implement also.