It works now right. 1MOm resistor on vbat rtc pin helps me. Also was strange trouble with switch case in setVal procedure, I change it with If operators.