On any IDE port and its cable there can be one or two devices connected. There always MUST be a Master device with its jumpers set that way, whether or not a second device is on the cable. The Master should be plugged into the END connector on the cable. IF you have a second device, set its jumpers to Slave and plug it into the middle.
If you are using a combination of a hard drive and an optical drive sharing a port and cable, it is better to set the hard drive as Master, and optical as Slave.
Make sure the ribbon data cable you use has 80 wires in it. The original IDE cables had 40 wires. The newer ones still have only 40 actual connection holes on the connectors, but the cable itself has 80 wires in it. Count across the ribbon. If you get to 20 and you're still only ¼ of the way across, you're OK.