I've have already used Arduino as ISP Programmer to load codes to Atmel chips like ATmega328p and ATmega8 quite a few times without any problem.
On my last project though, I decided to use an Atmel ATtiny1634 microcontroller with QFN package instead of the bigger chips I used before. The soldering was ok, and the board has an ICSP header (MOSI, MISO,...) for the connection with the Arduino to program the chip.
I loaded the ISP Programmer sketch into the Arduino and connected it to the board. I use avrdude in Cmd Prompt for setting fuses and loading the code, so I wrote the following line to check if the communication was ok:
The device signature was correctly readed and so were its fuses. According to the datasheet information, I had to change lfuse to 0xFF because I am using External Crystal Oscillator >8MHz, so I wrote the next line for changing the lfuse:
Apparently the lfuse change was successful because at the end it reads "Fuses OK (E:FF, H:DF, L:FF), as it should. Then I wrote the same line I did at first to check if everything went ok, but that's what I got:
The programmer (Arduino) simply cannot read the chip anymore, as it gets 0x000000 invalid signature.
I wonder if there is any issue with the lfuse I sent to the device (0xFF) and also if there is any way to maybe reset the chip or reestablish connection to find out what happened.
The circuit of the microcontroller is down bellow, with the ICSP header, Crystal Oscillator, Power and the other I/O connections of the project:
Thanks in advance for any help!
As @Kevin White corrected, I expressed myself badly when I said External Crystal Oscillator. I saw on the datasheet it has the option of External Clock Source and Crystal Oscillator or Ceramic Resonator.
According to the CKSEL and the lfuse tables, the proper fuse value for Crystal Oscillator >8MHz is 0xFF:
Is that right or am I misinterpreting those tables?
Yes, I was misinterpreting those tables. Beyond the table about the clock frequency range, there is another table that relates the CKSEL bits with the SUT bit of lfuse. By setting lfuse to 0xFF I was selecting SUT=1, which sets the external ceramic oscillator, and not the external crystal. The correct lfuse value for my situation is 0xED. I'm stating to get familiar with the datasheet and its "hidden" information.