The whole microcontroller circuit has a problem?

Discussion in 'Embedded Systems and Microcontrollers' started by mik3ca, Aug 25, 2009.

  1. mik3ca

    Thread Starter Active Member

    Feb 11, 2007
    189
    0
    The attachment is a circuit that I made. Basically, it is an attempt for me to program the microcontroller directly from the computer's parallel port. The mode select chip works fine, and i was able to control the LED, but what I tried to do that constantly fails is read the data from the microcontroller through the 4051 cmos multiplexer (at the top right). the bit selection is made using the low 3 bits of the parallel port Pins 6, 7, and 8 of the multiplexer are grounded, and the output pin of the multiplexer is connected to the parallel port.

    Here's the problem. Whether I put the chip in or not, when the parallel cable (about 3 feet long) is connected between the computer and the circuit and the circuit is powered on, the output pin (of the 4051 mux) provides a logic low in software. When I unplug the parallel port, the output pin provides a logic high in software. When I manually check the output pin, it seems that it is always at a logic high in every bit combination

    I checked the circuit board and the connections seemed to be normal.

    Do I need to do something special to the 4051 multiplexer to get it to work properly?

    The inputs that are being fed to it seem to be normal.
     
  2. kkazem

    Active Member

    Jul 23, 2009
    160
    26
    Hi mik3ca,

    The problem, from what you've presented, is likely a level mismatch between the logic family of your circuit (CMOS) and the logic family of the PC Parallel Port (TTL). For TTL, a logic low is anything between 0V & 0.8V and a logic high is anything between 2.5V & 5V. CMOS logic, on the other hand, uses a percentage of the supply voltage such that a logic low is anything between about 0V (VSS) to 1/3rd VDD, and a logic high is anything between 2/3rds VDD and VDD. It seemed from your schematic that your CMOS logic was using a 12V VDD and if so, even if the TTL output of the PC port was at the maximum TTL level of 5V, that is still 2V lower than the minimum level for CMOS with a 12V VDD, which would be 7V minimum for a high and 4V or less for a low. So if the TTL output of the parallel port is 3.5V (a perfectly valid TTL high level), it is a logic low for CMOS with a 12V VDD. Therefore, you either need to use a level translator, or a TTL to CMOS converter chip or change all your uController logic from CMOS to TTL. However, even if you did that, your controller chip may or may not operate properly with a 5V supply and even if it does, it may or may not output TTL levels. Therefore, a TTL to CMOS converter or level translator is needed between the output of the 4051 and wherever that 4051 output connect to. In this way, you only need 1 converter. If you put converters between the PC's Parallel port and the 4051, you'll need up to 8 of them. The reason that this will work is due to the way the 4051 is made. it's actually an analog switch, so the TTL levels of the Parallel Port will pass thru the 4051 approximately as-is since they are simply switched like thru a relay (in actuality, there will be a very small IR drop due to the on-resistance of the internal switching MOSFETs).

    I'm sorry I can't help you more than that for now, but your schematic is quite poorly done and largely unreadable. The IC's are mostly not labelled with their part numbers and most pin numbers are unreadable. Try saving it with a much greater pixel/inch count. For example, if you used 72 pixel/inch, try 300 instead and then the graphic should be more readable. It's not a question of zooming, since when I zoom-in, it just gets more and more fuzzy. If you need more help, please clean-up your schematic, show the VDD and/or VCC supply voltages. Make sure all IC's have a clearly readable part number and that all pin numbers are also readable. Try to redraw the schematic so that there is a signal flow from left to right or vice versa instead of showing individual IC's with only signal names going to pins. That makes it very hard to follow and to troubleshoot.

    Regards and good luck,
    Kamran Kazem,
    kkazem
     
Loading...