I bought new ATtiny2313. I put it on breadboard, conect all for bit-banging and all is working ok. First blinking program works well.
Then I tried to add crystal 16MHz and programmed lfuse to 0xEF. This disables CKDIV8, so I get really 16 MHz because I've changed C code too - #define F_CPU 16000000UL. All was ok.
The problem. Without crystal I sent program examples more times. All was okay. With crystal I sent program only one time. At second attepmpt avrdude tells me that signature isn't right. Now it is 0xffffff.
Then I used -F switch to ignore signature check. All is working okay. But when I program lfuse back to it's default value (0x64) and remove crystal, I send blinking program for 1 MHz. It is blinking twice in a second. Then I check calibration bytes. They are 0xff 0xff, but they must be 0x5b 0x5a. So it seems that mc is working at 2 MHz without calibration codes, isn't right?
So, how I can get back signature and calibration bytes?