Hello,
Depending on your switching speed requirement, there may be simpler methods of achieving CMOS to CMOS interface.
For 3.3 volt output to 5 volt input, a series diode can be fitted between the two pins, with output to cathode. This is in conjunction with enabling the input pullup, or possibly using a lower value external pullup resistor, for greater speed. The diode would remain conducting during both low and high logic states, and would increase both low and high logic levels by about 0.7 volts. So 0 -> 3.3 volts at the CMOS output would translate to 0.7 -> 4.0 volts at the input pin, which should provide satisfactory switching for a Vdd of 5 volts.
For 5 volt output to 3.3 volts input, exactly the same series diode method could be used. In this case, the diode would conduct only during the logic low state. Here, the diode will prevent a voltage in excess of 3.3 volts reaching the input pin. Another method would be the use of a simple resistive voltage divider (with input pullup disabled), to reduce the voltage swing.
With the series diode method, the speed limitation is because the input pin is not actively driven to the high state when the diode is non-conducting, and the transition period will depend on the RC time constant caused by the pin input capacitance and the pullup resistor. Should a substantially faster transition be needed, the provision of an actively driven input would then require the use of a separate buffer device. A buffer from the 74HCT CMOS family (with 5 volt Vdd}, can provide inputs that are compatible with a 3.3 volt output swing.
However, before including additional interface circuitry, check to see whether the input to a 5 volt peripheral is directly compatible with a 3.3 volt MCU output. For example, this is true of some LCD displays.
For a "true" TTL output connected to an input of a 5 volt MCU, use an additional 4k7 pullup resistor. This should raise the TTL output voltage to a sufficient degree. With a 3.3 volt MCU, the TTL levels should be compatible.
Regards,
Mac