In general, there is no need to have any current limiting for integrated digital circuits unless it's explicitly stated that it's needed in the datasheet. The IC will only take as much current as it needs from the voltage source, if the voltage is within its operational parameters. There is no need to worry too much about that! Whole situation is nicely explained in this question.
Next, when you're trying to connect the 74HC00 (or whatever you have, it's mostly the same for digital input), the input pin of the microcontroller will be in high impedance state. It will not act as a short circuit to ground and very little current will flow. Most microcontrollers start with their port pins in high impedance state and need to be configured as outputs before being able to source of sink current.
So in normal operation there is no need to have any current limiting at all.
This leaves us with abnormal operation. It can happen due to malfunction of an IC or due to your own carelessness. For example if you have a pin of 74HC00 connected to a pin of the microcontroller, configure that pin as output and set it to low, it will start draining current from the 74HC00 and that can be a dangerous situation. For that reason, I agree with MiljanNC and believe that you should place resistors in series with the lines.
Next, we have the actual value of the resistor. Truth is that 74HC00 can't source much current and that on the other hand ATmega can't really sink that much current. If you want in-depth analyses, you can look up pin schematics in their datasheets and see why. If you absolutely want to be 100% safe, you can imagine the source pin to be an ideal voltage generator and the sink pin to be ideal round and then calculate resistor size using Ohm's law, but in my opinion that would be too conservative value.
Also do pay attention to what datasheets say! The value of 40 mA per pin and 200 mA in total is absolute maximum rating, that is to say the value at which you can expect the chip to malfunction. For normal operation, I would make sure that current isn't above the tested value of 20 mA.
1
. I want to connect pins of the microcontroller to the 74HC00 series circuit as inputs and outputs to the circuit. So if the circuit would a single 74HC00, I want to set the inputs A and B from two pins of the microcontroller and read Y on another pin of the microcontroller. \$\endgroup\$