Re: DAQ Circuit Diagram for Matlab



Roy,

I'm about to pop off to bed, but I did manage to find one more website
basically doing the same thing (even the same chips!):
http://www.daqchina.net/daqchina/circuit/rs812.htm

They have schematics and all the other stuff. It doesn't seem as though
they are using the counter concept you're suggesting. I'll look over
things a bit more carefully tomorrow, but I'd imagine that since all
this sampling must be performed over a serial port, you'll be
bandwidth-limited there. The DAQ must therefore have one of two
features: a large data buffer or be limited to whatever baud rate the
serial port uses. I'm guessing that you're opting for the latter
option.

The link demonstrates how to simply connect the MAX232 with the TLC548
up to a standard 9-pin serial connector (I think). The software they
wrote utilizes only four pins: DTR, RTS, CD, and GND. In this
particular configuration, the baud rate does not matter. The catch is
that you have to write some software to basically manually produce the
clock and chip select signals (which I'm not sure if it can be done
inside of MATLAB).

Another (more robust) method is to use a UART chip, like:
http://focus.ti.com/lit/ds/symlink/tl16c450.pdf

It will take advantage of the various possible baud rates, ultimately
allowing you to sample faster than if you wrote the customized software
on the PC side. There are two issues to using this chip:
1) You need a parallel, not a serial, ADC chip.
2) Be careful about setting the baud rate too high, as it may go faster
than the maximum conversion time of the ADC.

The real issue that you're going to run into with your current design
is that the PC uses an asynchronous serial channel, meaning that clock
is not transmitted via RS232. When you try to read binary data using
MATLAB from the serial port, it is not clear how you will be able to
synchronize with the PC's expected sampling clock (that is, the PC will
sample the receive line
at some frequency W, while your circuit will be transmitting at some
other frequency Y, where W and Y are not necessarily the same).

I would recommend using the UART approach. While it is more
complicated, it should be more versatile and ultimately provide faster
baud rates and simpler software (you'll probably be able to just
execute fread() to read the sampled values directly in MATLAB). I have
not read the UART datasheet in depth, so you may still need to use the
MAX232 somewhere in the design as a level converter.

As far as reading the signals that the device is sending to the PC, I
would recommend building something called a breakout box. It simply has
one LED for each pin input. If the pin is high (i.e. a '1'), then the
LED lights up. If the pin is low (i.e. a '0'), then the LED turns off.
Put eight LED's in a row for a parallel ADC or a single LED for a
serial ADC and you will have a breakout box.

Best regards,
Fort

(and if you wish, we can communicate more rapidly via email ... I'm an
electrical engineer, so I hope that we'll be able to figure this
problem out)

Roy wrote:
Hi Fort,

Thanks for your prompt reply, I really appreciate it.

Yes! What you say is true. I may need a MAX232 IC. I got the IC
recently, but I don't think it will solve my problem just yet.
I'm really bad with circuitry, please have patient with me.
The way I'm making this DAQ circuit may sounds weird, hopefully you
can understand.

The TLC548 ADC chip needs a pulse train for the i/o clock.
I'm using a 555 timer circuit to create the pulse train.

The ADC chip also need signal to trigger the chip select pin to
create a conversion time for the bits.
I'm using two DM7473 ic (JK flip flop) counter to do that. After the
counter counts 8 (0~7), it triggers CS pin and the pulse train will
cut off and carry on later.(I'm using only 3 JK Flip Flop out of 4)

I should be expecting 8 cycles but when I used an ocsilloscope to
check on the signal, it only appear 7 cycles. (I'm really desperate,
not sure why?)

Another thing, I'm also not familar with how much baudrate to use in
order for the serial port to get the correct signal. Also is there
anyway I can see the signal being sent to the PC?

Please advise.

Thank you.

Roy

.



Relevant Pages

  • Re: Real Time Embedded Systems Monitor in Python?
    ... it involves setting up a real time monitor / signal injector in ... sends signals to the CPU board. ... application monitor would use a COM port to send and receive ... So that you have to handle an upstream and downstream serial port? ...
    (comp.lang.python)
  • Re: [opensuse] Time stability
    ... The reason for the serial port is that there is a pulse-per-second ... signal that tells when certain calculations in the receiver were done. ... gpsd appears to know about PPS signals. ... The GPS will give bad/old/misc times when there are no receivers. ...
    (SuSE)
  • Re: which one among the available FPGAs is best for a fresher?
    ... I believe US next day carriage will drop to ... a bigger chip that the standard starter kit has. ... the serial port but I've never bothered -- I suspect it's ...
    (comp.arch.fpga)
  • Re: Converting Signal from Polar Heart Rate Monitor
    ... I'm trying to design a circuit to input a signal from a Polar heart ... convert the result to an appropriate ASCII and send it to the serial port. ... converters with charge pumps put jitter on the pulse. ... presense of signals on the handshake lines. ...
    (sci.electronics.design)
  • Re: Using a mac classic 1 to send a signal through a cable
    ... through either of the possible cables that connect to it. ... appletalk, a serial cable, printer port, etc. ... The printer serial port and the modem serial port are essentially the ... system, get the address of the chip, and directly write to the registers ...
    (comp.sys.mac.programmer.help)