external crystal to atmega32
What programmer are you using ? Ponyprog or Atmel ISP MKII ?
The device have some fuses that enables/disables Jtag. If you use the pin dedicated to Jtag, you should disable it programming fuses (that is setting it to 0 because the default state is unprogrammed). Some situation is for clock selection. See the device datasheet in order to see how configure fuses. Remember that when the device is blank all fuses are unprogrammed (set to 1), so if you should set as example 101, you should program only one fuse (the only one that should be at '0').
best regards