Hello, dear colleagues! This is the first my post on avrfreaks forum.
I'm struggling with one frustrating problem - unpredictable restarts of my AVR chip. Here is the full story.
I'm designing temperature control system so I decided to use DS18B20 thermal sensor to control ambient temperature. Also I'm using HD44780 LCD and lcd_library by Peter Fleury to display some info. All electric connections (except high-voltage power supply module, see schematics) are made on bread board.
I wrote small library for DS18B20 1-Wire protocol and successfully employed it. All things were looking great - temperature readings is fine, CRC verification is OK and LCD worked perfectly, no restarts observed unless I attached three buttons to my ATtiny2313A.
I've made software debouncing of my buttons via non-blocking timer interrupts. For the first time I've programmed only one button (BTN_SET on schematics) while two other buttons just were on my breadboard and connected to the AVR chip. I must say that software part is working great - AVR properly reads signals from button and increases counter and displays actual info on my LCD screen. But sometimes reset occurs. I've tried to catch the cause of this unpredictable resets - I clicked the button very fast, very slow, hard ot soft - nothing matters. Sometimes reset occurred when I only touched but not pressed the button. In some moments of time reset event occurred when I touched my breadboard or nearby tripod when some of the high voltage lines hangs. Also reset (or another glitch) occurs when I power on hair dryer (about 2 kW) which is connected to the same power socket as my power supply, but when I select 1 kW mode no reset occurs. Also powering of 1.5 kW iron doesn't cause reset.
I decided to test my system by lefting it untouchable during the night time - for the first test no reset was observed while the second night test showed that some glitches are possible (lcd shows incorrect symbols or prints in incorrect positions).
So I completely stuck on these problem. I suppose that static discharge can cause these glitches but I may be wrong.
Schematics and full source code are attached here. All possible help is greatly appreciated!