simple adc interface to rs232

Discussion in 'General Electronics Chat' started by markotitel, Jun 12, 2010.

  1. markotitel

    Thread Starter New Member

    Jun 12, 2010
    6
    0
    Hello, this is my first post here.

    i found this very simple circuit for analogue data logging on PC.

    http://www.tmworld.com/article/talkback/325653-Test_Ideas_Serial_port_controls_ADC.php#74496

    Im not so good in programing and electronics, can someone help me in understanding the code for reading data from mcp3201.

    Do I have to tell mcp to send me data, or will it continously send it to max232 and to RS232 after?

    I cannot get any data on screen but value which is the same wheter circuit is attached or not to com port.

    Im trying to build simple voltmeter, but without utilisng micro controlers, PIC or other circuits.

    Is it even possibile with this setup?
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
  3. markotitel

    Thread Starter New Member

    Jun 12, 2010
    6
    0
    Hm but in the text there is schematic with mcp3201 and max232 so these two can work with rs232 acording to document I left a link.
     
  4. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    beenthere is right about the interface of the MCP3201, which is SPI.

    The original author of the above design idea use the other signal lines of the RS232 port to mimic the timing and function of a SPI interface. You can see that the regular RX and TX connections is not used but the DTR, RTS and CTS used instead.

    The datasheet MCP3201 is available from the chip manufacturer Microchip and I suggest you download it and have a look. It contains very detailed explanation of what to do in order to obtain the converted data from its pins.

    The author has also provided the C# source code for the HOST PC interface and you need to compile it into an EXE program in order to be used.
     
  5. markotitel

    Thread Starter New Member

    Jun 12, 2010
    6
    0
    Ok thank you, I have datasheet, but I dont have knowledge to understand it very well.

    Can you advice me how can I make something similar but without PIC circuits just plain A/D and max232 ?
     
  6. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    I don't understand why you have to ask this question.

    You can get the ADC conversion result into your PC via the serial port using just the A/D chip and Max232 chip. Of course you have to run a program on the PC end in order to get the data.

    As I have replied in the above post, the author has provided the required source code on that same webpage and all you will need is to do is to compile it into an EXE program to run on your PC.

    Tell us which part of the process you are having difficulty with or do not understand?
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    They use a bit-banging approach. So it will work. But not a optional solution if you ask me. It will be a lot of jitter in the sample interval. Depending and what you want to do, and your signal type/source. Have you considered using your sound card?
    http://en.wikipedia.org/wiki/Bit-banging
     
  8. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    I would suggest going with a true RS232 interface. And if your real ambitious or you have high timing requirements, then consider USB or ethernet.

    You might also want to investigate some of the industry standards in data aquisition. This would help dramatically on the controlling software end of things.

    A very simple and widely supported protocol is Modbus. This is a master / slave arrangement where the master polls an addressable slave with a command word. The slave resolves the command and returns data.
     
  9. markotitel

    Thread Starter New Member

    Jun 12, 2010
    6
    0
    thank you for your help everyone, I dont need fast system, once in a 5 minute interval is fine. or once i a minute. So I thought I make it as simple as it cen be made.
     
  10. markotitel

    Thread Starter New Member

    Jun 12, 2010
    6
    0
    Hello again,

    I ordered same part mcp3201 and made circuit like on the web site, Link is at the first post.

    I compiled c# code, but problem is that I always get the same result. 4.99..... no matter what.

    Only difference is I compile the code in linux with MONO. Can you give me a clue?
     
  11. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    Disconnect your device, short your CTS line to grnd (pins 8 -5) on the serial cable to simulate a data set of 0x00. Your program should now return a 0.00
     
  12. markotitel

    Thread Starter New Member

    Jun 12, 2010
    6
    0
    Now I took brothers PC with Windows XP, I compiled program and run it successfully, in windows I always have reading that is ZERO, as analog signal i use 80mVolts I think it should be enough to detect and read.
     
Loading...