bcd TTL to RS232

Discussion in 'The Projects Forum' started by purejoker, Feb 15, 2009.

  1. purejoker

    Thread Starter New Member

    Feb 15, 2009
    3
    0
    hi there, im new to these forums, so hello everyone!

    i wannted to ask if it was possible to connect a bcd output to a rs232, so that i would be able to read the data on the computer instead of a 7 segment display?

    the bcd output's via ttl and the rs232 accepts ttl signals so would this work, or i still require a microprocessor?

    thanks for your help

    purjoker!
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    There is a difference between a value and an encoding of it for use in documents. A BCD value that gets displayed will be one thing, that number sent as data will be encoded as ASCII. If you look at the data sheet for a MAX232 IC, you'll see what the encoding is necessary, and what else might be necessary to transmit the value serially.
     
  3. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    If you just want to transmit BCD data then you will need a UART to convert the data into a serial stream and as beenthere suggests a MAX232, which despite what its name implies is a charge pump level converter that converts TTL levels to +/-12volt required by the RS232 standard.

    If however you want to display the BCD data as ASCII characters on your computer you will need to have some intelligence somewhere in the system. You can either write a program in the PC to convert BCD data to ASCII for display on the screen or use a microcontroller at the send end to do the conversion. The advantage of a microcontroller is that it has a built-in UART and if you are transmitting ASCII data you can display the results using a simple terminal program such as Hyper Terminal.
     
  4. purejoker

    Thread Starter New Member

    Feb 15, 2009
    3
    0
    would the diagram attached work? and can someone please guide me on how to program the pic?

    thanks
    purejoker!
     
    • dia.jpg
      dia.jpg
      File size:
      131.3 KB
      Views:
      46
  5. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    If you are using a PIC you don't need the BCD-7seg display IC. Just feed the BCD straight into the PIC, use software to convert it to ASCII for transmission.

    I would not use the PIC16F84 as its a very basic chip and does not have an on-board USART so you would have to bit-bash the USART function in software, instead go for something like the PIC16F628A or PIC16F87 or for that matter any chip that has a USART.

    I don't know how familiar you are with PIC microcontrollers but there is plenty of info in the WEB, google is your best friend there. Also the Microchip site has all the data sheets, applications notes and software examples.
     
Loading...