//pokus cteni I2C
	twi_start();
	twi_address_w(ADRESA_RTC);
	twi_write(0x00);//nadresovani minut
	twi_start();
	twi_address_read(ADRESA_RTC);
	minutka=twi_readNACK();
	//minutka2=twi_read();
	twi_stop();
	
	//*****************************************************************
	sprintf(buffer, "min %X",minutka);
	lcd_firstline();
	lcd_puts(buffer);//vypis na lcd
	
	twi_start();
	twi_address_w(ADRESA_RTC);
	twi_write(0x01);//nadresovani minut
	twi_start();
	twi_address_read(ADRESA_RTC);
	//minutka=twi_read();
	minutka2=twi_readNACK();
	twi_stop();
	
	sprintf(buffer, "min2 %X",minutka2);
	lcd_secondline();
	lcd_puts(buffer);//vypis na lcd
	
	lcd_firstline();
	lcd_puts("0");
	
	twi_start();
	lcd_puts("0a");
	twi_address_w(ADRESA_RTC);
	lcd_puts("0b");
	twi_write(0x00);//nadresovani minut
	lcd_puts("0c");
	twi_start();
	lcd_puts("0d");
	twi_address_read(ADRESA_RTC);
	lcd_puts("0e");
	minutka=twi_readNACK();
	lcd_puts("0f");
	twi_stop();
	
	minutka |= 0b10000000;
	
	lcd_puts("1");
	
	twi_start();
	twi_address_w(ADRESA_RTC);
	twi_write(0x00);//nadresovani minut
	twi_write(minutka);
	twi_stop();
	
	lcd_puts("2");
	
	twi_start();
	twi_address_w(ADRESA_RTC);
	twi_write(0x00);//nadresovani minut
	twi_start();
	twi_address_read(ADRESA_RTC);
	minutka=twi_readNACK();
	twi_stop();
	
	lcd_puts("3");
	
	sprintf(buffer, "upr %X",minutka);
	lcd_secondline();
	lcd_puts(buffer);//vypis na lcd
	
	while(1);
	//*****************************************************************