From 81a79648a168a1167c5ad97d4068621c1751a353 Mon Sep 17 00:00:00 2001
From: Tobias <tm@tm3d.de>
Date: Wed, 7 Nov 2018 11:17:14 +0100
Subject: [PATCH] Many changes from 2018

---
 DS18B20_ADC/DS18B20_ADC.atsln                 |  22 +
 DS18B20_ADC/DS18B20_ADC.c                     | 201 +++++++
 DS18B20_ADC/DS18B20_ADC.cproj                 | 147 +++++
 DS18B20_BMP280/DS18B20_BMP280.c               |  40 +-
 .../DS18B20_BMP280_DS2438_SHT.cproj           |  37 +-
 DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c    | 147 ++---
 DS18B20_CDM7160/DS18B20_CDM7160.c             |  65 +--
 .../DS18B20_CDM7160_DS18B20_BMP280.atsln      |  22 +
 .../DS18B20_CDM7160_DS18B20_BMP280.cproj      | 171 ++++++
 .../DS18B20_DS18B20.c                         | 180 ++++++
 .../DS18B20_CDM7160_DS2438_HDC1080.atsln      |  22 +
 .../DS18B20_CDM7160_DS2438_HDC1080.c          | 249 ++++++++
 .../DS18B20_CDM7160_DS2438_HDC1080.cproj      | 175 ++++++
 DS18B20_DS2408/DS18B20_DS2408.atsln           |  22 +
 DS18B20_DS2408/DS18B20_DS2408.c               | 245 ++++++++
 DS18B20_DS2408/DS18B20_DS2408.cproj           | 183 ++++++
 DS18B20_LPS225HB_DS2438_SHT/DS18B20_DS2438.c  | 209 +++++++
 .../DS18B20_LPS225HB_DS2438_SHT.atsln         |  22 +
 .../DS18B20_LPS225HB_DS2438_SHT.cproj         | 175 ++++++
 DS18B20_MAX44009/DS18B20_MAX44009.c           |  49 +-
 DS18B20_MAX44009/DS18B20_MAX44009.cproj       |  92 +--
 DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c  | 165 ++----
 .../DS18B20_MAX44009_DS2438_SHT.cproj         |   8 +-
 DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_DS18B20.c | 168 ++++++
 .../DS18B20_SHT_DS18B20_SHT.atsln             |  22 +
 .../DS18B20_SHT_DS18B20_SHT.cproj             | 171 ++++++
 DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_DS18B20.c | 167 ++++++
 .../DS18B20_SHT_DS18B20_SHT.atsln             |  22 +
 .../DS18B20_SHT_DS18B20_SHT.cproj             | 171 ++++++
 DS18B20_Thermocouble/DS18B20_TC.cproj         | 146 ++---
 .../DS18B20_DS2438.c                          | 150 ++---
 .../DS18B20_Thermocouble_DS2438_SHT.atsln     |  44 +-
 .../DS18B20_Thermocouble_DS2438_SHT.cproj     |   8 +-
 .../DS18B20_DS2438.c                          | 100 +---
 .../DS18B20_VOC_DS2438_SHT.atsln              |  22 +
 .../DS18B20_VOC_DS2438_SHT.cproj              | 157 +++++
 DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c       |   2 +-
 DS2408/DS2408.atsln                           |  22 +
 DS2408/DS2408.c                               | 216 +++++++
 DS2408/DS2408.cproj                           | 183 ++++++
 DS2413_DS2413/DS2413_DS2413.atsln             |  22 +
 DS2413_DS2413/DS2413_DS2413.c                 | 209 +++++++
 DS2413_DS2413/DS2413_DS2413.cproj             | 145 +++++
 DS2423_DS2413/DS2423_DS2413.c                 |  35 +-
 DS2423_DS2423/DS2423_DS2423.c                 |  57 +-
 DS2438_ADC/DS2438_ADC.atsln                   |  22 +
 DS2438_ADC/DS2438_ADC.c                       | 191 ++++++
 DS2438_ADC/DS2438_ADC.cproj                   | 145 +++++
 .../DS2438_ADC_DS2438_ADC.atsln               |  22 +
 .../DS2438_ADC_DS2438_ADC.cproj               | 145 +++++
 DS2438_ADC_DS2438_ADC/DS2438_DS2438.c         | 241 ++++++++
 DS2438_CDM7160/DS2438_CDM7160.atsln           |  22 +
 DS2438_CDM7160/DS2438_CDM7160.c               | 180 ++++++
 DS2438_CDM7160/DS2438_CDM7160.cproj           | 149 +++++
 .../DS2438_CDM7160_DS2438_BMP280.atsln        |  22 +
 ...38_CDM7160_DS2438_BMP280.componentinfo.xml |   4 +
 DS2438_CDM7160_DS2438_BMP280/DS2438_DS2438.c  | 187 ++++++
 DS2438_DHT11/DS2438_DHT22.atsln               |  22 +
 DS2438_DHT11/DS2438_DHT22.c                   | 316 ++++++++++
 DS2438_DHT11/DS2438_DHT22.cproj               | 145 +++++
 DS2438_DHT22/DS2438_DHT22.cproj               |  18 +-
 .../DS2438_Fenster_Kontakt.atsln              |  22 +
 .../DS2438_Fenster_Kontakt.c                  | 208 +++++++
 .../DS2438_Fenster_Kontakt.cproj              | 144 +++++
 DS2438_Fenster_Kontakt/OWDS2438.S             | 196 +++++++
 DS2438_HDC1080/DS2438_HDC1080.atsln           |  44 +-
 DS2438_HDC2010/DS2438_HDC2010.atsln           |  22 +
 DS2438_HDC2010/DS2438_HDC2010.c               | 199 +++++++
 DS2438_HDC2010/DS2438_HDC2010.cproj           | 151 +++++
 .../DS2438_DS2438.c                           | 444 ++++++++++++++
 .../DS2438_MAX44009_VOC_DS2438_HDC.atsln      |  22 +
 .../DS2438_MAX44009_VOC_DS2438_HDC.cproj      | 170 ++++++
 .../DS2438_DS2438.c                           | 442 ++++++++++++++
 .../DS2438_MAX44009_VOC_DS2438_SHT.atsln      |  22 +
 .../DS2438_MAX44009_VOC_DS2438_SHT.cproj      | 163 ++++++
 .../DS2438_DS2438.c                           | 189 ++++++
 .../DS2438_SHT2X_DS2438_BMP280_MAX44009.atsln |  22 +
 .../DS2438_SHT2X_DS2438_BMP280_MAX44009.cproj | 163 ++++++
 DS2438_SHT2X_DS2438_LPS225HB/DS2438_DS2438.c  | 282 +++++++++
 .../DS2438_SHT2X_DS2438_LPS225HB.atsln        |  22 +
 .../DS2438_SHT2X_DS2438_LPS225HB.cproj        | 159 +++++
 DS2438_SHT3X/DS2438_SHT3X.c                   |   4 +-
 DS2438_SHT3X/DS2438_SHT3X.cproj               | 130 +++--
 DS2450/DS2450.c                               |  79 ++-
 DS2450/DS2450.cproj                           | 161 ++---
 DS2450/OWDS2450.S                             |  10 +-
 DS2450_ADC/DS2450.c                           | 305 ++++++++++
 DS2450_ADC/DS2450_ADC.atsln                   |  22 +
 DS2450_ADC/DS2450_ADC.cproj                   | 146 +++++
 DS2450_ADC/OWDS2450.S                         | 248 ++++++++
 DS2450_ADC_JOE2/DS2450.c                      | 305 ++++++++++
 DS2450_ADC_JOE2/DS2450_ADC.atsln              |  22 +
 DS2450_ADC_JOE2/DS2450_ADC_JOE2.cproj         | 146 +++++
 DS2450_ADC_JOE2/OWDS2450.S                    | 248 ++++++++
 DS2450_APDS9960/DS2450_APDS9960.atsln         |  44 +-
 DS2450_APDS9960/DS2450_APDS9960.cproj         | 302 +++++-----
 DS2450_APDS9960/OWDS2450.S                    | 248 ++++++++
 DS2450_BME680/DS2450_BME680.atsln             |  22 +
 DS2450_BME680/DS2450_BME680.c                 | 272 +++++++++
 DS2450_BME680/DS2450_BME680.cproj             | 154 +++++
 DS2450_BME680/OWDS2450.S                      | 248 ++++++++
 DS2450_BMP280/OWDS2450.S                      | 247 ++++++++
 DS2450_CDM7160/DS2450_CDM7160.atsln           |  22 +
 DS2450_CDM7160/DS2450_CDM7160.c               | 280 +++++++++
 DS2450_CDM7160/DS2450_CDM7160.cproj           | 145 +++++
 DS2450_CDM7160/OWDS2450.S                     | 247 ++++++++
 .../DS2450_CDM7160_BMP280.atsln               |  22 +
 DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.c | 272 +++++++++
 .../DS2450_CDM7160_BMP280.cproj               | 146 +++++
 DS2450_DSM501A/DS2450_DSM501A.atsln           |  22 +
 DS2450_DSM501A/DS2450_DSM501A.c               | 312 ++++++++++
 DS2450_DSM501A/DS2450_DSM501A.cproj           | 145 +++++
 DS2450_IAQCORE/DS2450_IAQCORE.atsln           |  44 +-
 DS2450_IAQCORE/DS2450_IAQCORE.c               |   2 +-
 DS2450_IAQCORE/DS2450_IAQCORE.cproj           | 276 ++++-----
 DS2450_LPS225HB/DS2450_LPS225HB.atsln         |  22 +
 DS2450_LPS225HB/DS2450_LPS225HB.c             | 292 ++++++++++
 DS2450_LPS225HB/DS2450_LPS225HB.cproj         | 142 +++++
 DS2450_LPS225HB/OWDS2450.S                    | 247 ++++++++
 DS2450_MAX44008/DS2450_MAX44008.atsln         |  22 +
 DS2450_MAX44008/DS2450_MAX44008.c             | 270 +++++++++
 DS2450_MAX44008/DS2450_MAX44008.cproj         | 135 +++++
 DS2450_MAX44008/OWDS2450.S                    | 248 ++++++++
 DS2450_SGP30/DS2450_SGP30.atsln               |  22 +
 DS2450_SGP30/DS2450_SGP30.c                   | 265 +++++++++
 DS2450_SGP30/DS2450_SGP30.cproj               | 158 +++++
 DS2450_SGP30/OWDS2450.S                       | 250 ++++++++
 DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.atsln |  44 +-
 .../DS2450_SHT2X_BMP280_MAX44009.c            |  90 +--
 .../DS2450_SHT2X_BMP280_MAX44009.cproj        |  16 +-
 .../DS2450_SHT2X_MAX44009.atsln               |  44 +-
 DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c |   6 +-
 .../DS2450_SHT2X_MAX44009.cproj               |  24 +-
 DS2450_SHT3X/DS2450_SHT3X.atsln               |  22 +
 DS2450_SHT3X/DS2450_SHT3X.c                   | 298 ++++++++++
 DS2450_SHT3X/DS2450_SHT3X.cproj               | 148 +++++
 DS2450_SHT3X/OWDS2450.S                       | 247 ++++++++
 DS2450_VOC_SHT/DS2450_VOC_SHT.atsln           |  22 +
 DS2450_VOC_SHT/DS2450_VOC_SHT.c               | 519 +++++++++++++++++
 DS2450_VOC_SHT/DS2450_VOC_SHT.cproj           | 147 +++++
 DS2450_VOC_SHT/OWDS2450.S                     | 247 ++++++++
 common/I2C/BME680.c                           |  16 +-
 common/I2C/BMP280.c                           |  91 ++-
 common/I2C/BMP280.h                           |   1 +
 common/I2C/CDM7160.c                          |   2 +-
 common/I2C/HDC2010.c                          | 291 ++++++++++
 common/I2C/HDC2010.h                          |  42 ++
 common/I2C/LPS225HB.c                         | 129 +++++
 common/I2C/LPS225HB.h                         |  42 ++
 common/I2C/MAX44009.c                         |   2 +-
 common/I2C/SGP30.c                            |   2 +
 common/I2C/SHT2x.c                            |   2 +-
 common/I2C/SHT2xV2.c                          |   8 +-
 common/I2C/SHT3x.c                            |   2 +-
 common/I2C/TSL256x.c                          |   2 +-
 common/I2C/TWI_Master.c                       | 367 ++++++++++++
 common/I2C/TWI_Master.h                       | 147 +++++
 common/I2C/USI_TWI_Master.c                   |   7 +-
 common/I2C/USI_TWI_Master.h                   |  15 +-
 common/OWCRC8_16.s                            | 105 ++++
 common/OWConfig.s                             |   6 +-
 common/OWDS18B20_DS18B20.S                    | 392 +++++++++++++
 common/OWDS18B20_DS2408.S                     | 456 +++++++++++++++
 common/OWDS18B20_DS2438.S                     |  38 +-
 common/OWDS2408.S                             | 255 ++++++++
 common/OWDS2413_DS2413.S                      | 248 ++++++++
 common/OWDS2438_DS2438.S                      |  13 +-
 common/OWDS2450_DS2423.S                      | 548 ++++++++++++++++++
 common/OWDS2450_DS2450.S                      | 440 ++++++++++++++
 common/OWPinInterrupt.s                       |   4 +-
 common/OWRomFunctions.s                       |  36 +-
 common/OWRomFunctionsDual.s                   |  38 +-
 common/OWSet_ATMEGA168.s                      | 167 ++++++
 common/OWSet_ATTINYX4.s                       |  36 +-
 common/calibr.c                               |   5 +
 common/calibr.h                               |   1 -
 common/owSlave_tools.h                        | 187 ++++++
 programmer/programmer/programmer.asmproj      |  12 +-
 .../programmer/programmer_8MHz_2017.asm       | 489 ++++++++++++++++
 .../programmer_atmega328.asm                  | 497 ++++++++++++++++
 .../programmer_atmega328.asmproj              |  89 +++
 .../programmer_atmega328.atsln                |  22 +
 182 files changed, 22796 insertions(+), 1505 deletions(-)
 create mode 100644 DS18B20_ADC/DS18B20_ADC.atsln
 create mode 100644 DS18B20_ADC/DS18B20_ADC.c
 create mode 100644 DS18B20_ADC/DS18B20_ADC.cproj
 create mode 100644 DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.atsln
 create mode 100644 DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.cproj
 create mode 100644 DS18B20_CDM7160_DS18B20_BMP280/DS18B20_DS18B20.c
 create mode 100644 DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.atsln
 create mode 100644 DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.c
 create mode 100644 DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.cproj
 create mode 100644 DS18B20_DS2408/DS18B20_DS2408.atsln
 create mode 100644 DS18B20_DS2408/DS18B20_DS2408.c
 create mode 100644 DS18B20_DS2408/DS18B20_DS2408.cproj
 create mode 100644 DS18B20_LPS225HB_DS2438_SHT/DS18B20_DS2438.c
 create mode 100644 DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.atsln
 create mode 100644 DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.cproj
 create mode 100644 DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_DS18B20.c
 create mode 100644 DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.atsln
 create mode 100644 DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.cproj
 create mode 100644 DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_DS18B20.c
 create mode 100644 DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.atsln
 create mode 100644 DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.cproj
 create mode 100644 DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.atsln
 create mode 100644 DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.cproj
 create mode 100644 DS2408/DS2408.atsln
 create mode 100644 DS2408/DS2408.c
 create mode 100644 DS2408/DS2408.cproj
 create mode 100644 DS2413_DS2413/DS2413_DS2413.atsln
 create mode 100644 DS2413_DS2413/DS2413_DS2413.c
 create mode 100644 DS2413_DS2413/DS2413_DS2413.cproj
 create mode 100644 DS2438_ADC/DS2438_ADC.atsln
 create mode 100644 DS2438_ADC/DS2438_ADC.c
 create mode 100644 DS2438_ADC/DS2438_ADC.cproj
 create mode 100644 DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.atsln
 create mode 100644 DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.cproj
 create mode 100644 DS2438_ADC_DS2438_ADC/DS2438_DS2438.c
 create mode 100644 DS2438_CDM7160/DS2438_CDM7160.atsln
 create mode 100644 DS2438_CDM7160/DS2438_CDM7160.c
 create mode 100644 DS2438_CDM7160/DS2438_CDM7160.cproj
 create mode 100644 DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.atsln
 create mode 100644 DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.componentinfo.xml
 create mode 100644 DS2438_CDM7160_DS2438_BMP280/DS2438_DS2438.c
 create mode 100644 DS2438_DHT11/DS2438_DHT22.atsln
 create mode 100644 DS2438_DHT11/DS2438_DHT22.c
 create mode 100644 DS2438_DHT11/DS2438_DHT22.cproj
 create mode 100644 DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.atsln
 create mode 100644 DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.c
 create mode 100644 DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.cproj
 create mode 100644 DS2438_Fenster_Kontakt/OWDS2438.S
 create mode 100644 DS2438_HDC2010/DS2438_HDC2010.atsln
 create mode 100644 DS2438_HDC2010/DS2438_HDC2010.c
 create mode 100644 DS2438_HDC2010/DS2438_HDC2010.cproj
 create mode 100644 DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_DS2438.c
 create mode 100644 DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.atsln
 create mode 100644 DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.cproj
 create mode 100644 DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_DS2438.c
 create mode 100644 DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.atsln
 create mode 100644 DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.cproj
 create mode 100644 DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_DS2438.c
 create mode 100644 DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.atsln
 create mode 100644 DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.cproj
 create mode 100644 DS2438_SHT2X_DS2438_LPS225HB/DS2438_DS2438.c
 create mode 100644 DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.atsln
 create mode 100644 DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.cproj
 create mode 100644 DS2450_ADC/DS2450.c
 create mode 100644 DS2450_ADC/DS2450_ADC.atsln
 create mode 100644 DS2450_ADC/DS2450_ADC.cproj
 create mode 100644 DS2450_ADC/OWDS2450.S
 create mode 100644 DS2450_ADC_JOE2/DS2450.c
 create mode 100644 DS2450_ADC_JOE2/DS2450_ADC.atsln
 create mode 100644 DS2450_ADC_JOE2/DS2450_ADC_JOE2.cproj
 create mode 100644 DS2450_ADC_JOE2/OWDS2450.S
 create mode 100644 DS2450_APDS9960/OWDS2450.S
 create mode 100644 DS2450_BME680/DS2450_BME680.atsln
 create mode 100644 DS2450_BME680/DS2450_BME680.c
 create mode 100644 DS2450_BME680/DS2450_BME680.cproj
 create mode 100644 DS2450_BME680/OWDS2450.S
 create mode 100644 DS2450_BMP280/OWDS2450.S
 create mode 100644 DS2450_CDM7160/DS2450_CDM7160.atsln
 create mode 100644 DS2450_CDM7160/DS2450_CDM7160.c
 create mode 100644 DS2450_CDM7160/DS2450_CDM7160.cproj
 create mode 100644 DS2450_CDM7160/OWDS2450.S
 create mode 100644 DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.atsln
 create mode 100644 DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.c
 create mode 100644 DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.cproj
 create mode 100644 DS2450_DSM501A/DS2450_DSM501A.atsln
 create mode 100644 DS2450_DSM501A/DS2450_DSM501A.c
 create mode 100644 DS2450_DSM501A/DS2450_DSM501A.cproj
 create mode 100644 DS2450_LPS225HB/DS2450_LPS225HB.atsln
 create mode 100644 DS2450_LPS225HB/DS2450_LPS225HB.c
 create mode 100644 DS2450_LPS225HB/DS2450_LPS225HB.cproj
 create mode 100644 DS2450_LPS225HB/OWDS2450.S
 create mode 100644 DS2450_MAX44008/DS2450_MAX44008.atsln
 create mode 100644 DS2450_MAX44008/DS2450_MAX44008.c
 create mode 100644 DS2450_MAX44008/DS2450_MAX44008.cproj
 create mode 100644 DS2450_MAX44008/OWDS2450.S
 create mode 100644 DS2450_SGP30/DS2450_SGP30.atsln
 create mode 100644 DS2450_SGP30/DS2450_SGP30.c
 create mode 100644 DS2450_SGP30/DS2450_SGP30.cproj
 create mode 100644 DS2450_SGP30/OWDS2450.S
 create mode 100644 DS2450_SHT3X/DS2450_SHT3X.atsln
 create mode 100644 DS2450_SHT3X/DS2450_SHT3X.c
 create mode 100644 DS2450_SHT3X/DS2450_SHT3X.cproj
 create mode 100644 DS2450_SHT3X/OWDS2450.S
 create mode 100644 DS2450_VOC_SHT/DS2450_VOC_SHT.atsln
 create mode 100644 DS2450_VOC_SHT/DS2450_VOC_SHT.c
 create mode 100644 DS2450_VOC_SHT/DS2450_VOC_SHT.cproj
 create mode 100644 DS2450_VOC_SHT/OWDS2450.S
 create mode 100644 common/I2C/HDC2010.c
 create mode 100644 common/I2C/HDC2010.h
 create mode 100644 common/I2C/LPS225HB.c
 create mode 100644 common/I2C/LPS225HB.h
 create mode 100644 common/I2C/TWI_Master.c
 create mode 100644 common/I2C/TWI_Master.h
 create mode 100644 common/OWCRC8_16.s
 create mode 100644 common/OWDS18B20_DS18B20.S
 create mode 100644 common/OWDS18B20_DS2408.S
 create mode 100644 common/OWDS2408.S
 create mode 100644 common/OWDS2413_DS2413.S
 create mode 100644 common/OWDS2450_DS2423.S
 create mode 100644 common/OWDS2450_DS2450.S
 create mode 100644 common/OWSet_ATMEGA168.s
 create mode 100644 common/owSlave_tools.h
 create mode 100644 programmer/programmer/programmer_8MHz_2017.asm
 create mode 100644 programmer_atmega328/programmer_atmega328/programmer_atmega328.asm
 create mode 100644 programmer_atmega328/programmer_atmega328/programmer_atmega328.asmproj
 create mode 100644 programmer_atmega328/programmer_atmega328/programmer_atmega328.atsln

diff --git a/DS18B20_ADC/DS18B20_ADC.atsln b/DS18B20_ADC/DS18B20_ADC.atsln
new file mode 100644
index 0000000..ace6033
--- /dev/null
+++ b/DS18B20_ADC/DS18B20_ADC.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_ADC", "DS18B20_ADC.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_ADC/DS18B20_ADC.c b/DS18B20_ADC/DS18B20_ADC.c
new file mode 100644
index 0000000..36bd271
--- /dev/null
+++ b/DS18B20_ADC/DS18B20_ADC.c
@@ -0,0 +1,201 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+
+
+uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0xAC};/**/
+uint8_t config_info[26]={0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+	
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+
+volatile uint8_t wdcounter;
+
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		uint16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	//sleep_disable();          // Disable Sleep on Wakeup
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+/*	if (timeout==2) {
+		DIS_TIMER;
+		EN_OWINT;
+		mode=OWM_SLEEP;
+	}
+	timeout++;*/
+	//sleep_enable();           // Enable Sleep Mode
+
+}
+
+
+volatile double V,ktemp;
+
+uint16_t ADmess() {
+	 ADMUX=0b00101100;  //3V  ADC2+  ADC1- 1x
+	 ADCSRA|=(1<<ADSC);
+	 while ((ADCSRA&(1<<ADSC)));
+	return ADC;
+}
+
+int main(void){
+    //PRR|=(1<<PRUSI)|(1<<PRADC);  //Switch off usi and adc for save Power
+	pack.temp=0x0550;
+	pack.config=0x7F;
+	pack.TH=75;
+	pack.TL=70;
+	pack.rrFF=0xFF;
+	pack.rr00=0;
+	pack.rr10=0x10;
+	PORTA=0xFF-(1<<PINA1)-(1<<PINA2);
+	PORTB=0xFF;
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP2) | (1<<WDP1);   // Set Timeout to ~1 seconds
+	MCUSR=0;
+	sei();
+	ADCSRA=(1<<ADEN)|(1<<ADPS2)|(1<<ADPS1);//|(1<<ADPS0);
+	
+	
+	uint16_t ares[16],sum;
+	uint8_t par=0;
+	sum=0;
+	for(uint8_t i=0;i<16;i++) {
+		//sum+=ares[i];
+		sum+=ADmess();
+	}
+	par=0;
+	wdcounter=0;
+	gcontrol=1;
+
+    while(1)   {
+		if (wdcounter>0) {
+//			ares[par]=ADmess();
+			par++;
+			if (par>15) par=0;
+			wdcounter=0;
+			sum=0;
+			for(uint8_t i=0;i<16;i++) {
+				//sum+=ares[i];
+				sum+=ADmess();
+			}
+
+
+		}
+		if (gcontrol) {
+			PORTB|=(1<<PORTB0);
+			//V=sum/20.0/1024.0*1.12*1000.0/16.0;
+			//V=sum/20.0/1024.0*1.01*1000.0/16.0;
+			V=sum/1024.0*182-55*16-16;
+			if (V>125*16) V=125*16;
+			if (V<-55*16) V=-55*16;
+		
+			uint16_t htemp=V;
+		
+			uint8_t t8=pack.temp>>4;
+			uint8_t af=0;
+			if (t8>pack.TH) af=1;
+			if (t8<=pack.TL) af=1;
+			cli();
+			pack.temp=htemp;
+			alarmflag=af;
+			sei();
+			EXTERN_SLEEP();
+			PORTB&=~(1<<PORTB0);
+		}
+
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+//			CLKPR=(1<<CLKPCE);
+	//		CLKPR=(1<<CLKPS2); /*0.5Mhz*/
+//			PORTB&=~(1<<PINB1);
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS18B20_ADC/DS18B20_ADC.cproj b/DS18B20_ADC/DS18B20_ADC.cproj
new file mode 100644
index 0000000..26f10fe
--- /dev/null
+++ b/DS18B20_ADC/DS18B20_ADC.cproj
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_TC</AssemblyName>
+    <Name>DS18B20_ADC</Name>
+    <RootNamespace>DS18B20_TC</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\OWDS18B20.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_ADC.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_BMP280/DS18B20_BMP280.c b/DS18B20_BMP280/DS18B20_BMP280.c
index 78bb7d6..8cfc5a6 100644
--- a/DS18B20_BMP280/DS18B20_BMP280.c
+++ b/DS18B20_BMP280/DS18B20_BMP280.c
@@ -39,10 +39,10 @@
 #include <avr/pgmspace.h>
 #include "../common/I2C/USI_TWI_Master.h"
 #include "../common/I2C/BMP280.h"
+#include "../common/owSlave_tools.h"
 
 
-extern void OWINIT();
-extern void EXTERN_SLEEP();
+#define OWST_EXTERN_VARS
 
 
 
@@ -54,10 +54,7 @@ uint8_t config_info[26]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,14,0x0
 #error "Variable not correct"
 #endif
 
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
+
 
 
 
@@ -84,7 +81,8 @@ volatile pack_t pack;
 
 
 int main(void){
-    PRR|=(1<<PRADC);  // adc for save Power
+    OWST_INIT_USI_ON
+	
 	pack.temp=0x0550;
 	pack.config=0x7F;
 	pack.TH=75;
@@ -92,15 +90,14 @@ int main(void){
 	pack.rrFF=0xFF;
 	pack.rr00=0;
 	pack.rr10=0x10;
-	PORTA=0xFF;
-	PORTB=0xFF;
+	
 	OWINIT();
 
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
-
-	MCUSR=0;
+	OWST_EN_PULLUP
 	USI_TWI_Master_Initialise();
+	_delay_ms(500);
+	bmp280Init();
+	_delay_ms(50);
 	bmp280Init();
 	//DDRB|=(1<<PINB1);
 	gcontrol=1;
@@ -128,23 +125,8 @@ int main(void){
 			//PORTB&=~(1<<PINB1);
 		}
 
-		
-#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-#endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-#endif
-			  {
+		OWST_MAIN_END
 
-			MCUCR|=(1<<SE)|(1<<SM1);
-			MCUCR&=~(1<<ISC01);
-		} else {
-			MCUCR|=(1<<SE);
-			MCUCR&=~(1<<SM1);
-		}
-		//MCUCR&=~(1<<ISC01);
-		asm("SLEEP");
    }
 
 
diff --git a/DS18B20_BMP280_DS2438_SHT/DS18B20_BMP280_DS2438_SHT.cproj b/DS18B20_BMP280_DS2438_SHT/DS18B20_BMP280_DS2438_SHT.cproj
index 68c6f87..005cf10 100644
--- a/DS18B20_BMP280_DS2438_SHT/DS18B20_BMP280_DS2438_SHT.cproj
+++ b/DS18B20_BMP280_DS2438_SHT/DS18B20_BMP280_DS2438_SHT.cproj
@@ -28,17 +28,17 @@
     <eraseonlaunchrule>1</eraseonlaunchrule>
     <AsfFrameworkConfig>
       <framework-data>
-  <options />
-  <configurations />
-  <files />
-  <documentation help="" />
-  <offline-documentation help="" />
-  <dependencies>
-    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
-  </dependencies>
-</framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
     </AsfFrameworkConfig>
-    <avrtool>custom</avrtool>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
     <com_atmel_avrdbg_tool_atmelice>
       <ToolOptions>
         <InterfaceProperties>
@@ -62,8 +62,7 @@
       <ToolName>Simulator</ToolName>
     </com_atmel_avrdbg_tool_simulator>
     <ExternalProgrammingToolCommand />
-    <avrtoolserialnumber>
-    </avrtoolserialnumber>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
     <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
     <custom>
       <ToolOptions xmlns="">
@@ -76,6 +75,8 @@
       </ToolNumber>
       <ToolName xmlns="">Custom Programming Tool</ToolName>
     </custom>
+    <ResetRule>0</ResetRule>
+    <EraseKey />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
     <ToolchainSettings>
@@ -148,10 +149,6 @@
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="..\common\I2C\SHT2x.c">
-      <SubType>compile</SubType>
-      <Link>SHT2x.c</Link>
-    </Compile>
     <Compile Include="..\common\calibr.c">
       <SubType>compile</SubType>
       <Link>calibr.c</Link>
@@ -160,9 +157,13 @@
       <SubType>compile</SubType>
       <Link>BMP280.c</Link>
     </Compile>
-    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
       <SubType>compile</SubType>
-      <Link>USI_TWI_Master.c</Link>
+      <Link>TWI_Master.c</Link>
     </Compile>
     <Compile Include="..\common\OWDS18B20_DS2438.S">
       <SubType>compile</SubType>
diff --git a/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c
index e379db8..4dc0ba0 100644
--- a/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c
+++ b/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c
@@ -37,13 +37,13 @@
 #include <avr/wdt.h>
 #include <avr/sleep.h>
 #include <avr/pgmspace.h>
-#include "../common/I2C/USI_TWI_Master.h"
-#include "../common/I2C/SHT2x.h"
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/SHT2xV2.h"
 #include "../common/I2C/BMP280.h"
 #include "../common/calibr.h"
+#include "../common/owSlave_tools.h"
 
-extern void OWINIT();
-extern void EXTERN_SLEEP();
+OWST_EXTERN_VARS
 
 
 uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
@@ -53,37 +53,8 @@ uint8_t config_info1[26]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,14,0x
 uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,7,0x00,7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 
 	
-#if (owid>128) 
-#error "Variable not correct"
-#endif
-
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-volatile uint8_t wdcounter=3;
-
-
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-ISR(WATCHDOG_vect) {
-	#else
-	ISR(WDT_vect) {
-	
-#endif 
-	//sleep_disable();          // Disable Sleep on Wakeup
-	wdcounter++;
-	if (reset_indicator==1) reset_indicator++;
-	else if (reset_indicator==2) mode=0;
-/*	if (timeout==2) {
-		DIS_TIMER;
-		EN_OWINT;
-		mode=OWM_SLEEP;
-	}
-	timeout++;*/
-	//sleep_enable();           // Enable Sleep Mode
-
-}
 
+OWST_WDT_ISR
 
 typedef union {
 	volatile uint8_t bytes[8];
@@ -132,43 +103,23 @@ volatile pack2_t pack2;
 
 
 
-volatile int16_t am2302_temp;
-volatile uint16_t am2302_hum;
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+volatile uint16_t DS2438_2_VDD=0x01F4;
 
+OWST_TESTSW
 
-int testSW(void) {
-	uint8_t r;
-	DDRB&=~(1<<PORTB0);  //Eingang
-	__asm__ __volatile__ ("nop");
-	PORTB|=(1<<PORTB0); //Pullup
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	r=PINB&(1<<PORTB0);
-	__asm__ __volatile__ ("nop");
-	PORTB&=~(1<<PORTB0);
-	__asm__ __volatile__ ("nop");
-	DDRB|=(1<<PORTB0);  //Eingang
-	return (r==0);
-	
-	
-}
 
 uint8_t userRegister[1];
 int16_t sRH,sT;
-volatile double temperatureC,humidityRH;
+double temperatureC,humidityRH;
 volatile double l;
 	uint32_t P;
 	int32_t t;
 
 int main(void){
-    PRR|=(1<<PRADC);  // adc for save Power
-	PORTA=0xFF;
-	PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
-	DDRB|=(1<<PORTB0); //Als Ausgang und 0
-	
+	 OWST_INIT_USI_ON
+   
 	pack1.temp=0x0550;
 	pack1.config=0x7F;
 	pack1.TH=75;
@@ -179,69 +130,53 @@ int main(void){
 	PORTA=0xFF;
 	PORTB=0xFF;
 	OWINIT();
+	OWST_EN_PULLUP
 
-	ACSR|=(1<<ACD);  //Disable Comparator
-	ADCSRB|=(1<<ACME); //Disable Analog multiplexer
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	//MCUCR &=~(1<<BODS);
-
+	OWST_WDR_CONFIG8
 	
-	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
-	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
-	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
 	if (testSW()) {
-		config_info2[5]=8;
+		config_info2[5]=12;
 		}else{
 		config_info2[5]=7;
 	}
 	pack2.page3[0]=0xF1;
 
 	MCUSR=0;
-	USI_TWI_Master_Initialise();
+	TWI_Master_Initialise();
 	
-	SHT2x_SoftReset();
-	SHT2x_ReadUserRegister(userRegister);
-	//(userRegister & ~SHT2x_RES_MASK) | SHT2x_RES_10_13BIT;
-	SHT2x_WriteUserRegister(userRegister); //write changed user reg
-	// --- measure humidity with "Hold Master Mode (HM)" ---
-	//SHT2x_MeasurePoll(HUMIDITY, &sRH);
-	// --- measure temperature with "Polling Mode" (no hold master) ---
-	//SHT2x_MeasurePoll(TEMP, &sT);
-	//-- calculate humidity and temperature --
-	//temperatureC = SHT2x_CalcTemperatureC(sT);
-	//humidityRH = SHT2x_CalcRH(sRH);
+	initSHT2x();
+	_delay_ms(10);
 	bmp280Init();
 	gcontrol=1;
 	sei();
     while(1)   {
+		 
 		if (gcontrol) {
-			wdcounter=3;
+			wdcounter=2;
 			
 		}
 
 		if (wdcounter>2) {
-			SHT2x_MeasurePoll(HUMIDITY, &sRH);
-			// --- measure temperature with "Polling Mode" (no hold master) ---
-			SHT2x_MeasurePoll(TEMP, &sT);
-			//-- calculate humidity and temperature --
-			temperatureC = SHT2x_CalcTemperatureC(sT);
-			humidityRH = SHT2x_CalcRH(sRH);
-			humidityRH=calibr_hum(temperatureC,-0.45,humidityRH)*10.0;
-			temperatureC=temperatureC*10.0-4.5;
+				getSHT2xHumTemp(&temperatureC,&humidityRH);
+				double RH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+				double TC =temperatureC *10.0-2;
+
 			 if (testSW()) {
-				 am2302_hum= humidityRH*10.0;
-				 am2302_temp=temperatureC*25.6;
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=(double)TC*25.6;
 				 //am2302_temp=am2302_temp-20;
-				 config_info2[5]=8;
+				 config_info2[5]=12;
+				 DS2438_2_VDD=0x01F4;
 				 
 				 }else{
 				 
-				 double hhum=(1.0546-0.000216*temperatureC)*(humidityRH);
+				 double hhum=(1.0546-0.000216*TC)*(RH);
 				 //am2302_hum=0.318*hhum +76.0;
-				 am2302_hum=0.31*hhum +80;
-				 am2302_temp=temperatureC*25.6;
+				 DS2438_2_VAD=0.31*hhum +80;
+				 DS2438_2_TEMP=TC*25.6;
 				 //am2302_temp=am2302_temp-20;
 				 config_info2[5]=7;
+				 DS2438_2_VDD=0x01F4;
 			 }
 			wdcounter=0;
 		}
@@ -269,23 +204,7 @@ int main(void){
 			
 		}
 
-		
-#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-#endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-#endif
-			  {
-
-			MCUCR|=(1<<SE)|(1<<SM1);
-			MCUCR&=~(1<<ISC01);
-		} else {
-			MCUCR|=(1<<SE);
-			MCUCR&=~(1<<SM1);
-		}
-		//MCUCR&=~(1<<ISC01);
-		asm("SLEEP");
+		OWST_MAIN_END	
    }
 
 
diff --git a/DS18B20_CDM7160/DS18B20_CDM7160.c b/DS18B20_CDM7160/DS18B20_CDM7160.c
index 1c18216..c9e90b3 100644
--- a/DS18B20_CDM7160/DS18B20_CDM7160.c
+++ b/DS18B20_CDM7160/DS18B20_CDM7160.c
@@ -37,41 +37,18 @@
 #include <avr/wdt.h>
 #include <avr/sleep.h>
 #include <avr/pgmspace.h>
+#include "../common/owSlave_tools.h"
 #include "../common/I2C/USI_TWI_Master.h"
 #include "../common/I2C/CDM7160.h"
 
 
-extern void OWINIT();
-
-extern void EXTERN_SLEEP();
-
+OWST_EXTERN_VARS
 
 uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/
 uint8_t config_info[26]={10,21, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 	
-#if (owid>128) 
-#error "Variable not correct"
-#endif
-
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-volatile uint8_t wdcounter=5;
-
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-ISR(WATCHDOG_vect) {
-#else
-ISR(WDT_vect) {
-#endif 
-	wdcounter++;
-	if (reset_indicator==1) reset_indicator++;
-	else if (reset_indicator==2) mode=0;
 
-
-}
-
-uint8_t max_adr=0;
+OWST_WDT_ISR
 
 typedef union {
 	volatile uint8_t bytes[8];
@@ -94,10 +71,10 @@ volatile pack_t pack;
 
 
 
-int main(void){
-	PORTB&=~(1<<PINB1);
-	DDRB|=(1<<PINB1);
-    PRR|=(1<<PRADC);  // adc for save Power
+int main(void) {
+	OWST_INIT_USI_ON
+
+
 	pack.temp=0x0550;
 	pack.config=0x7F;
 	pack.TH=75;
@@ -110,18 +87,11 @@ int main(void){
 	OWINIT();
 	PORTB&=~(1<<PINB1);
 	DDRB|=(1<<PINB1);
-	
-
 	PORTA&=~(1<<PINA0);
 
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
-
-	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
-	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
-	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	OWST_EN_PULLUP
+	OWST_WDR_CONFIG8
 
-	MCUSR=0;
 	_delay_ms(100);
 	USI_TWI_Master_Initialise();
 	CDM7160softReset();
@@ -170,22 +140,7 @@ int main(void){
 		}
 
 		
-#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-#endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-#endif
-			  {
-
-			MCUCR|=(1<<SE)|(1<<SM1);
-			MCUCR&=~(1<<ISC01);
-		} else {
-			MCUCR|=(1<<SE);
-			MCUCR&=~(1<<SM1);
-		}
-		//MCUCR&=~(1<<ISC01);
-		asm("SLEEP");
+		OWST_MAIN_END
    }
 
 
diff --git a/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.atsln b/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.atsln
new file mode 100644
index 0000000..63b74f5
--- /dev/null
+++ b/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_CDM7160_DS18B20_BMP280", "DS18B20_CDM7160_DS18B20_BMP280.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.cproj b/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.cproj
new file mode 100644
index 0000000..ec53186
--- /dev/null
+++ b/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_CDM7160_DS18B20_BMP280.cproj
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS18B20_CDM7160_DS18B20_BMP280</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <custom>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">custom</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Custom Programming Tool</ToolName>
+    </custom>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\BMP280.c">
+      <SubType>compile</SubType>
+      <Link>BMP280.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\CDM7160.c">
+      <SubType>compile</SubType>
+      <Link>CDM7160.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS18B20.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS18B20.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_DS18B20.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_DS18B20.c b/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_DS18B20.c
new file mode 100644
index 0000000..60adf1e
--- /dev/null
+++ b/DS18B20_CDM7160_DS18B20_BMP280/DS18B20_DS18B20.c
@@ -0,0 +1,180 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/CDM7160.h"
+#include "../common/I2C/BMP280.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+
+uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x26, 0x05, 0x35};/**/
+uint8_t owid2[8]={0x28, 0xA4, 0xD9, 0x84, 0x00, 0x26, 0x05, 0xB0};/**/
+
+uint8_t config_info1[26]={10,21,0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[26]={0x02,0x03,0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,14,0x00,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+	
+
+OWST_WDT_ISR
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		uint16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack1_t;
+volatile pack1_t pack1,pack2;
+
+
+
+
+
+
+
+
+
+OWST_TESTSW
+
+
+uint8_t userRegister[1];
+uint16_t CO2,BMP;
+
+int main(void){
+	 OWST_INIT_USI_ON
+   
+	pack1.temp=0x0550;
+	pack1.config=0x7F;
+	pack1.TH=75;
+	pack1.TL=70;
+	pack1.rrFF=0xFF;
+	pack1.rr00=0;
+	pack1.rr10=0x10;
+	PORTA=0xFF;
+	PORTB=0xFF;
+	OWINIT();
+	OWST_EN_PULLUP
+
+	OWST_WDR_CONFIG8
+	
+	if (testSW()) {
+		config_info2[5]=12;
+		}else{
+		config_info2[5]=7;
+	}
+
+	MCUSR=0;
+	TWI_Master_Initialise();
+		bmp280Init();
+		_delay_ms(50);
+		bmp280Init();
+
+	CDM7160softReset();
+	_delay_ms(200);
+	
+	CDM7160setMode(0); //Power Down Mode
+	_delay_ms(200);
+	CDM7160setAvCount(0x3F);
+	CDM7160setFMode(1);
+	CO2=CDM7160getCO2();
+	CDM7160setMode(1);
+	_delay_ms(200);
+	gcontrol=1;
+	_delay_ms(10);
+	gcontrol=1;
+	sei();
+    while(1)   {
+		 
+		if (gcontrol) {
+			wdcounter=3;
+			
+		}
+
+		if (wdcounter>2) {
+				volatile int16_t l=(int16_t)CDM7160getCO2()-1280;
+
+				uint16_t w1=l;
+				uint32_t P;
+				int32_t t;
+				bmp280ConvertInt(&t,&P,1);
+				P=P-70000;
+				P=P/20;
+				uint16_t w2=P;
+				uint8_t t81=w1>>4;
+				uint8_t af1=0;
+				if (t81>pack1.TH) af1=1;
+				if (t81<=pack1.TL) af1=1;
+
+				cli();
+				pack1.temp=w1;
+				//pack.temp++;
+				alarmflag=af1;
+				sei();
+
+
+		
+				cli();
+				pack2.temp=w2;
+				sei();
+				//pack.temp++;
+				gcontrol=0;
+
+				
+
+			wdcounter=0;
+		}
+	
+		if (gcontrol) {
+			gcontrol=0;
+			EXTERN_SLEEP();
+			
+		}
+
+		OWST_MAIN_END	
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.atsln b/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.atsln
new file mode 100644
index 0000000..e158f97
--- /dev/null
+++ b/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_CDM7160_DS2438_HDC1080", "DS18B20_CDM7160_DS2438_HDC1080.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.c b/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.c
new file mode 100644
index 0000000..2c4c57d
--- /dev/null
+++ b/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.c
@@ -0,0 +1,249 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/HDC1080.h"
+#include "../common/calibr.h"
+#include "../common/I2C/CDM7160.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+
+uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x17, 0x05, 0xDC};/**/
+uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x17, 0x05, 0xA3};/**/
+uint8_t config_info1[26]={10,13, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,11,0x00,11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+	
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint8_t wdcounter=5;
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		uint16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack1_t;
+volatile pack1_t pack1;
+
+typedef union {
+
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+	};
+} pack2_t;
+volatile pack2_t pack2;
+
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH;
+volatile double l;
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+
+
+}
+
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB|=(1<<PORTB0); //Pullup
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 r=PINB&(1<<PORTB0);
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB&=~(1<<PORTB0); 
+	 __asm__ __volatile__ ("nop"); 
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);
+	 
+	 
+}
+
+int main(void){
+     PRR|=(1<<PRADC);  // adc for save Power
+	PORTA=0xFF;
+	PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+	DDRB|=(1<<PORTB0); //Als Ausgang und 0
+	
+	
+	OWINIT();
+
+	DDRB|=(1<<PINB1);
+	PORTB&=~(1<<PINB1);
+	PORTA&=~(1<<PINA0);
+
+	ACSR|=(1<<ACD);  //Disable Comparator
+	ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+
+	
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	 if (testSW()) {
+		config_info2[5]=8;
+	}else{
+		config_info2[5]=7;
+	 }
+	
+    uint8_t i;
+    for(i=0;i<64;i++) pack2.bytes[i]=0;
+	MCUSR=0;
+	USI_TWI_Master_Initialise();
+	HDC1080_Init();
+	HDC1080_Readf(&temperatureC,&humidityRH);
+	
+	CDM7160setMode(0); //Power Down Mode
+	CDM7160setAvCount(0x3F);
+	CDM7160setFMode(1);
+	pack1.temp=CDM7160getCO2();
+	CDM7160setMode(1);
+	gcontrol=1;
+	
+	sei();
+	
+	 while(1)   {
+		 if (gcontrol) {
+			 wdcounter=3;
+			 //gcontrol=0;
+		 }
+		 if (wdcounter>2) {
+			 //PORTB|=(1<<PINB1); //Dauer 440ms
+			 HDC1080_Readf(&temperatureC,&humidityRH);
+
+			// humidityRH = calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+			// temperatureC-=0.2;
+			humidityRH*=10.0;
+			 temperatureC*=10.0;
+			/* if (testSW()) {*/
+				 am2302_hum= humidityRH;
+				 am2302_temp=temperatureC*25.6;
+				 //am2302_temp=am2302_temp-45;
+				 config_info2[5]=12;	
+				 
+/*			 }else{*/
+				 
+			/*	double hhum=(1.0546-0.000216*temperatureC)*(humidityRH);
+				//am2302_hum=0.318*hhum +76.0;
+				am2302_hum=0.31*hhum +80;
+				am2302_temp=temperatureC*25.6;
+				//am2302_temp=am2302_temp-45;
+				config_info2[5]=7;*/
+			 //}
+			 //PORTB&=~(1<<PINB1);
+			 wdcounter=0;
+		 }
+
+		 if ((gcontrol&1)==1) {
+			 
+			volatile uint16_t l=CDM7160getCO2();	
+			uint16_t w=l;
+			uint8_t t8=w>>4;
+			uint8_t af=0;
+			if (t8>pack1.TH) af=1;
+			if (t8<=pack1.TL) af=1;
+			cli();
+			pack1.temp=w;
+			//pack.temp++;
+			alarmflag=af;
+			sei();
+			//CDM7160setMode(0);
+			//EXTERN_SLEEP();
+		 }
+		 if (gcontrol) {
+			 gcontrol=0;
+			 
+		 }
+
+		if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+	}
+
+
+}
\ No newline at end of file
diff --git a/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.cproj b/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.cproj
new file mode 100644
index 0000000..6fa9976
--- /dev/null
+++ b/DS18B20_CDM7160_DS2438_HDC1080/DS18B20_CDM7160_DS2438_HDC1080.cproj
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_MAX44009</AssemblyName>
+    <Name>DS18B20_CDM7160_DS2438_HDC1080</Name>
+    <RootNamespace>DS18B20_MAX44009</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\CDM7160.c">
+      <SubType>compile</SubType>
+      <Link>CDM7160.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\HDC1080.c">
+      <SubType>compile</SubType>
+      <Link>HDC1080.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_CDM7160_DS2438_HDC1080.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_DS2408/DS18B20_DS2408.atsln b/DS18B20_DS2408/DS18B20_DS2408.atsln
new file mode 100644
index 0000000..90bc8f1
--- /dev/null
+++ b/DS18B20_DS2408/DS18B20_DS2408.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_DS2408", "DS18B20_DS2408.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_DS2408/DS18B20_DS2408.c b/DS18B20_DS2408/DS18B20_DS2408.c
new file mode 100644
index 0000000..315c589
--- /dev/null
+++ b/DS18B20_DS2408/DS18B20_DS2408.c
@@ -0,0 +1,245 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/owSlave_tools.h"
+#include "../common/I2C/SHT3x.h"
+#include "../common/calibr.h"
+
+
+#include <math.h>
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+extern uint8_t stat_to_sample;
+
+uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
+uint8_t owid2[8]={0x29, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x01, 0x73};/**/
+uint8_t config_info1[26]={0x01,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[26]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0,0,0,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+OWST_EXTERN_VARS
+
+OWST_WDT_ISR
+
+
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		int16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack1_t;
+volatile pack1_t pack1;
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		uint8_t PIO_Logic_State;     //		0088h
+		uint8_t PIO_Output_Latch_State;
+		uint8_t PIO_Activity_Latch_State;
+		uint8_t Conditional_Search_Channel_Selection_Mask;
+		uint8_t Conditional_Search_Channel_Polarity_Selection;
+		uint8_t Status; //008D
+		uint8_t FF1;
+		uint8_t FF2;
+		
+	};
+} pack2_t;
+volatile pack2_t pack2;
+
+uint8_t values[10];
+uint8_t ap=1;
+
+uint8_t crc8_f() {
+	uint8_t lscrc=0x0;
+	for(uint8_t i=0;i<5;i++) {
+		uint8_t v=values[i];
+		//if (v==0) v=0xFF;
+		uint8_t bit=1;
+		uint8_t lb;
+		for(uint8_t j=0;j<8;j++) {
+			if ((v&bit)==bit) lb=1; else lb=0;
+			if ((lscrc&1)!=lb)	lscrc=(lscrc>>1)^0x8c; else	lscrc=(lscrc>>1);
+			bit=bit*2;
+		
+		
+		}
+	}
+	return lscrc;
+}
+
+
+//Umstellung
+
+//rh=(T-25)*(0,01+0,00008*x)-2,0468+0,0367*x-0,0000015955*x*x
+//d1 for 3V
+#define d1 -39.7  
+#define d2 0.01
+inline uint16_t calcSHT75_T(double real_t) {
+	return (real_t-d1)/d2;
+}
+
+inline uint16_t calcSHT75RH_lin(double real_RHlin) {
+	return 11501.1-0.280297*sqrt(1667284153.0-7977500.0*real_RHlin);
+}
+
+inline double calcSHT75H_tcorr(double real_t,double real_RHtrue) {
+	return real_RHtrue-(real_t-25)*(0.01+0.00008*calcSHT75RH_lin(real_RHtrue));
+
+}
+
+
+double T=20.0;
+double RH=60;
+
+int main(void){
+	OWST_INIT_USI_ON;
+	pack2.FF1=0xFF;
+	pack2.FF2=0xFF;
+	 //0x0E 0x19 0x48 0x00
+	 if (RH<8) RH=8;
+	 uint16_t lt=calcSHT75_T(T);
+		double lfc=calcSHT75H_tcorr(T,RH);
+	 uint16_t lf=calcSHT75RH_lin(lfc);
+	values[0]=0x00;
+	values[1]=lt&0xFF; if (values[1]==0) values[1]=1;
+	values[2]=lt>>8; if (values[2]==0) values[2]=1;
+	values[3]=lf&0xFF; if (values[3]==0) values[3]=1;
+	values[4]=lf>>8; if (values[4]==0) values[4]=1;
+	values[5]=0x5D; 
+	values[6]=0x00;
+	values[7]=0x00;
+	values[5]=crc8_f();	
+	
+	OWINIT();
+
+	TWI_Master_Initialise();
+	initSHT3x(0);
+	_delay_ms(100);
+
+
+	getSHT3xHumTemp(0,&T,&RH);
+	OWST_WDR_CONFIG8;
+	sei();
+	stat_to_sample=0x55;
+	while (1) {
+		//stat_to_sample=0;
+		if (reset_indicator) {
+		//	ap=0;
+		//	stat_to_sample=0;
+		//	reset_indicator=0;
+		}
+		if (wdcounter>3) {
+			
+			wdcounter=0;
+			RH=RH+0.2;
+			getSHT3xHumTemp(0,&T,&RH);
+			//pack1.temp=T*16.0;
+			lt=calcSHT75_T(T);
+			lfc=calcSHT75H_tcorr(T,RH);
+			lf=calcSHT75RH_lin(lfc);
+		values[0]=0x00;
+		values[1]=lt&0xFF; if (values[1]==0) values[1]=1;
+		values[2]=lt>>8; if (values[2]==0) values[2]=1;
+		values[3]=lf&0xFF; if (values[3]==0) values[3]=1;
+		values[4]=lf>>8; if (values[4]==0) values[4]=1;
+		 values[5]=crc8_f();
+		 if (values[5]==0) values[3]=values[3]+1;  //CRC darf nicht 0 sein ... warum auch immer
+		 values[5]=crc8_f();
+		}
+		pack2.Status|=0x80;
+		if (gcontrol&1) {
+			uint8_t bb=1;
+			for(uint8_t i=0;i<8;i++) {
+				if ((pack2.PIO_Logic_State&bb)!=(pack2.PIO_Output_Latch_State&bb)) pack2.PIO_Activity_Latch_State|=bb;
+				bb=bb*2;
+			}
+            pack2.PIO_Logic_State=pack2.PIO_Output_Latch_State;
+			gcontrol&=~0x01;
+		}
+		if (gcontrol&2) {
+			pack2.PIO_Activity_Latch_State=0;
+            gcontrol&=~0x02;
+		}
+		if (gcontrol&4) {
+			stat_to_sample=values[ap];
+			ap++;		
+			if (ap>5) {
+					ap=0;
+			}
+			gcontrol&=~0x04;
+		} 		
+		if (gcontrol&8) {
+			ap=1;
+			stat_to_sample=values[ap];
+			ap++;
+			//if (ap>5) ap=1;
+			gcontrol&=~0x08;
+		} 
+		if ((gcontrol&16)==16) {
+			
+	
+			uint16_t w=T*16.0;
+			uint8_t t8=w>>4;
+			uint8_t af=0;
+			if (t8>pack1.TH) af=1;
+			if (t8<=pack1.TL) af=1;
+			cli();
+			pack1.temp=w;
+			//pack.temp++;
+			alarmflag=af;
+			sei();
+			gcontrol=0;
+			EXTERN_SLEEP();
+		}
+
+		OWST_MAIN_END
+	}
+
+
+
+}
diff --git a/DS18B20_DS2408/DS18B20_DS2408.cproj b/DS18B20_DS2408/DS18B20_DS2408.cproj
new file mode 100644
index 0000000..733515c
--- /dev/null
+++ b/DS18B20_DS2408/DS18B20_DS2408.cproj
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS18B20_DS2408</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+    <ResetRule>0</ResetRule>
+    <EraseKey />
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <custom>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">custom</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Custom Programming Tool</ToolName>
+    </custom>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT3x.c">
+      <SubType>compile</SubType>
+      <Link>SHT3x.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS2408.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS2408.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_DS2408.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_LPS225HB_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_LPS225HB_DS2438_SHT/DS18B20_DS2438.c
new file mode 100644
index 0000000..a663f2f
--- /dev/null
+++ b/DS18B20_LPS225HB_DS2438_SHT/DS18B20_DS2438.c
@@ -0,0 +1,209 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/I2C/LPS225HB.h"
+#include "../common/calibr.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+
+uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
+uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/
+
+uint8_t config_info1[26]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,7,0x00,7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+	
+
+OWST_WDT_ISR
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		uint16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack1_t;
+volatile pack1_t pack1;
+
+
+
+typedef union {
+	#if  defined(__AVR_ATtiny25__)
+	volatile uint8_t bytes[16];
+	#else
+	volatile uint8_t bytes[64];
+	#endif
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		#if  defined(__AVR_ATtiny25__)
+		#else
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+		#endif
+	};
+} pack2_t;
+volatile pack2_t pack2;
+
+
+
+
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+volatile uint16_t DS2438_2_VDD=0x01F4;
+
+OWST_TESTSW
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH;
+volatile double l;
+	uint32_t P;
+	int16_t t;
+
+int main(void){
+	 OWST_INIT_USI_ON
+   
+	pack1.temp=0x0550;
+	pack1.config=0x7F;
+	pack1.TH=75;
+	pack1.TL=70;
+	pack1.rrFF=0xFF;
+	pack1.rr00=0;
+	pack1.rr10=0x10;
+	PORTA=0xFF;
+	PORTB=0xFF;
+	OWINIT();
+	OWST_EN_PULLUP
+
+	OWST_WDR_CONFIG8
+	
+	if (testSW()) {
+		config_info2[5]=12;
+		}else{
+		config_info2[5]=7;
+	}
+	pack2.page3[0]=0xF1;
+
+	MCUSR=0;
+	USI_TWI_Master_Initialise();
+	
+	initSHT2x();
+	_delay_ms(10);
+	LPS225HB_Init();
+	gcontrol=1;
+	sei();
+    while(1)   {
+		 
+		if (gcontrol) {
+			wdcounter=3;
+			
+		}
+
+		if (wdcounter>2) {
+				getSHT2xHumTemp(&temperatureC,&humidityRH);
+				double RH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+				double TC =temperatureC *10.0-2;
+
+			 if (testSW()) {
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=(double)TC*25.6;
+				 //am2302_temp=am2302_temp-20;
+				 config_info2[5]=12;
+				 
+				 }else{
+				 
+				 double hhum=(1.0546-0.000216*TC)*(RH);
+				 //am2302_hum=0.318*hhum +76.0;
+				 DS2438_2_VAD=0.31*hhum +80;
+				 DS2438_2_TEMP=TC*25.6;
+				 //am2302_temp=am2302_temp-20;
+				 config_info2[5]=7;
+			 }
+			wdcounter=0;
+		}
+	
+		if ((gcontrol&1)==1) {
+			
+				 LPS225HB_Readi(&t,&P);
+				P=P-(uint32_t)700*4096;
+				P=(double)P/819.2;
+				uint16_t w=P;
+				uint8_t t8=w>>4;
+				uint8_t af=0;
+				if (t8>pack1.TH) af=1;
+				if (t8<=pack1.TL) af=1;
+				cli();
+				pack1.temp=w;
+				//pack.temp++;
+				alarmflag=af;
+				sei();
+				gcontrol=0;
+				EXTERN_SLEEP();	
+		}
+		if (gcontrol) {
+			gcontrol=0;
+			
+		}
+
+		OWST_MAIN_END	
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.atsln b/DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.atsln
new file mode 100644
index 0000000..467ee29
--- /dev/null
+++ b/DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_LPS225HB_DS2438_SHT", "DS18B20_LPS225HB_DS2438_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.cproj b/DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.cproj
new file mode 100644
index 0000000..35eade1
--- /dev/null
+++ b/DS18B20_LPS225HB_DS2438_SHT/DS18B20_LPS225HB_DS2438_SHT.cproj
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS18B20_LPS225HB_DS2438_SHT</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <custom>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">custom</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Custom Programming Tool</ToolName>
+    </custom>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\LPS225HB.c">
+      <SubType>compile</SubType>
+      <Link>LPS225HB.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_MAX44009/DS18B20_MAX44009.c b/DS18B20_MAX44009/DS18B20_MAX44009.c
index 4aeb0e8..1ebcf7c 100644
--- a/DS18B20_MAX44009/DS18B20_MAX44009.c
+++ b/DS18B20_MAX44009/DS18B20_MAX44009.c
@@ -40,25 +40,13 @@
 #include <avr/pgmspace.h>
 #include "../common/I2C/USI_TWI_Master.h"
 #include "../common/I2C/MAX44009.h"
+#include "../common/owSlave_tools.h"
 
-
-extern void OWINIT();
-
-extern void EXTERN_SLEEP();
-
-
+OWST_EXTERN_VARS
+//-D__4MHZ__
 uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/
 uint8_t config_info[26]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 	
-#if (owid>128) 
-#error "Variable not correct"
-#endif
-
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-
 
 uint8_t max_adr=0;
 
@@ -84,7 +72,7 @@ volatile pack_t pack;
 
 
 int main(void){
-    PRR|=(1<<PRADC);  // adc for save Power
+	OWST_INIT_USI_ON
 	pack.temp=0x0550;
 	pack.config=0x7F;
 	pack.TH=75;
@@ -92,14 +80,9 @@ int main(void){
 	pack.rrFF=0xFF;
 	pack.rr00=0;
 	pack.rr10=0x10;
-	PORTA=0xFF;
-	PORTB=0xFF;
-	OWINIT();
-
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
 
-	MCUSR=0;
+	OWINIT();
+	OWST_EN_PULLUP
 	USI_TWI_Master_Initialise();
 	if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
 	
@@ -108,7 +91,7 @@ int main(void){
 	sei();
     while(1)   {
 	
-		if (gcontrol) {
+		if ((gcontrol&1)==1) {
 			//PORTB|=(1<<PINB1); //Dauer 2.3ms
 			volatile double l=MAX44009getlux(max_adr);		
 			if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
@@ -124,27 +107,13 @@ int main(void){
 			//pack.temp++;
 			alarmflag=af;
 			sei();	
+			gcontrol=0;
 			EXTERN_SLEEP();		
 			//PORTB&=~(1<<PINB1);
 		}
 
 		
-#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-#endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-#endif
-			  {
-
-			MCUCR|=(1<<SE)|(1<<SM1);
-			MCUCR&=~(1<<ISC01);
-		} else {
-			MCUCR|=(1<<SE);
-			MCUCR&=~(1<<SM1);
-		}
-		//MCUCR&=~(1<<ISC01);
-		asm("SLEEP");
+		OWST_MAIN_END
    }
 
 
diff --git a/DS18B20_MAX44009/DS18B20_MAX44009.cproj b/DS18B20_MAX44009/DS18B20_MAX44009.cproj
index a63a3cf..a7f4f2b 100644
--- a/DS18B20_MAX44009/DS18B20_MAX44009.cproj
+++ b/DS18B20_MAX44009/DS18B20_MAX44009.cproj
@@ -28,15 +28,15 @@
     <eraseonlaunchrule>1</eraseonlaunchrule>
     <AsfFrameworkConfig>
       <framework-data>
-  <options />
-  <configurations />
-  <files />
-  <documentation help="" />
-  <offline-documentation help="" />
-  <dependencies>
-    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
-  </dependencies>
-</framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
     </AsfFrameworkConfig>
     <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
     <com_atmel_avrdbg_tool_atmelice>
@@ -46,7 +46,7 @@
         <InterfaceName>debugWIRE</InterfaceName>
       </ToolOptions>
       <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
-      <ToolNumber>J41800000779</ToolNumber>
+      <ToolNumber>J41800000789</ToolNumber>
       <ToolName>Atmel-ICE</ToolName>
     </com_atmel_avrdbg_tool_atmelice>
     <avrtoolinterface>debugWIRE</avrtoolinterface>
@@ -63,45 +63,47 @@
       <ToolName>Simulator</ToolName>
     </com_atmel_avrdbg_tool_simulator>
     <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
     <ToolchainSettings>
       <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>DEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-      </AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+    </ListValues>
+  </avrgcc.assembler.general.IncludePaths>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
diff --git a/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c
index 4e8d28b..efd0454 100644
--- a/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c
+++ b/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c
@@ -40,69 +40,21 @@
 #include <avr/pgmspace.h>
 #include "../common/I2C/USI_TWI_Master.h"
 #include "../common/I2C/MAX44009.h"
-#include "../common/I2C/SHT2x.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/calibr.h"
+#include "../common/owSlave_tools.h"
 
 
-extern void OWINIT();
-extern void EXTERN_SLEEP();
-
+OWST_EXTERN_VARS
 
 uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
 uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/
 uint8_t config_info1[26]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,7,0x00,7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 
-
-	
-#if (owid>128) 
-#error "Variable not correct"
-#endif
-
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-volatile uint8_t wdcounter=5;
-
-
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-ISR(WATCHDOG_vect) {
-#else
-ISR(WDT_vect) {
-#endif 
-	//sleep_disable();          // Disable Sleep on Wakeup
-	wdcounter++;
-	if (reset_indicator==1) reset_indicator++;
-	else if (reset_indicator==2) mode=0;
-/*	if (timeout==2) {
-		DIS_TIMER;
-		EN_OWINT;
-		mode=OWM_SLEEP;
-	}
-	timeout++;*/
-	//sleep_enable();           // Enable Sleep Mode
-
-}
-
-int testSW(void) {
-	uint8_t r;
-	DDRB&=~(1<<PORTB0);  //Eingang
-	__asm__ __volatile__ ("nop");
-	PORTB|=(1<<PORTB0); //Pullup
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	r=PINB&(1<<PORTB0);
-	__asm__ __volatile__ ("nop");
-	PORTB&=~(1<<PORTB0);
-	__asm__ __volatile__ ("nop");
-	DDRB|=(1<<PORTB0);  //Eingang
-	return (r==0);
-	
+OWST_WDT_ISR
 	
-}
+OWST_TESTSW
 
 
 typedef union {
@@ -150,21 +102,17 @@ typedef union {
 volatile pack2_t pack2;
 
 
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+volatile uint16_t DS2438_2_VDD=0x01F4;
 
-
-volatile int16_t am2302_temp;
-volatile uint16_t am2302_hum;
-
-
-uint8_t userRegister[1];
-int16_t sRH,sT;
-volatile double temperatureC,humidityRH;
-volatile double l;
+double temperatureC,humidityRH;
+double l;
 
 uint8_t max_adr=0;
 
 int main(void){
-    PRR|=(1<<PRADC);  // adc for save Power
+    OWST_INIT_USI_ON
 	pack1.temp=0x0550;
 	pack1.config=0x7F;
 	pack1.TH=75;
@@ -172,40 +120,22 @@ int main(void){
 	pack1.rrFF=0xFF;
 	pack1.rr00=0;
 	pack1.rr10=0x10;
-	PORTA=0xFF;
-	PORTB=0xFF;
 	OWINIT();
-
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
-
-	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
-	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
-	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	OWST_EN_PULLUP
+	OWST_WDR_CONFIG8
 	if (testSW()) {
-		config_info2[5]=8;
+		config_info2[5]=12;
 		}else{
 		config_info2[5]=7;
 	}
-	MCUSR=0;
 	sei();
 	USI_TWI_Master_Initialise();
 	if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
-	SHT2x_SoftReset();
-	SHT2x_ReadUserRegister(userRegister);
-	//(userRegister & ~SHT2x_RES_MASK) | SHT2x_RES_10_13BIT;
-	SHT2x_WriteUserRegister(userRegister); //write changed user reg
-	// --- measure humidity with "Hold Master Mode (HM)" ---
-	SHT2x_MeasurePoll(HUMIDITY, &sRH);
-	// --- measure temperature with "Polling Mode" (no hold master) ---
-	SHT2x_MeasurePoll(TEMP, &sT);
-	//-- calculate humidity and temperature --
-	//temperatureC = SHT2x_CalcTemperatureC(sT);
-	//humidityRH = SHT2x_CalcRH(sRH);
+	_delay_ms(10);
 	
+	initSHT2x();
 	gcontrol=1;
 	sei();
-	//DDRB|=(1<<PINB1);
     while(1)   {
 		if ((gcontrol&2)==2){
 			wdcounter=3;
@@ -214,28 +144,26 @@ int main(void){
 		}
 		
 		if (wdcounter>2) {
-			//PORTB|=(1<<PINB1); //Dauer 440ms
-			SHT2x_MeasurePoll(HUMIDITY, &sRH);
-			// --- measure temperature with "Polling Mode" (no hold master) ---
-			SHT2x_MeasurePoll(TEMP, &sT);
-			//-- calculate humidity and temperature --
-			temperatureC = SHT2x_CalcTemperatureC(sT)*10.0-2;
-			humidityRH = SHT2x_CalcRH(sRH)*10.0+5;
-			if (humidityRH>1000) humidityRH=1000;
-			if (testSW()) {
-				am2302_hum= humidityRH*10.0;
-				am2302_temp=temperatureC*25.6;
-				//
-				config_info2[5]=8;
-				
-			}else{
-				
-				double hhum=(1.0546-0.000216*temperatureC)*(humidityRH);
-				//am2302_hum=0.318*hhum +76.0;
-				am2302_hum=0.31*hhum +80;
-				am2302_temp=temperatureC*25.6;
-				//am2302_temp=am2302_temp-45;
-				config_info2[5]=7;
+				getSHT2xHumTemp(&temperatureC,&humidityRH);
+				double RH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+				double TC =temperatureC *10.0-2;
+
+				if (testSW()) {
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=TC*25.6;
+					//am2302_temp=am2302_temp-20;
+					config_info2[5]=12;
+					DS2438_2_VDD=0x01F4;
+					
+				}else{
+					
+					 double hhum=(1.0546-0.000216*TC)*(RH);
+					//am2302_hum=0.318*hhum +76.0;
+					DS2438_2_VAD=0.31*hhum +80;
+					DS2438_2_TEMP=TC*25.6;
+					//am2302_temp=am2302_temp-20;
+					config_info2[5]=7;
+					DS2438_2_VDD=0x01F4;
 			}
 			wdcounter=0;
 		}
@@ -258,24 +186,7 @@ int main(void){
 			sei();			
 			EXTERN_SLEEP();		
 		}
-		
-
-		
-#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-#endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-#endif
-			  {
-
-			MCUCR|=(1<<SE)|(1<<SM1);
-			MCUCR&=~(1<<ISC01);
-		} else {
-			MCUCR|=(1<<SE);
-			MCUCR&=~(1<<SM1);
-		}
-		asm("SLEEP");
+		OWST_MAIN_END
    }
 
 
diff --git a/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj b/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj
index c14dc8d..f7036ac 100644
--- a/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj
+++ b/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj
@@ -139,14 +139,18 @@
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="..\common\I2C\SHT2x.c">
+    <Compile Include="..\common\calibr.c">
       <SubType>compile</SubType>
-      <Link>SHT2x.c</Link>
+      <Link>calibr.c</Link>
     </Compile>
     <Compile Include="..\common\I2C\MAX44009.c">
       <SubType>compile</SubType>
       <Link>MAX44009.c</Link>
     </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
     <Compile Include="..\common\I2C\USI_TWI_Master.c">
       <SubType>compile</SubType>
       <Link>USI_TWI_Master.c</Link>
diff --git a/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_DS18B20.c b/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_DS18B20.c
new file mode 100644
index 0000000..562a5f8
--- /dev/null
+++ b/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_DS18B20.c
@@ -0,0 +1,168 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/I2C/BMP280.h"
+#include "../common/calibr.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+
+uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x26, 0x05, 0x35};/**/
+uint8_t owid2[8]={0x28, 0xA4, 0xD9, 0x84, 0x00, 0x26, 0x05, 0xB0};/**/
+
+uint8_t config_info1[26]={0x01,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[26]={0x04,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,7,0x00,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+	
+
+OWST_WDT_ISR
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		uint16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack1_t;
+volatile pack1_t pack1,pack2;
+
+
+
+
+
+
+
+
+
+OWST_TESTSW
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH;
+volatile double l;
+	uint32_t P;
+	int32_t t;
+
+int main(void){
+	 OWST_INIT_USI_ON
+   
+	pack1.temp=0x0550;
+	pack1.config=0x7F;
+	pack1.TH=75;
+	pack1.TL=70;
+	pack1.rrFF=0xFF;
+	pack1.rr00=0;
+	pack1.rr10=0x10;
+	PORTA=0xFF;
+	PORTB=0xFF;
+	OWINIT();
+	OWST_EN_PULLUP
+
+	OWST_WDR_CONFIG8
+	
+	if (testSW()) {
+		config_info2[5]=12;
+		}else{
+		config_info2[5]=7;
+	}
+
+	MCUSR=0;
+	USI_TWI_Master_Initialise();
+	
+	initSHT2x();
+	_delay_ms(10);
+	gcontrol=1;
+	sei();
+    while(1)   {
+		 
+		if (gcontrol) {
+			wdcounter=3;
+			
+		}
+
+		if (wdcounter>2) {
+				getSHT2xHumTemp(&temperatureC,&humidityRH);
+				double RH=calibr_hum(temperatureC,-0.2,humidityRH)*16.0;
+				double TC =(temperatureC+0.2) *16.0;
+				uint16_t w1=TC;
+				uint8_t t81=w1>>4;
+				uint8_t af1=0;
+				if (t81>pack1.TH) af1=1;
+				if (t81<=pack1.TL) af1=1;
+
+				cli();
+				pack1.temp=w1;
+				//pack.temp++;
+				alarmflag=af1;
+				sei();
+
+
+				uint16_t w2=RH;
+		
+				cli();
+				pack2.temp=w2;
+				sei();
+				//pack.temp++;
+				gcontrol=0;
+
+				
+
+			wdcounter=0;
+		}
+	
+		if (gcontrol) {
+			gcontrol=0;
+			EXTERN_SLEEP();
+			
+		}
+
+		OWST_MAIN_END	
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.atsln b/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.atsln
new file mode 100644
index 0000000..4a55022
--- /dev/null
+++ b/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_SHT_DS18B20_SHT", "DS18B20_SHT_DS18B20_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.cproj b/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.cproj
new file mode 100644
index 0000000..9ed54df
--- /dev/null
+++ b/DS18B20_SHT2X_DS18B20_SHT2X/DS18B20_SHT_DS18B20_SHT.cproj
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS18B20_SHT_DS18B20_SHT</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <custom>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">custom</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Custom Programming Tool</ToolName>
+    </custom>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS18B20.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS18B20.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_DS18B20.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_DS18B20.c b/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_DS18B20.c
new file mode 100644
index 0000000..cc06287
--- /dev/null
+++ b/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_DS18B20.c
@@ -0,0 +1,167 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/SHT3x.h"
+#include "../common/calibr.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+
+uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x26, 0x05, 0x35};/**/
+uint8_t owid2[8]={0x28, 0xA4, 0xD9, 0x84, 0x00, 0x26, 0x05, 0xB0};/**/
+
+uint8_t config_info1[26]={0x01,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info2[26]={0x04,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,7,0x00,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+	
+
+OWST_WDT_ISR
+
+typedef union {
+	volatile uint8_t bytes[8];
+	struct {
+		uint16_t temp;  //0
+		uint8_t TH;  //2
+		uint8_t TL;  //3
+		uint8_t config;  //4
+		uint8_t rrFF; //5
+		uint8_t rr00; //6
+		uint8_t rr10; //7
+	};
+} pack1_t;
+volatile pack1_t pack1,pack2;
+
+
+
+
+
+
+
+
+
+OWST_TESTSW
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH;
+volatile double l;
+	uint32_t P;
+	int32_t t;
+
+int main(void){
+	 OWST_INIT_USI_ON
+   
+	pack1.temp=0x0550;
+	pack1.config=0x7F;
+	pack1.TH=75;
+	pack1.TL=70;
+	pack1.rrFF=0xFF;
+	pack1.rr00=0;
+	pack1.rr10=0x10;
+	PORTA=0xFF;
+	PORTB=0xFF;
+	OWINIT();
+	OWST_EN_PULLUP
+
+	OWST_WDR_CONFIG8
+	
+	if (testSW()) {
+		config_info2[5]=12;
+		}else{
+		config_info2[5]=7;
+	}
+
+	MCUSR=0;
+	USI_TWI_Master_Initialise();
+	
+	initSHT3x(0);
+	_delay_ms(10);
+	gcontrol=1;
+	sei();
+    while(1)   {
+		 
+		if (gcontrol) {
+			wdcounter=3;
+			
+		}
+
+		if (wdcounter>2) {
+				getSHT3xHumTemp(0,&temperatureC,&humidityRH);
+				double RH=calibr_hum(temperatureC,-0.2,humidityRH)*16.0;
+				double TC =(temperatureC+0.2) *16.0;
+				uint16_t w1=TC;
+				uint8_t t81=w1>>4;
+				uint8_t af1=0;
+				if (t81>pack1.TH) af1=1;
+				if (t81<=pack1.TL) af1=1;
+
+				cli();
+				pack1.temp=w1;
+				//pack.temp++;
+				alarmflag=af1;
+				sei();
+
+
+				uint16_t w2=RH;
+		
+				cli();
+				pack2.temp=w2;
+				sei();
+				//pack.temp++;
+				gcontrol=0;
+
+				
+
+			wdcounter=0;
+		}
+	
+		if (gcontrol) {
+			gcontrol=0;
+			EXTERN_SLEEP();
+			
+		}
+
+		OWST_MAIN_END	
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.atsln b/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.atsln
new file mode 100644
index 0000000..4a55022
--- /dev/null
+++ b/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_SHT_DS18B20_SHT", "DS18B20_SHT_DS18B20_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.cproj b/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.cproj
new file mode 100644
index 0000000..f4f3054
--- /dev/null
+++ b/DS18B20_SHT3X_DS18B20_SHT3X/DS18B20_SHT_DS18B20_SHT.cproj
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS18B20_SHT_DS18B20_SHT</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <custom>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">custom</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Custom Programming Tool</ToolName>
+    </custom>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT3x.c">
+      <SubType>compile</SubType>
+      <Link>SHT3x.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS18B20.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS18B20.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_DS18B20.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_Thermocouble/DS18B20_TC.cproj b/DS18B20_Thermocouble/DS18B20_TC.cproj
index a12b106..d3dd73d 100644
--- a/DS18B20_Thermocouble/DS18B20_TC.cproj
+++ b/DS18B20_Thermocouble/DS18B20_TC.cproj
@@ -34,7 +34,7 @@
   <documentation help="" />
   <offline-documentation help="" />
   <dependencies>
-    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" />
+    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
   </dependencies>
 </framework-data>
     </AsfFrameworkConfig>
@@ -46,90 +46,92 @@
         <InterfaceName>debugWIRE</InterfaceName>
       </ToolOptions>
       <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
-      <ToolNumber>J41800000779</ToolNumber>
+      <ToolNumber>J41800000789</ToolNumber>
       <ToolName>Atmel-ICE</ToolName>
     </com_atmel_avrdbg_tool_atmelice>
     <avrtoolinterface>debugWIRE</avrtoolinterface>
     <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
     <ToolchainSettings>
       <AvrGcc>
-  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-  <avrgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </avrgcc.compiler.symbols.DefSymbols>
-  <avrgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-    </ListValues>
-  </avrgcc.compiler.directories.IncludePaths>
-  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-  <avrgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </avrgcc.linker.libraries.Libraries>
-  <avrgcc.assembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-    </ListValues>
-  </avrgcc.assembler.general.IncludePaths>
-  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-</AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
     <ToolchainSettings>
       <AvrGcc>
-  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-  <avrgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </avrgcc.compiler.symbols.DefSymbols>
-  <avrgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-    </ListValues>
-  </avrgcc.compiler.directories.IncludePaths>
-  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-  <avrgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </avrgcc.linker.libraries.Libraries>
-  <avrgcc.assembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-    </ListValues>
-  </avrgcc.assembler.general.IncludePaths>
-  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-</AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
diff --git a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c
index 4927b99..8ffaa53 100644
--- a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c
+++ b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c
@@ -39,17 +39,25 @@
 #include <avr/sleep.h>
 #include <avr/pgmspace.h>
 #include "../common/I2C/USI_TWI_Master.h"
-#include "../common/I2C/SHT2x.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/owSlave_tools.h"
 
+OWST_EXTERN_VARS
 
-extern void OWINIT();
-extern void EXTERN_SLEEP();
+//#define K_Type
+#define J_Type
 
+#ifdef K_Type
 //const float k_rs[54] PROGMEM ={0.000000,24.125000,48.585366,72.731707,96.829268,121.097561,145.700000,170.600000,195.650000,220.625000,245.365854,269.853659,294.119048,318.195122,342.166667,366.000000,389.761905,413.428571,437.023810,460.558140,484.047619,507.511628,530.976190,554.418605,577.883721,601.395349,624.952381,648.571429,672.285714,696.073171,719.976190,744.000000,768.146341,792.439024,816.853659,841.414634,866.125000,890.975000,916.000000,941.179487,966.525000,992.025641,1017.717949,1043.589744,1069.657895,1095.945946,1122.432432,1149.184211,1176.189189,1203.472222,1231.083333,1259.000000,1287.285714,1315.941176};
 const float k_rs[61] PROGMEM ={ -212.538462, -166.260870, -124.892857, -97.562500, -66.888889, -34.157895, 0.000000, 24.125000, 48.585366, 72.731707, 96.829268, 121.097561, 145.700000, 170.600000, 195.650000, 220.625000, 245.365854, 269.853659, 294.119048, 318.192771, 342.166667, 366.000000, 389.761905, 413.428571, 437.023810, 460.558140, 484.047619, 507.511628, 530.976190, 554.418605, 577.883721, 601.395349, 624.952381, 648.571429, 672.285714, 696.073171, 719.976190, 744.000000, 768.146341, 792.439024, 816.853659, 841.414634, 866.125000, 890.975000, 916.000000, 941.179487, 966.525000, 992.025641, 1017.717949, 1043.589744, 1069.657895, 1095.945946, 1122.432432, 1149.173333, 1176.189189, 1203.472222, 1231.083333, 1259.000000, 1287.285714, 1315.941176, 1344.941176};
 #define k_ofs 6
+#endif
+#ifdef J_Type
+#define k_ofs 0
+//J-Type
+const float k_rs[70] PROGMEM ={0, 18.302913, 34.830476, 50.783019, 70.653704, 90.505455, 110.341818, 130.165455, 149.163636, 160.791071, 180.596364, 200.398214, 220.200000, 240.000000, 250.882883, 270.603636, 290.409091, 310.216364, 330.025455, 342.472727, 360.649091, 380.461818, 400.275000, 420.087273, 435.275676, 450.703636, 470.503636, 490.298214, 510.082456, 523.486726, 540.621053, 560.370175, 580.105172, 591.979487, 610.527119, 630.213559, 644.601653, 660.534426, 680.168852, 690.787097, 710.391935, 729.123810, 740.559375, 760.126562, 770.684615, 790.235385, 800.782812, 820.331250, 834.681250, 850.446032, 870.017460, 880.600000, 900.196774, 911.099187, 930.432787, 950.073333, 960.728333, 980.396667, 1000.078333, 1010.772881, 1030.475862, 1050.187931, 1065.717241, 1080.631034, 1100.358621, 1120.089655, 1131.840000,1150.556897, 1170.294737, 1190.035088};
+#endif
 
-//const float j_rs[70] PROGMEM ={0, 18.302913, 34.830476, 50.783019, 70.653704, 90.505455, 110.341818, 130.165455, 149.163636, 160.791071, 180.596364, 200.398214, 220.200000, 240.000000, 250.882883, 270.603636, 290.409091, 310.216364, 330.025455, 342.472727, 360.649091, 380.461818, 400.275000, 420.087273, 435.275676, 450.703636, 470.503636, 490.298214, 510.082456, 523.486726, 540.621053, 560.370175, 580.105172, 591.979487, 610.527119, 630.213559, 644.601653, 660.534426, 680.168852, 690.787097, 710.391935, 729.123810, 740.559375, 760.126562, 770.684615, 790.235385, 800.782812, 820.331250, 834.681250, 850.446032, 870.017460, 880.600000, 900.196774, 911.099187, 930.432787, 950.073333, 960.728333, 980.396667, 1000.078333, 1010.772881, 1030.475862, 1050.187931, 1065.717241, 1080.631034, 1100.358621, 1120.089655, 1131.840000,1150.556897, 1170.294737, 1190.035088};
 double gettemp_rs(double V) {
 	uint8_t iv=(uint8_t)(V+k_ofs);
 	float t0=pgm_read_float(&(k_rs[iv]));
@@ -66,55 +74,8 @@ uint8_t owid2[8]={0x26, 0xA7, 0xD9, 0x84, 0x00, 0x00, 0x03, 0x20};/**/
 uint8_t config_info1[26]={0x01,0x02 ,0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
 uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,7,0x00,7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
 	
-#if (owid>128) 
-#error "Variable not correct"
-#endif
-
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-volatile uint8_t wdcounter=5;
-
-
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-ISR(WATCHDOG_vect) {
-#else
-ISR(WDT_vect) {
-#endif 
-	//sleep_disable();          // Disable Sleep on Wakeup
-	wdcounter++;
-	if (reset_indicator==1) reset_indicator++;
-	else if (reset_indicator==2) mode=0;
-/*	if (timeout==2) {
-		DIS_TIMER;
-		EN_OWINT;
-		mode=OWM_SLEEP;
-	}
-	timeout++;*/
-	//sleep_enable();           // Enable Sleep Mode
-
-}
-
-int testSW(void) {
-	uint8_t r;
-	DDRB&=~(1<<PORTB0);  //Eingang
-	__asm__ __volatile__ ("nop");
-	PORTB|=(1<<PORTB0); //Pullup
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	__asm__ __volatile__ ("nop");
-	r=PINB&(1<<PORTB0);
-	__asm__ __volatile__ ("nop");
-	PORTB&=~(1<<PORTB0);
-	__asm__ __volatile__ ("nop");
-	DDRB|=(1<<PORTB0);  //Eingang
-	return (r==0);
-	
-	
-}
+OWST_WDT_ISR
+OWST_TESTSW
 
 
 typedef union {
@@ -177,20 +138,19 @@ double ADmess() {
 	return (double)ADC;
 }
 
-volatile int16_t am2302_temp;
-volatile uint16_t am2302_hum;
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+volatile uint16_t DS2438_2_VDD=0x01F4;
 
 
-uint8_t userRegister[1];
-int16_t sRH,sT;
-volatile double temperatureC,humidityRH;
-volatile double l;
 
-uint8_t max_adr=0;
+double temperatureC,humidityRH;
+double TC;
+double l;
 
 int main(void){
-    //PRR|=(1<<PRADC);  // adc for save Power
-	pack1.temp=0x0550;
+	OWST_INIT_ALL_ON
+ 	pack1.temp=0x0550;
 	pack1.config=0x7F;
 	pack1.TH=75;
 	pack1.TL=70;
@@ -198,35 +158,22 @@ int main(void){
 	pack1.rr00=0;
 	pack1.rr10=0x10;
 	PORTA=0xFF-(1<<PINA1)-(1<<PINA2);
-	PORTB=0xFF;
 	OWINIT();
 
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
+	OWST_EN_PULLUP
+	OWST_WDR_CONFIG1	
 
-	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
-	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
-	(1<<WDP2) | (1<<WDP1);   // Set Timeout to ~1 seconds
 	if (testSW()) {
-		config_info2[5]=8;
+		config_info2[5]=12;
 		}else{
 		config_info2[5]=7;
 	}
-	MCUSR=0;
 	USI_TWI_Master_Initialise();
-	SHT2x_SoftReset();
-	SHT2x_ReadUserRegister(userRegister);
-	//(userRegister & ~SHT2x_RES_MASK) | SHT2x_RES_10_13BIT;
-	SHT2x_WriteUserRegister(userRegister); //write changed user reg
-	// --- measure humidity with "Hold Master Mode (HM)" ---
-	SHT2x_MeasurePoll(HUMIDITY, &sRH);
-	// --- measure temperature with "Polling Mode" (no hold master) ---
-	SHT2x_MeasurePoll(TEMP, &sT);
-	//-- calculate humidity and temperature --
-	//temperatureC = SHT2x_CalcTemperatureC(sT);
-	//humidityRH = SHT2x_CalcRH(sRH);
-	
+	initSHT2x();
+		
 	gcontrol=1;
+	for(uint8_t i=0;i<8;i++) pack2.page6[i]=owid1[i];
+	pack2.page3[0]=0xF1;
 	sei();
 	ADCSRA=(1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);
 	//DDRB|=(1<<PINB1);
@@ -247,46 +194,43 @@ int main(void){
 		
 		if (wdcounter>0) {
 			if (par==0) {
-				//PORTB|=(1<<PINB1); //Dauer 440ms
-				SHT2x_MeasurePoll(HUMIDITY, &sRH);
-				// --- measure temperature with "Polling Mode" (no hold master) ---
-				SHT2x_MeasurePoll(TEMP, &sT);
-				//-- calculate humidity and temperature --
-				temperatureC = SHT2x_CalcTemperatureC(sT)*10.0-2;
-				humidityRH = SHT2x_CalcRH(sRH)*10.0+5;
-				if (humidityRH>1000) humidityRH=1000;
+				getSHT2xHumTemp(&temperatureC,&humidityRH);
+				double RH=humidityRH*10.0;
+				 TC =temperatureC *10.0;
+
 				if (testSW()) {
-					am2302_hum= humidityRH*10.0;
-					am2302_temp=temperatureC*25.6;
-					//
-					config_info2[5]=8;
-				}else{
-					double hhum=(1.0546-0.000216*temperatureC)*(humidityRH);
-					//am2302_hum=0.318*hhum +76.0;
-					am2302_hum=0.31*hhum +80;
-					am2302_temp=temperatureC*25.6;
-					//am2302_temp=am2302_temp-45;
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=TC*25.6;
+		
+					config_info2[5]=12;
+					
+					}else{
+					
+					double hhum=(1.0546-0.000216*TC)*(RH);
+					DS2438_2_VAD=0.31*hhum +80;
+					DS2438_2_TEMP=TC*25.6;
 					config_info2[5]=7;
 				}
 			}
+			DS2438_2_VDD=0x01F4;
 			ares[par]=ADmess();
 			par++;
 			if (par>15) par=0;
 			wdcounter=0;
 		}
 	
-		if (gcontrol==1) {
+		if ((gcontrol&1)==1) {
 			gcontrol=0;
 			sum=0;
 			for(uint8_t i=0;i<16;i++) {
 				sum+=ares[i];
 			}
-			V=sum/20.0/1024.0*1.12*1000.0/16.0;//Spannung in mV
+			V=sum/20.0/1024.0*1.18*1000.0/16.0;//Spannung in mV
 			//V=sum/20.0/1024.0*1.01*1000.0/16.0;
 			int16_t htemp;
 			ktemp=gettemp_rs(V);
 			//htemp=(ktemp*16)/10;
-			htemp=(ktemp*16+temperatureC*1.6)/10;
+			htemp=(ktemp*16+TC*1.6)/10;
 
 			int16_t w=htemp;
 			int8_t t8=w>>4;
diff --git a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.atsln b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.atsln
index 2e0e72c..1dd9222 100644
--- a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.atsln
+++ b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.atsln
@@ -1,22 +1,22 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_Thermocouble_DS2438_SHT", "DS18B20_Thermocouble_DS2438_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|AVR = Debug|AVR
-		Release|AVR = Release|AVR
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
-		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
-		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
-		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_Thermocouble_DS2438_SHT", "DS18B20_Thermocouble_DS2438_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj
index 738bf15..752c526 100644
--- a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj
+++ b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj
@@ -34,7 +34,7 @@
   <documentation help="" />
   <offline-documentation help="" />
   <dependencies>
-    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.34.1" />
   </dependencies>
 </framework-data>
     </AsfFrameworkConfig>
@@ -63,6 +63,8 @@
       <ToolName>Simulator</ToolName>
     </com_atmel_avrdbg_tool_simulator>
     <ExternalProgrammingToolCommand />
+    <ResetRule>0</ResetRule>
+    <EraseKey />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
     <ToolchainSettings>
@@ -135,9 +137,9 @@
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="..\common\I2C\SHT2x.c">
+    <Compile Include="..\common\I2C\SHT2xV2.c">
       <SubType>compile</SubType>
-      <Link>SHT2x.c</Link>
+      <Link>SHT2xV2.c</Link>
     </Compile>
     <Compile Include="..\common\I2C\USI_TWI_Master.c">
       <SubType>compile</SubType>
diff --git a/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c b/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c
index 5b3461c..2522a0e 100644
--- a/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c	
+++ b/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c	
@@ -42,9 +42,9 @@
 #include "../common/I2C/USI_TWI_Master.h"
 #include "../common/I2C/SHT2xV2.h"
 #include "../common/calibr.h"
+#include "../common/owSlave_tools.h"
 
-extern void OWINIT(void);
-extern void EXTERN_SLEEP(void);
+OWST_EXTERN_VARS
 
 
 
@@ -58,24 +58,11 @@ volatile uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 11,0x08, 0x0
 #error "Variable not correct"
 #endif
 
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-volatile uint8_t wdcounter=1;
 extern uint8_t cpsp;
 
+OWST_WDT_ISR
 
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-ISR(WATCHDOG_vect) {
-	#else
-	ISR(WDT_vect) {
-		#endif
-		wdcounter++;
-		if (reset_indicator==1) reset_indicator++;
-		else if (reset_indicator==2) mode=0;
 
-}
 
 
 	typedef union {
@@ -155,12 +142,13 @@ ISR(WATCHDOG_vect) {
 
 
 
-	volatile int16_t am2302_temp;
-	volatile uint16_t am2302_hum;
+	volatile int16_t DS2438_2_TEMP;
+	volatile uint16_t DS2438_2_VAD;
+	volatile uint16_t DS2438_2_VDD=0x01F4;
+
+	OWST_TESTSW
 
 
-	uint8_t userRegister[1];
-	int16_t sRH,sT;
 	double temperatureC,humidityRH,hhum;
 	volatile double l;
 
@@ -183,25 +171,6 @@ ISR(WATCHDOG_vect) {
 	double la[4];
 	uint8_t lainit=1;
 
-	int testSW(void) {
-		uint8_t r;
-		DDRB&=~(1<<PORTB0);  //Eingang
-		__asm__ __volatile__ ("nop");
-		PORTB|=(1<<PORTB0); //Pullup
-		__asm__ __volatile__ ("nop");
-		__asm__ __volatile__ ("nop");
-		__asm__ __volatile__ ("nop");
-		__asm__ __volatile__ ("nop");
-		__asm__ __volatile__ ("nop");
-		r=PINB&(1<<PORTB0);
-		__asm__ __volatile__ ("nop");
-		PORTB&=~(1<<PORTB0);
-		__asm__ __volatile__ ("nop");
-		DDRB|=(1<<PORTB0);  //Eingang
-		return (r==0);  //Offen mal HIH4030
-		
-		
-	}
 
 	
 	#define EEPROM_R0 0
@@ -290,7 +259,7 @@ ISR(WATCHDOG_vect) {
 			weekmaxarr[i]=pack2.r_week_max;
 		}
 
-
+		for(uint8_t i=0;i<8;i++) pack2.page6[i]=owid1[i];
 		if (testSW()) {
 			config_info2[5]=12;
 			}else{
@@ -304,27 +273,7 @@ ISR(WATCHDOG_vect) {
 		gcontrol=1;
 		sei();
 		while(1)   {
-			/*if (pack1.config==0x1F) {  //Reset R0
-				pack1.config=0x7F;
-				R0=1;
-				pack2.R0=0;
-				writeEEPROM(EEPROM_R0,0);
-			}
-			if (pack1.config==0x05) {  //Reset all Data
-				pack1.config=0x7F;
-				pack2.r_day_max=1;
-				pack2.r_week_max=1;
-				pack2.tol_d=0;
-				pack2.tol_s8=0;  //Tag faengt mit Einschalten an
-				R0=1;
-				writeEEPROM(EEPROM_R0,0xFF);
-				writeEEPROM(EEPROM_R0d,0xFF);  //Maximum des Tages
-				writeEEPROM(EEPROM_R0w,0xFF); //Maximum der Letzten 7 Tage
-				writeEEPROM(EEPROM_dol,0xFF); //Anzahl der Betriebstage
-				for(uint8_t i=0;i<7;i++) {
-					weekmaxarr[i]=1;
-				}
-			}*/
+			
 			if ((cpsp&0x80)!=0) {
 				if ((cpsp&0x0F)==5) {
 					if (pack2.reset_code==0x01) {
@@ -390,14 +339,13 @@ ISR(WATCHDOG_vect) {
 
 
 				if (testSW()) {
-					am2302_hum=RH;
-					am2302_temp=TC*25.6;
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=TC*25.6;
 					config_info2[5]=12;	//10V = 100%
 				}else{
 					hhum=(1.0546-0.000216*TC)*(RH);
-					//am2302_hum=0.318*hhum +76.0;
-					am2302_hum=0.31*hhum +80;
-					am2302_temp=TC*25.6;
+					DS2438_2_VAD=0.31*hhum +80;
+					DS2438_2_TEMP=TC*25.6;
 					config_info2[5]=7;
 				}
 				mr=0;
@@ -456,7 +404,7 @@ ISR(WATCHDOG_vect) {
 				
 			}
 			
-			if (gcontrol==1) {
+			if ((gcontrol&1)==1) {
 				uint16_t w=l;
 				uint8_t t8=w>>4;
 				uint8_t af=0;
@@ -469,27 +417,13 @@ ISR(WATCHDOG_vect) {
 				sei();
 				EXTERN_SLEEP();
 			}
-			if ((gcontrol==2)||(gcontrol==3)) {
+			if (gcontrol) {
 				gcontrol=0;
 				
 			}
 
 			
-			#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-			#endif
-			#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-			#endif
-			{
-
-				MCUCR|=(1<<SE)|(1<<SM1);
-				MCUCR&=~(1<<ISC01);
-			} else {
-				MCUCR|=(1<<SE);
-				MCUCR&=~(1<<SM1);
-			}
-			asm("SLEEP");
+			OWST_MAIN_END
 		}
 
 
diff --git a/DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.atsln b/DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.atsln
new file mode 100644
index 0000000..7a42d6d
--- /dev/null
+++ b/DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.atsln	
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20_VOC_DS2438_SHT", "DS18B20_VOC_DS2438_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.cproj b/DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.cproj
new file mode 100644
index 0000000..24ea432
--- /dev/null
+++ b/DS18B20_VOC_DS2438_SHT direct/DS18B20_VOC_DS2438_SHT.cproj	
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS18B20_VOC_DS2438_SHT</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <ResetRule>0</ResetRule>
+    <EraseKey />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS18B20_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS18B20_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS18B20_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c
index 09b528d..03d0e68 100644
--- a/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c
+++ b/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c
@@ -456,7 +456,7 @@ int main(void){
 			
 		}
 	
-		if (gcontrol==1) {
+		if ((gcontrol&1)==1) {
 			uint16_t w=l;
 			uint8_t t8=w>>4;
 			uint8_t af=0;
diff --git a/DS2408/DS2408.atsln b/DS2408/DS2408.atsln
new file mode 100644
index 0000000..a06ac81
--- /dev/null
+++ b/DS2408/DS2408.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2408", "DS2408.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2408/DS2408.c b/DS2408/DS2408.c
new file mode 100644
index 0000000..fa738a4
--- /dev/null
+++ b/DS2408/DS2408.c
@@ -0,0 +1,216 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/owSlave_tools.h"
+#include "../common/I2C/SHT3x.h"
+#include "../common/calibr.h"
+
+
+#include <math.h>
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+extern uint8_t stat_to_sample;
+
+uint8_t owid[8]={0x29, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x01, 0x73};/**/
+uint8_t config_info[26]={0x06,0x09,0x06,0x09,0x06,0x09,0x06,0x09,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+OWST_EXTERN_VARS
+
+OWST_WDT_ISR
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		uint8_t PIO_Logic_State;     //		0088h
+		uint8_t PIO_Output_Latch_State;
+		uint8_t PIO_Activity_Latch_State;
+		uint8_t Conditional_Search_Channel_Selection_Mask;
+		uint8_t Conditional_Search_Channel_Polarity_Selection;
+		uint8_t Status; //008D
+		uint8_t FF1;
+		uint8_t FF2;
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+uint8_t values[10];
+uint8_t ap=1;
+
+uint8_t crc8() {
+	uint8_t lscrc=0x0;
+	for(uint8_t i=0;i<5;i++) {
+		uint8_t v=values[i];
+		//if (v==0) v=0xFF;
+		uint8_t bit=1;
+		uint8_t lb;
+		for(uint8_t j=0;j<8;j++) {
+			if ((v&bit)==bit) lb=1; else lb=0;
+			if ((lscrc&1)!=lb)	lscrc=(lscrc>>1)^0x8c; else	lscrc=(lscrc>>1);
+			bit=bit*2;
+		
+		
+		}
+	}
+	return lscrc;
+}
+
+//Umstellung
+
+//rh=(T-25)*(0,01+0,00008*x)-2,0468+0,0367*x-0,0000015955*x*x
+//d1 for 3V
+#define d1 -39.7  
+#define d2 0.01
+inline uint16_t calcSHT75_T(double real_t) {
+	return (real_t-d1)/d2;
+}
+
+inline uint16_t calcSHT75RH_lin(double real_RHlin) {
+	return 11501.1-0.280297*sqrt(1667284153.0-7977500.0*real_RHlin);
+}
+
+inline double calcSHT75H_tcorr(double real_t,double real_RHtrue) {
+	return real_RHtrue-(real_t-25)*(0.01+0.00008*calcSHT75RH_lin(real_RHtrue));
+
+}
+
+
+double T=20.0;
+double RH=60;
+
+int main(void){
+	OWST_INIT_USI_ON;
+	pack.FF1=0xFF;
+	pack.FF2=0xFF;
+	 //0x0E 0x19 0x48 0x00
+	 if (RH<8) RH=8;
+	 uint16_t lt=calcSHT75_T(T);
+		double lfc=calcSHT75H_tcorr(T,RH);
+	 uint16_t lf=calcSHT75RH_lin(lfc);
+	values[0]=0x00;
+	values[1]=lt&0xFF; if (values[1]==0) values[1]=1;
+	values[2]=lt>>8; if (values[2]==0) values[2]=1;
+	values[3]=lf&0xFF; if (values[3]==0) values[3]=1;
+	values[4]=lf>>8; if (values[4]==0) values[4]=1;
+	values[5]=0x5D; 
+		values[1]=8;
+		values[2]=26;
+		values[3]=0;
+		values[4]=5;
+		values[5]=0x5D;
+	values[6]=0x00;
+	values[7]=0x00;
+	values[5]=crc8();	
+	OWINIT();
+
+	TWI_Master_Initialise();
+	initSHT3x(0);
+	_delay_ms(100);
+
+
+	getSHT3xHumTemp(0,&T,&RH);
+	OWST_WDR_CONFIG8;
+	sei();
+	stat_to_sample=0x55;
+	while (1) {
+		//stat_to_sample=0;
+		if (reset_indicator) {
+		//	ap=0;
+		//	stat_to_sample=0;
+		//	reset_indicator=0;
+		}
+		if (wdcounter>3) {
+			
+			wdcounter=0;
+			RH=RH+0.2;
+			getSHT3xHumTemp(0,&T,&RH);
+			lt=calcSHT75_T(T);
+			lfc=calcSHT75H_tcorr(T,RH);
+			lf=calcSHT75RH_lin(lfc);
+		values[0]=0x00;
+		values[1]=lt&0xFF; if (values[1]==0) values[1]=1;
+		values[2]=lt>>8; if (values[2]==0) values[2]=1;
+		values[3]=lf&0xFF; if (values[3]==0) values[3]=1;
+		values[4]=lf>>8; if (values[4]==0) values[4]=1;
+		values[1]=8;
+		values[2]=26;
+		values[3]=0;
+		values[4]=5;
+		values[5]=0x5D;
+		 values[5]=crc8();
+		}
+		pack.Status|=0x80;
+		if (gcontrol&1) {
+			uint8_t bb=1;
+			for(uint8_t i=0;i<8;i++) {
+				if ((pack.PIO_Logic_State&bb)!=(pack.PIO_Output_Latch_State&bb)) pack.PIO_Activity_Latch_State|=bb;
+				bb=bb*2;
+			}
+            pack.PIO_Logic_State=pack.PIO_Output_Latch_State;
+			gcontrol&=~0x01;
+		}
+		if (gcontrol&2) {
+			pack.PIO_Activity_Latch_State=0;
+            gcontrol&=~0x02;
+		}
+		if (gcontrol&4) {
+			stat_to_sample=values[ap];
+			ap++;		
+			if (ap>5) {
+					ap=0;
+			}
+			gcontrol&=~0x04;
+		} 		
+		if (gcontrol&8) {
+			ap=1;
+			stat_to_sample=values[ap];
+			ap++;
+			//if (ap>5) ap=1;
+			gcontrol&=~0x08;
+		} 
+
+		OWST_MAIN_END
+	}
+
+
+
+}
diff --git a/DS2408/DS2408.cproj b/DS2408/DS2408.cproj
new file mode 100644
index 0000000..e840c97
--- /dev/null
+++ b/DS2408/DS2408.cproj
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2408</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+    <ResetRule>0</ResetRule>
+    <EraseKey />
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <custom>
+      <ToolOptions xmlns="">
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType xmlns="">custom</ToolType>
+      <ToolNumber xmlns="">
+      </ToolNumber>
+      <ToolName xmlns="">Custom Programming Tool</ToolName>
+    </custom>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT3x.c">
+      <SubType>compile</SubType>
+      <Link>SHT3x.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2408.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2408.S</Link>
+    </Compile>
+    <Compile Include="DS2408.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2413_DS2413/DS2413_DS2413.atsln b/DS2413_DS2413/DS2413_DS2413.atsln
new file mode 100644
index 0000000..b201cf3
--- /dev/null
+++ b/DS2413_DS2413/DS2413_DS2413.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2413_DS2413", "DS2413_DS2413.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2413_DS2413/DS2413_DS2413.c b/DS2413_DS2413/DS2413_DS2413.c
new file mode 100644
index 0000000..75a63a9
--- /dev/null
+++ b/DS2413_DS2413/DS2413_DS2413.c
@@ -0,0 +1,209 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+#define _CPULLUP_
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>  
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/owSlave_tools.h"
+
+
+//#define FHEM_PLATINE
+#define W1DAQ
+//#define JOE_M
+volatile uint8_t owid1[8]={0x3A, 0x01, 0xDA, 0x84, 0x00, 0x00, 0x05, 0xA3};/**/
+volatile uint8_t owid2[8]={0x3A, 0x02, 0xDA, 0x84, 0x00, 0x00, 0x05, 0xFA};/**/
+uint8_t config_info1[26]={0,0,0,0,0,0,0,0,0x02,0,0,0,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //+2 for CRC
+uint8_t config_info2[26]={0,0,0,0,0,0,0,0,0x02,0,0,0,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //+2 for CRC
+	
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+OWST_EXTERN_VARS
+
+uint8_t pin_state1;
+uint8_t pin_set1;
+uint8_t pin_state2;
+uint8_t pin_set2;
+
+OWST_WDT_ISR
+
+
+#if  defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+#define PCINT_VECTOR PCINT0_vect
+#define PIN_REG PINA
+#define PIN_DDR DDRA
+
+#ifdef FHEM_PLATINE
+#define PIN_PIOA1 (1<<PINA2)
+#define PIN_PIOB1 (1<<PINA1)
+#define PIN_PIOA2 (1<<PINA3)
+#define PIN_PIOB2 (1<<PINA4)
+//LEDS
#define LPIN_CH2 (1<<PINB0)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LPIN_CH3 (1<<PINA5)
#define LDD_CH3 DDRA
#define LPORT_CH3 PORTA
#define LPIN_CH0 (1<<PINA7)
#define LDD_CH0 DDRA
#define LPORT_CH0 PORTA
#define LPIN_CH1 (1<<PINB1)
#define LDD_CH1 DDRB
#define LPORT_CH1 PORTB
+
+#define LED2_ON LPORT_CH2|=LPIN_CH2;
+#endif
+
+#ifdef JOE_M
+#define LED2_ON
+#define PIN_PIOA1 (1<<PINA4)
+#define PIN_PIOB1 (1<<PINA5)
+#define PIN_PIOA2 (1<<PINA6)
+#define PIN_PIOB2 (1<<PINA7)
+#endif
+
+#ifdef W1DAQ
+#define PIN_PIOB1 (1<<PINA1)
+#define PIN_PIOA1 (1<<PINA0)
+#define PIN_PIOB2 (1<<PINA7)
+#define PIN_PIOA2 (1<<PINA3)
+//LEDS
#define LPIN_CH0 (1<<PINB1)
#define LDD_CH0 DDRB
#define LPORT_CH0 PORTB
#define LPIN_CH1 (1<<PINB1)
#define LDD_CH1 DDRB
#define LPORT_CH1 PORTB
#define LPIN_CH2 (1<<PINB1)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LPIN_CH3 (1<<PINB1)
#define LDD_CH3 DDRB
#define LPORT_CH3 PORTB

+#define LED2_ON LPORT_CH2&=~LPIN_CH2;
+#endif
+
+
+
+#endif
+
+
+ISR(PCINT0_vect) {
+//	if (((PIN_REG&PIN_CH2)==0)&&((istat&PIN_CH2)==PIN_CH2)) {	counters1.c32[2]++;	LED2_ON}
+	//if (((PIN_REG&PIN_CH3)==0)&&((istat&PIN_CH3)==PIN_CH3)) {	counters1.c32[3]++;LED2_ON	}
+	if ((PIN_REG&PIN_PIOA1)==0) 	{pin_state1&=~0x1;LED2_ON} else { pin_state1|=0x01;}
+	if ((PIN_REG&PIN_PIOB1)==0) 	{pin_state1&=~0x4;LED2_ON} else {pin_state1|=0x04;}
+	if ((PIN_REG&PIN_PIOA2)==0) 	{pin_state2&=~0x1;LED2_ON} else {pin_state2|=0x01;}
+	if ((PIN_REG&PIN_PIOB2)==0) 	{pin_state2&=~0x4;LED2_ON} else {pin_state2|=0x04;}
+	//Reset Switch on the FHEM_BOARD
+		GIFR|=(1<<PCIF0);



+}
+
+
+
+
+
+int main(void){
+	OWST_INIT_ALL_OFF
+	OWINIT();
+	
+
+#if  defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+
+    OWST_WDR_CONFIG4
+	
+#ifndef _CPULLUP_  // pullup
+	PORTA&=~(PIN_PIOA1|PIN_PIOB1);
+	PORTA&=~(PIN_PIOA2|PIN_PIOB2);
+#endif
+
+#ifdef FHEM_PLATINE  //LEDs
+	LDD_CH0|=LPIN_CH0;
	LPORT_CH0&=~LPIN_CH0;
	LDD_CH1|=LPIN_CH1;
	LPORT_CH1&=~LPIN_CH1;
	LDD_CH2|=LPIN_CH2;
	LPORT_CH2&=~LPIN_CH2;
	LDD_CH3|=LPIN_CH3;
	LPORT_CH3&=~LPIN_CH3;
+#endif
+#ifdef W1DAQ
+	LDD_CH2|=LPIN_CH2;
	LPORT_CH2&=~LPIN_CH2;
#endif
+
+
+	GIMSK|=(1<<PCIE0);
+	PCMSK0=(PIN_PIOA1|PIN_PIOB1|PIN_PIOA2|PIN_PIOB2); //Nicht ganz korrekt aber die Bits liegen gleich
+
+	
+	
+	#endif
+	
+	OWST_EN_PULLUP
+	
+	
+#ifdef FHEM_PLATINE
+
+	LPORT_CH0|=LPIN_CH0;
	_delay_ms(500);
	LPORT_CH0&=~LPIN_CH0;
+#endif
+	pin_set1=0x0F;
+	pin_set2=0x0F;
+	//pin_state1=0x00;
+	//pin_state2=0x00;
+	sei();
+	while(1)   {
+
+		if (pin_set1&1) {
+			DDRA&=~(PIN_PIOA1); //Eingang
+			PORTA|=(PIN_PIOA1); //Pullup
+			pin_state1|=2;
+		} else {
+			DDRA|=(PIN_PIOA1); //Ausgang
+			PORTA&=~(PIN_PIOA1); //Gegen masse
+			pin_state1&=~2;
+		}
+		if (pin_set1&2) {
+			pin_state1|=8;
+			DDRA&=~(PIN_PIOB1); //Eingang
+			PORTA|=(PIN_PIOB1); //Pullup
+			} else {
+			DDRA|=(PIN_PIOB1); //Ausgang
+			PORTA&=~(PIN_PIOB1); //Gegen masse
+			pin_state1&=~8;
+		}
+		if (pin_set2&1) {
+			pin_state2|=2;
+			DDRA&=~(PIN_PIOA2); //Eingang
+			PORTA|=(PIN_PIOA2); //Pullup
+			} else {
+			DDRA|=(PIN_PIOA2); //Ausgang
+			PORTA&=~(PIN_PIOA2); //Gegen masse
+			pin_state2&=~2;
+		}
+		if (pin_set2&2) {
+			DDRA&=~(PIN_PIOB2); //Eingang
+			PORTA|=(PIN_PIOB2); //Pullup
+			pin_state2|=8;
+			} else {
+			DDRA|=(PIN_PIOB2); //Ausgang
+			PORTA&=~(PIN_PIOB2); //Gegen masse
+			pin_state2&=~8;
+		}
+#ifdef FHEM_PLATINE
+		if (LPORT_CH2&LPIN_CH2) {
			_delay_ms(50);
			LPORT_CH2&=~LPIN_CH2;
		}
+		if (LPORT_CH1&LPIN_CH1) {
			_delay_ms(50);
			LPORT_CH1&=~LPIN_CH1;
		}
+#endif
+#ifdef W1DAQ
+		if ((LPORT_CH2&LPIN_CH2)==0) {
			_delay_ms(50);
			LPORT_CH2|=LPIN_CH2;
		}
+#endif
+		OWST_MAIN_END 
+	}
+
+
+}
+
diff --git a/DS2413_DS2413/DS2413_DS2413.cproj b/DS2413_DS2413/DS2413_DS2413.cproj
new file mode 100644
index 0000000..b5269f4
--- /dev/null
+++ b/DS2413_DS2413/DS2413_DS2413.cproj
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS2413_DS2413</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>0</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>ISP</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\OWDS2413_DS2413.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2413_DS2413.S</Link>
+    </Compile>
+    <Compile Include="DS2413_DS2413.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2423_DS2413/DS2423_DS2413.c b/DS2423_DS2413/DS2423_DS2413.c
index a44b62b..bac5365 100644
--- a/DS2423_DS2413/DS2423_DS2413.c
+++ b/DS2423_DS2413/DS2423_DS2413.c
@@ -42,7 +42,9 @@
 
 extern void OWINIT(void);
 extern void EXTERN_SLEEP(void);
-#define FHEM_PLATINE
+//#define FHEM_PLATINE
+//#define JOE_M
+#define W1DAQ
 
 volatile uint8_t owid1[8]={0x1D, 0x1D, 0xDA, 0x84, 0x00, 0x00, 0x05, 0xD9};/**/
 volatile uint8_t owid2[8]={0x3A, 0x3A, 0xDA, 0x84, 0x00, 0x00, 0x05, 0xB6};/**/
@@ -102,12 +104,28 @@ volatile uint8_t changefromeeprom;
 //LEDS
#define LPIN_CH2 (1<<PINB0)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LPIN_CH3 (1<<PINA5)
#define LDD_CH3 DDRA
#define LPORT_CH3 PORTA
#define LPIN_CH0 (1<<PINA7)
#define LDD_CH0 DDRA
#define LPORT_CH0 PORTA
#define LPIN_CH1 (1<<PINB1)
#define LDD_CH1 DDRB
#define LPORT_CH1 PORTB
 
 #define LED2_ON LPORT_CH2|=LPIN_CH2;
-#else
+
+#endif
+
+#ifdef JOE_M
 #define LED2_ON
 #define PIN_CH2 (1<<PINA4)
 #define PIN_CH3 (1<<PINA5)
-#define PIN_PIOA (1<<PINA6)
-#define PIN_PIOB (1<<PINA7)
+#define PIN_CH0 (1<<PINA6)
+#define PIN_CH1 (1<<PINA7)
+#define PIN_PIOA PIN_CH0
+#define PIN_PIOB  PIN_CH1
+#endif
+
+#ifdef W1DAQ
+#define PIN_CH3 (1<<PINA1)
+#define PIN_CH2 (1<<PINA0)
+#define PIN_CH1 (1<<PINA7)
+#define PIN_CH0 (1<<PINA3)
+#define PIN_PIOA PIN_CH0
+#define PIN_PIOB  PIN_CH1
+//LEDS
#define LPIN_CH0 (1<<PINB1)
#define LDD_CH0 DDRB
#define LPORT_CH0 PORTB
#define LPIN_CH1 (1<<PINB1)
#define LDD_CH1 DDRB
#define LPORT_CH1 PORTB
#define LPIN_CH2 (1<<PINB1)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LPIN_CH3 (1<<PINB1)
#define LDD_CH3 DDRB
#define LPORT_CH3 PORTB

+#define LED2_ON LPORT_CH2&=~LPIN_CH2;
 #endif
 
 #define TEST_TIMER  ((TIMSK0 & (1<<TOIE0))==0)
@@ -187,7 +205,7 @@ int main(void){
 	PORTA&=~(PIN_CH2|PIN_CH3);
 	#endif
 
-	#ifdef FHEM_PLATINE  //LEDs
+	#if defined(FHEM_PLATINE) || defined(W1DAQ)  //LEDs
 	LDD_CH0|=LPIN_CH0;
	LPORT_CH0&=~LPIN_CH0;
	LDD_CH1|=LPIN_CH1;
	LPORT_CH1&=~LPIN_CH1;
	LDD_CH2|=LPIN_CH2;
	LPORT_CH2&=~LPIN_CH2;
	LDD_CH3|=LPIN_CH3;
	LPORT_CH3&=~LPIN_CH3;
 	#endif
 
@@ -240,7 +258,11 @@ int main(void){
 
 	LPORT_CH0|=LPIN_CH0;
	_delay_ms(500);
	LPORT_CH0&=~LPIN_CH0;
 #endif
+#ifdef W1DAQ
+LPORT_CH0&=~LPIN_CH0;
+_delay_ms(500);
LPORT_CH0|=LPIN_CH0;
#endif
 	pin_state=0x0F;
+	pin_set=0;
 	sei();
 	while(1)   {
 
@@ -265,6 +287,9 @@ int main(void){
 		if (LPORT_CH2&LPIN_CH2) {
			_delay_ms(50);
			LPORT_CH2&=~LPIN_CH2;
		}
 		if (LPORT_CH1&LPIN_CH1) {
			_delay_ms(50);
			LPORT_CH1&=~LPIN_CH1;
		}
 #endif
+#ifdef W1DAQ
+if ((LPORT_CH2&LPIN_CH2)==0) {
	_delay_ms(50);
	LPORT_CH2|=LPIN_CH2;
}
+#endif
 #ifndef FHEM_PLATINE
 		if ((PINB&(1<<PORTB0))==0) {  //Jumper gesetzt ->Ruecksetzen
 			for (uint8_t i=2;i<4;i++) {
diff --git a/DS2423_DS2423/DS2423_DS2423.c b/DS2423_DS2423/DS2423_DS2423.c
index 1dbd395..9166850 100644
--- a/DS2423_DS2423/DS2423_DS2423.c
+++ b/DS2423_DS2423/DS2423_DS2423.c
@@ -43,7 +43,10 @@
 extern void OWINIT(void);
 extern void EXTERN_SLEEP(void);
 
+
 //#define FHEM_PLATINE
+//#define JOE_M
+#define W1DAQ
 
 volatile uint8_t owid1[8]={0x1D, 0x40, 0xDA, 0x84, 0x00, 0x00, 0x05, 0xBD};/**/
 volatile uint8_t owid2[8]={0x1D, 0x41, 0xDA, 0x84, 0x00, 0x00, 0x05, 0x8A};/**/
@@ -102,7 +105,9 @@ volatile uint8_t changefromeeprom;
 //LEDS
#define LPIN_CH2 (1<<PINB0)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LPIN_CH3 (1<<PINA5)
#define LDD_CH3 DDRA
#define LPORT_CH3 PORTA
#define LPIN_CH0 (1<<PINA7)
#define LDD_CH0 DDRA
#define LPORT_CH0 PORTA
#define LPIN_CH1 (1<<PINB1)
#define LDD_CH1 DDRB
#define LPORT_CH1 PORTB
 
 #define LED2_ON LPORT_CH2|=LPIN_CH2;
-#else
+#endif
+
+#ifdef JOE_M
 #define LED2_ON
 #define PIN_CH2 (1<<PINA4)
 #define PIN_CH3 (1<<PINA5)
@@ -110,6 +115,16 @@ volatile uint8_t changefromeeprom;
 #define PIN_CH1 (1<<PINA7)
 #endif
 
+#ifdef W1DAQ
+#define PIN_CH3 (1<<PINA1)
+#define PIN_CH2 (1<<PINA0)
+#define PIN_CH1 (1<<PINA7)
+#define PIN_CH0 (1<<PINA3)
+//LEDS
#define LPIN_CH0 (1<<PINB1)
#define LDD_CH0 DDRB
#define LPORT_CH0 PORTB
#define LPIN_CH1 (1<<PINB1)
#define LDD_CH1 DDRB
#define LPORT_CH1 PORTB
#define LPIN_CH2 (1<<PINB1)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LPIN_CH3 (1<<PINB1)
#define LDD_CH3 DDRB
#define LPORT_CH3 PORTB

+#define LED2_ON LPORT_CH2&=~LPIN_CH2;
+#endif
+
+
 #define TEST_TIMER  ((TIMSK0 & (1<<TOIE0))==0)
 
 #endif
@@ -164,6 +179,9 @@ ISR(ANA_COMP_vect) {
 			CLKPR=0;
 #ifdef FHEM_PLATINE
 			LPORT_CH1|=LPIN_CH1;
+#endif
+#ifdef W1DAQ
+			LPORT_CH1&=~LPIN_CH1;
 #endif
 			GIFR|=(1<<INTF0);
 		}
@@ -202,7 +220,7 @@ int main(void){
 	PORTA&=~(PIN_CH2|PIN_CH3);
 	#endif
 
-	#ifdef FHEM_PLATINE  //LEDs
+	#if defined(FHEM_PLATINE) || defined(W1DAQ)  //LEDs
 	LDD_CH0|=LPIN_CH0;
	LPORT_CH0&=~LPIN_CH0;
	LDD_CH1|=LPIN_CH1;
	LPORT_CH1&=~LPIN_CH1;
	LDD_CH2|=LPIN_CH2;
	LPORT_CH2&=~LPIN_CH2;
	LDD_CH3|=LPIN_CH3;
	LPORT_CH3&=~LPIN_CH3;
 	#endif
 
@@ -249,16 +267,16 @@ int main(void){
 	//ACSR|=(1<<ACD);  //Disable Comparator
 	ADCSRB|=(1<<ACME); //Disable Analog multiplexer
 	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	#ifdef FHEM_PLATINE
+#ifdef FHEM_PLATINE
 	DIDR0|=(1<<ADC0D);
 	PORTA&=~(1<<PINA0);//Disable Pullup
-	#else
+#else
 	DIDR0|=(1<<ADC2D)|(1<<ADC1D); // Disable Digital input on Analog AIN0/AIN1  (PINA1 / PINA2)
 	PORTA&=~(1<<PINA2); //AIN1
-	#endif
+#endif
 	ACSR&=~(1<<ACD);
 	ACSR|=(1<<ACIE)|(1<<ACIS1)|(1<<ACIS0)|(1<<ACBG); //Enabble comperator interrupt Rising edge....(1<<ACIS0) -> minus of Comperator falls down -> output of Comperator rises
-	#ifdef FHEM_PLATINE
+#ifdef FHEM_PLATINE
 	//Switch std AIN1 to A0
 	ADCSRA&=~(1<<ADEN);
 	ADCSRB=(1<<ACME);
@@ -268,14 +286,20 @@ int main(void){
 
 
 	LPORT_CH0|=LPIN_CH0;
	_delay_ms(500);
	LPORT_CH0&=~LPIN_CH0;
-	#endif
+#endif
+#ifdef W1DAQ
+	LPORT_CH0&=~LPIN_CH0;
+	_delay_ms(500);
	LPORT_CH0|=LPIN_CH0;
#endif
 	sei();
 	while(1)   {
-		#ifdef FHEM_PLATINE
+#ifdef FHEM_PLATINE
 		if (LPORT_CH2&LPIN_CH2) {
			_delay_ms(50);
			LPORT_CH2&=~LPIN_CH2;
		}
 		if (LPORT_CH1&LPIN_CH1) {
			_delay_ms(50);
			LPORT_CH1&=~LPIN_CH1;
		}
-		#endif
-		#ifndef FHEM_PLATINE
+#endif
+#ifdef W1DAQ
+		if ((LPORT_CH2&LPIN_CH2)==0) {
			_delay_ms(50);
			LPORT_CH2|=LPIN_CH2;
		}
+#endif
+#ifndef FHEM_PLATINE
 		if ((PINB&(1<<PORTB0))==0) {  //Jumper gesetzt ->Ruecksetzen
 			if ((counters1.c32[2]!=0)||(counters1.c32[3]!=0)||(counters2.c32[2]!=0)||(counters2.c32[3]!=0)) {
 				counters1.c32[0]++;
				counters2.c32[0]++;
				for (uint8_t i=2;i<4;i++) {
@@ -286,9 +310,20 @@ int main(void){
 			}
 		}
 		#endif
+		if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
+			MCUCR|=(1<<SE)|(1<<SM1);
+			
+			MCUCR&=~(1<<ISC01);
+			} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+
+/*
 		MCUCR|=(1<<SE);
 		MCUCR&=~(1<<SM1);
-		asm("SLEEP");
+		asm("SLEEP");*/
 	}
 
 
diff --git a/DS2438_ADC/DS2438_ADC.atsln b/DS2438_ADC/DS2438_ADC.atsln
new file mode 100644
index 0000000..380f865
--- /dev/null
+++ b/DS2438_ADC/DS2438_ADC.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_ADC", "DS2438_ADC.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_ADC/DS2438_ADC.c b/DS2438_ADC/DS2438_ADC.c
new file mode 100644
index 0000000..625dd0b
--- /dev/null
+++ b/DS2438_ADC/DS2438_ADC.c
@@ -0,0 +1,191 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x26, 0xA3, 0xD9, 0x84, 0xDD, 0xDD, 0x05, 0xF9};/**/
+uint8_t config_info[26]={0x01,0x06, 0x05,0x08, 0x06,0x08, 0x00,0x00, 0x02,0x09,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint8_t wdcounter;
+
+
+typedef union {
+
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+
+
+volatile uint8_t am2302_mode=0;
+volatile uint8_t timeout=0;
+
+
+
+
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+volatile double temperatureC,humidityRH;
+volatile double l;
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+	#else
+ISR(WDT_vect) {
+	#endif
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+	
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	__asm__ __volatile__ ("nop");
+	PORTB|=(1<<PORTB0); //Pullup
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	r=PINB&(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	PORTB&=~(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);
+}
+
+
+
+
+
+
+
+
+	int main(void){
+		PRR|=(1<<PRUSI);   //  usi for save Power
+		PORTA=0xFF-(1<<PORTA5);  
+		PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+		DDRB|=(1<<PORTB0); //Als Ausgang und 0
+		
+		
+		OWINIT();
+
+		ACSR|=(1<<ACD);  //Disable Comparator
+		//ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+		MCUCR &=~(1<<PUD); //All Pins Pullup...
+		MCUCR |=(1<<BODS);
+		ADCSRA=(1<<ADEN)|(1<ADPS0)|(1<<ADPS2);
+		DIDR0|=(1<<ADC5D);
+		ADMUX=5; //VCC as ref
+		PORTA&=~(1<<PORTA5);  
+		// Set up Watch Dog Timer for Inactivity
+		WDTCSR |= (1<<WDCE) ;   // Enable the WD Change Bit
+		WDTCSR =   (1<<WDIE) |              // Enable WDT Interrupt
+			(1<<WDP2) | (1<<WDP1);   // Set Timeout to ~2 seconds		
+		
+		
+		sei();
+		
+		while(1)   {
+			if (gcontrol) {
+				wdcounter=16;
+				gcontrol=0;
+			}
+			if (wdcounter>=16) {
+				uint16_t sum=0;
+				for(uint8_t i=0;i<16;i++) {
+					ADCSRA|=(1<<ADSC);
+					while ((ADCSRA&(1<<ADSC)));
+					sum=sum+ADC;
+				}
+				//5V=0x03FF0 (16 x 0x3FF)  5V=50C 50C = 50*256
+				am2302_temp=sum*0.782;
+				am2302_hum=sum/32.736;
+				wdcounter=0;
+			}
+			
+			
+
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
+				MCUCR|=(1<<SE)|(1<<SM1);
+				MCUCR&=~(1<<ISC01);
+				} else {
+				MCUCR|=(1<<SE);
+				MCUCR&=~(1<<SM1);
+			}
+			asm("SLEEP");
+		}
+
+
+	}
\ No newline at end of file
diff --git a/DS2438_ADC/DS2438_ADC.cproj b/DS2438_ADC/DS2438_ADC.cproj
new file mode 100644
index 0000000..b7770fe
--- /dev/null
+++ b/DS2438_ADC/DS2438_ADC.cproj
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2438_DHT22</AssemblyName>
+    <Name>DS2438_ADC</Name>
+    <RootNamespace>DS2438_DHT22</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\OWDS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_ADC.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.atsln b/DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.atsln
new file mode 100644
index 0000000..0427374
--- /dev/null
+++ b/DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_ADC_DS2438_ADC", "DS2438_ADC_DS2438_ADC.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.cproj b/DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.cproj
new file mode 100644
index 0000000..c3e44e3
--- /dev/null
+++ b/DS2438_ADC_DS2438_ADC/DS2438_ADC_DS2438_ADC.cproj
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS2438_ADC_DS2438_ADC</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\OWDS2438_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_ADC_DS2438_ADC/DS2438_DS2438.c b/DS2438_ADC_DS2438_ADC/DS2438_DS2438.c
new file mode 100644
index 0000000..b9a7040
--- /dev/null
+++ b/DS2438_ADC_DS2438_ADC/DS2438_DS2438.c
@@ -0,0 +1,241 @@
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>  
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/owSlave_tools.h"
+
+
+OWST_EXTERN_VARS
+OWST_WDT_ISR
+
+
+//#define W1DAQ
+#define JOE_M
+volatile uint8_t owid1[8]={0x26, 0x61, 0xDA, 0x84, 0x00, 0x00, 0x03, 0x43};/**/
+volatile uint8_t owid2[8]={0x26, 0x62, 0xDA, 0x84, 0x00, 0x00, 0x03, 0x1A};/**/
+volatile uint8_t config_info1[26]={6,6,6,0x08, 6,8, 0x00,0x00, 0x02,20,20,20,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+volatile uint8_t config_info2[26]={6,6, 6,0x08,6,8, 0,0, 0x02,20,20,20,0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+	
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+#ifdef JOE_M
+#define PIN_PIOA1 (1<<PINA4)
+#define ADMA1 PINA4
+#define PIN_PIOB1 (1<<PINA5)
+#define ADMB1 PINA5
+#define PIN_PIOA2 (1<<PINA6)
+#define ADMA2 PINA6
+#define PIN_PIOB2 (1<<PINA7)
+#define ADMB2 PINA7
+#define ADDIFF1 0b011010
+#define ADDIFF1G 0b011011
+#define ADDIFF2 0b011110
+#define ADDIFF2G 0b011111
+#endif
+
+#ifdef W1DAQ
+#define PIN_PIOB1 (1<<PINA1)
+#define ADMB1 PINA1
+#define PIN_PIOA1 (1<<PINA0)
+#define ADMA1 PINA0
+#define PIN_PIOB2 (1<<PINA7)
+#define ADMB2 PINA7
+#define PIN_PIOA2 (1<<PINA3)
+#define ADMA2 PINA3
+#define ADDIFF1 0b001000
+#define ADDIFF1G 0b001001
+#define ADDIFF2 0b011000
+#define ADDIFF2G 0b011001
+
+#endif
+
+
+
+
+
+typedef union {
+	#if  defined(__AVR_ATtiny25__)
+	volatile uint8_t bytes[16];
+	#else
+	volatile uint8_t bytes[64];
+	#endif
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		#if  defined(__AVR_ATtiny25__)
+		#else
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		
+		#endif
+	};
+} pack_t;
+volatile pack_t pack2,pack1;
+
+
+
+volatile int16_t DS2438_1_TEMP;
+volatile uint16_t DS2438_1_VAD;
+volatile uint16_t DS2438_1_VDD;
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+volatile uint16_t DS2438_2_VDD;
+
+OWST_ADC_CONF16_FUNC
+OWST_ADC_CONF16_OSS_FUNC
+OWST_TESTSW
+
+
+int main(void){
+	 OWST_INIT_ADC_ON 
+	pack2.page3[0]=0xF4;//Spannung
+	pack1.page3[0]=0xF4; //Spannung
+	OWINIT();
+	OWST_WDR_CONFIG4
+	OWST_EN_PULLUP
+	
+	PORTA&=~((PIN_PIOA1)|(PIN_PIOB1)|(PIN_PIOA2)|(PIN_PIOB2));
+	OWST_INIT_ADC
+	DIDR0=(PIN_PIOA1)|(PIN_PIOB1)|(PIN_PIOA2)|(PIN_PIOB2);
+
+	//ADCSRB|=(1<<ADLAR);	Adiust left
+	volatile double VCC;
+	volatile double VAD_A,VAD_B,VAD_C,VAD_D;
+	
+	gcontrol=1;
+	sei();
+    while(1)   {
+		if (gcontrol) {
+			wdcounter=3;
+			gcontrol=0;
+				
+		}
+		if (wdcounter>2) { 
+			
+			wdcounter=0;
+			ADMUX=OWST_ADCIN_REFINT;
+			_delay_us(100);
+			VCC=owst_ADC_runf();
+			VCC=(1.079*65472.0)/VCC;
+			DS2438_2_VDD=VCC*100;
+			DS2438_1_VDD=VCC*100;
+
+			if (testSW()) {
+				ADMUX= ADDIFF1; //ADC0 + ADC1 - Gain 1
+				_delay_us(100);
+				VAD_A=owst_ADC_runf();
+				if (VAD_A<3100) {
+					ADMUX= ADDIFF1G; //ADC0 + ADC1 - Gain 20
+					_delay_us(100);
+					VAD_A=owst_ADC_runf();
+					VAD_A=VCC/20.0*VAD_A/65472.0;
+				} else {
+					VAD_A=owst_ADC_OSS_runf();
+					VAD_A=VCC*VAD_A/65472.0;
+				}
+				DS2438_1_VAD=VAD_A*100;
+				DS2438_1_TEMP=VAD_A*256;
+
+				ADMUX= ADDIFF2; //ADC0 + ADC1 - Gain 1
+				_delay_us(100);
+				VAD_B=owst_ADC_runf();
+				if (VAD_B<3100) {
+					ADMUX= ADDIFF2G; //ADC0 + ADC1 - Gain 20
+					_delay_us(100);
+					VAD_B=owst_ADC_runf();
+					VAD_B=VCC/20.0*VAD_B/65472.0;
+					} else {
+					VAD_B=owst_ADC_OSS_runf();
+					VAD_B=VCC*VAD_B/65472.0;
+				}
+				DS2438_2_VAD=VAD_B*100;
+				DS2438_2_TEMP=VAD_B*256;
+
+
+
+			} else {
+				ADMUX=ADMA1;
+				_delay_us(100);
+				VAD_A=owst_ADC_OSS_runf();
+				VAD_A=VCC*VAD_A/65472.0;
+				DS2438_1_TEMP=VAD_A*256;
+				
+				ADMUX=ADMB1;
+				_delay_us(100);
+				VAD_B=owst_ADC_OSS_runf();
+				VAD_B=VCC*VAD_B/65472.0;
+				DS2438_1_VAD=VAD_B*100;
+				
+				ADMUX=ADMA2;
+				_delay_us(100);
+				VAD_C=owst_ADC_OSS_runf();
+				VAD_C=VCC*VAD_C/65472.0;
+				DS2438_2_TEMP=VAD_C*256;
+				
+				ADMUX=ADMB2;
+				_delay_us(100);
+				VAD_D=owst_ADC_OSS_runf();
+				VAD_D=VCC*VAD_D/65472.0;
+				DS2438_2_VAD=VAD_D*100;
+			}
+			
+		
+
+			
+		}
+	
+		
+		OWST_MAIN_END
+   }
+
+
+}
diff --git a/DS2438_CDM7160/DS2438_CDM7160.atsln b/DS2438_CDM7160/DS2438_CDM7160.atsln
new file mode 100644
index 0000000..6121562
--- /dev/null
+++ b/DS2438_CDM7160/DS2438_CDM7160.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_CDM7160", "DS2438_CDM7160.cproj", "{91468D4F-8AE2-4C59-8A35-549C49E00934}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.ActiveCfg = Debug|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.Build.0 = Debug|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.ActiveCfg = Release|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_CDM7160/DS2438_CDM7160.c b/DS2438_CDM7160/DS2438_CDM7160.c
new file mode 100644
index 0000000..7fc2e0a
--- /dev/null
+++ b/DS2438_CDM7160/DS2438_CDM7160.c
@@ -0,0 +1,180 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/CDM7160.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x88, 0x00, 0x00, 0x05, 0x04};/**/
+uint8_t config_info[26]={10,13, 0x05,0x08, 10,22, 0x00,0x00, 0x02,0x07,0x00,0x07,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+	
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint8_t wdcounter=5;
+
+
+typedef union {
+
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+uint8_t userRegister[1];
+double temperatureC,humidityRH;
+volatile double l;
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+
+
+}
+
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB|=(1<<PORTB0); //Pullup
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 r=PINB&(1<<PORTB0);
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB&=~(1<<PORTB0); 
+	 __asm__ __volatile__ ("nop"); 
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);
+	 
+	 
+}
+
+int main(void){
+     PRR|=(1<<PRADC);  // adc for save Power
+	PORTA=0xFF;
+	PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+	DDRB|=(1<<PORTB0); //Als Ausgang und 0
+	
+	
+	OWINIT();
+
+	ACSR|=(1<<ACD);  //Disable Comparator
+	ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+
+	
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+
+    uint8_t i;
+    for(i=0;i<64;i++) pack.bytes[i]=0;
+	pack.page3[0]=0xF4;
+	MCUSR=0;
+	USI_TWI_Master_Initialise();
+	CDM7160softReset();
+	_delay_ms(200);
+
+	CDM7160setMode(0); //Power Down Mode
+	_delay_ms(200);
+	CDM7160setAvCount(0x3F);
+	CDM7160setFMode(1);
+	am2302_temp=CDM7160getCO2();
+	CDM7160setMode(1);
+	_delay_ms(200);	
+	sei();
+	
+	 while(1)   { 
+		 if (gcontrol) {
+			 wdcounter=3;
+			 gcontrol=0;
+		 }
+		 if (wdcounter>2) {
+			am2302_temp=CDM7160getCO2();
+			am2302_hum=am2302_temp/10;
+			 wdcounter=0;
+		 }
+
+		if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+	}
+
+
+}
\ No newline at end of file
diff --git a/DS2438_CDM7160/DS2438_CDM7160.cproj b/DS2438_CDM7160/DS2438_CDM7160.cproj
new file mode 100644
index 0000000..988dc8e
--- /dev/null
+++ b/DS2438_CDM7160/DS2438_CDM7160.cproj
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{91468d4f-8ae2-4c59-8a35-549c49e00934}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2438_SHT2X</AssemblyName>
+    <Name>DS2438_CDM7160</Name>
+    <RootNamespace>DS2438_SHT2X</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\CDM7160.c">
+      <SubType>compile</SubType>
+      <Link>CDM7160.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_CDM7160.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.atsln b/DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.atsln
new file mode 100644
index 0000000..8f8ecf9
--- /dev/null
+++ b/DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_CDM7160_DS2438_BMP280", "DS2438_CDM7160_DS2438_BMP280.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.componentinfo.xml b/DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.componentinfo.xml
new file mode 100644
index 0000000..52c412d
--- /dev/null
+++ b/DS2438_CDM7160_DS2438_BMP280/DS2438_CDM7160_DS2438_BMP280.componentinfo.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents />
+</Store>
\ No newline at end of file
diff --git a/DS2438_CDM7160_DS2438_BMP280/DS2438_DS2438.c b/DS2438_CDM7160_DS2438_BMP280/DS2438_DS2438.c
new file mode 100644
index 0000000..ffc5e8b
--- /dev/null
+++ b/DS2438_CDM7160_DS2438_BMP280/DS2438_DS2438.c
@@ -0,0 +1,187 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>  
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/BMP280.h"
+#include "../common/I2C/CDM7160.h"
+#include "../common/owSlave_tools.h"
+
+
+OWST_EXTERN_VARS
+
+
+
+volatile uint8_t owid1[8]={0x26, 0x01, 0x01, 0x01, 0x00, 0x00, 0x03, 0xF6};/**/
+volatile uint8_t owid2[8]={0x26, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xAF};/**/
+volatile uint8_t config_info1[26]={1,6, 10,8, 10,8, 0x00,0x00, 0x02,14,16,16,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+volatile uint8_t config_info2[26]={1,6, 2,8, 2,8, 0,0           , 0x02,14,14,14,0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+	
+
+
+typedef union {
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+			
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		
+	};
+} pack1_t;
+volatile pack1_t pack1;
+
+
+
+
+typedef union {
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8]; //25
+		uint8_t page7[8];  //57
+		
+	};
+} pack2_t;
+volatile pack2_t pack2;
+
+OWST_WDT_ISR
+OWST_TESTSW
+
+
+
+
+
+volatile int16_t DS2438_1_TEMP;
+volatile uint16_t DS2438_1_VAD;
+volatile uint16_t DS2438_1_VDD;
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+volatile uint16_t DS2438_2_VDD;
+
+
+
+double temperatureC,humidityRH,hhum;
+double l;
+uint32_t P;
+int32_t t;
+uint8_t max_adr=0;
+int16_t CO2;
+
+
+int main(void){
+	OWST_INIT_USI_ON
+	OWINIT();
+	OWST_WDR_CONFIG8
+	OWST_EN_PULLUP
+	
+	pack1.page3[0]=0xF1;
+	pack2.page3[0]=0xF4;
+
+	TWI_Master_Initialise();
+	CDM7160softReset();
+	_delay_ms(200);
+
+	CDM7160setMode(0); //Power Down Mode
+	_delay_ms(200);
+	CDM7160setAvCount(0x3F);
+	CDM7160setFMode(1);
+	CO2=CDM7160getCO2();
+	CDM7160setMode(1);
+	_delay_ms(200);
+
+	bmp280Init();
+
+
+
+
+	gcontrol=1;
+	sei();
+
+    while(1)   {
+		if (gcontrol) wdcounter=4;
+		if (wdcounter>3) {  //8s
+			wdcounter=0;
+			bmp280ConvertInt(&t,&P,1);
+			_delay_ms(100);
+			CO2=CDM7160getCO2()-35;
+			double cc=(double)CO2/(P/101300.0*298.0/(273.0+t/100.0));
+			DS2438_2_TEMP=t/100.0*256.0;
+			DS2438_1_TEMP=CO2;
+			DS2438_1_VDD=cc/10;
+			DS2438_1_VAD=(cc-DS2438_1_VDD*10)*100;
+			DS2438_2_VDD=P/1000;
+			DS2438_2_VAD=(P-DS2438_2_VDD*1000);
+
+			
+		}
+	
+		if (gcontrol) {
+			gcontrol=0;
+		}
+
+		
+		OWST_MAIN_END
+   }
+
+
+}
diff --git a/DS2438_DHT11/DS2438_DHT22.atsln b/DS2438_DHT11/DS2438_DHT22.atsln
new file mode 100644
index 0000000..ea73243
--- /dev/null
+++ b/DS2438_DHT11/DS2438_DHT22.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_DHT22", "DS2438_DHT22.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_DHT11/DS2438_DHT22.c b/DS2438_DHT11/DS2438_DHT22.c
new file mode 100644
index 0000000..b120ab3
--- /dev/null
+++ b/DS2438_DHT11/DS2438_DHT22.c
@@ -0,0 +1,316 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0xDD, 0xDD, 0x05, 0xCE};/**/
+uint8_t config_info[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,0x09,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint8_t wdcounter;
+
+
+typedef union {
+
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+#define DDR_SENSOR   DDRA
+#define PORT_SENSOR  PORTA
+#define PIN_SENSOR   PINA
+#define SENSOR       PINA2
+
+#define SENSOR_sda_out		DDR_SENSOR |= (1 << SENSOR)
+#define SENSOR_sda_in			DDR_SENSOR &= ~(1 << SENSOR);PORT_SENSOR |= (1 << SENSOR) // release sda => hi in consequence of pullup
+#define SENSOR_sda_low    PORT_SENSOR &= ~(1 << SENSOR)
+#define SENSOR_sda_hi    PORT_SENSOR |= (1 << SENSOR)
+#define SENSOR_is_hi			PIN_SENSOR & (1 << SENSOR)
+#define SENSOR_is_low		!(PIN_SENSOR & (1 << SENSOR))
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+
+uint8_t am_wait(uint8_t _time,uint8_t _signal){
+	TCNT1=0;
+	while(TCNT1==0);
+	if (_signal)
+	while((SENSOR_is_hi)&&(TCNT1<_time)) {}
+	else
+	while((SENSOR_is_low)&&(TCNT1<_time)) {}
+	
+	if (TCNT1>=_time) {return 1;}
+	return 0;
+}
+
+volatile uint8_t am2302_mode=0;
+volatile uint8_t timeout=0;
+
+
+
+
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+volatile double temperatureC,humidityRH;
+volatile double l;
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+	#else
+ISR(WDT_vect) {
+	#endif
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+	
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	__asm__ __volatile__ ("nop");
+	PORTB|=(1<<PORTB0); //Pullup
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	r=PINB&(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	PORTB&=~(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);
+}
+
+uint8_t am2302() {
+	int16_t lam2302_temp;
+	uint16_t lam2302_hum;
+	uint8_t rSREG;
+	uint8_t sensor_data[5];
+
+	TCCR1B=(1<<CS11); //Clock/8 1µs
+
+	
+	SENSOR_sda_out;
+	SENSOR_sda_low;	
+	_delay_ms(20);
+	SENSOR_sda_hi;	
+	SENSOR_sda_in;
+//	_delay_ms(40);
+	//SENSOR_sda_low;
+	//_delay_us(40);
+
+	//SENSOR_sda_in;
+	/*uint16_t loopCnt;
+	loopCnt=10000;
+	while((SENSOR_is_low)) {
+		if (loopCnt-- == 0) return  11;
+	}
+	loopCnt=10000;
+	while((SENSOR_is_hi)) {
+		if (loopCnt-- == 0) return  12;
+	}*/
+	if (am_wait(200,1)) return 2;
+	if (am_wait(100,0)) return 3;
+	if (am_wait(100,1)) return 4;
+	
+	for(uint8_t i = 0; i < 5; i++)	{
+		uint8_t sensor_byte = 0;
+		for(uint8_t j = 1; j <= 8; j++) {// get 8 bits from sensor
+			if (am_wait(88,0)) return 5;
+			
+			TCNT1=0;while(TCNT1==0);;while(TCNT1<35)		;
+			sensor_byte <<= 1; // add new lower byte
+			if (SENSOR_is_hi) {// if sda high after 30us => bit=1 else bit=0
+				sensor_byte |= 1;
+				if (am_wait(45,1)) return 6;// 30us - 75us = 45us
+			}
+		}
+		sensor_data[i] = sensor_byte;
+	}
+
+	// checksum
+	if ( ((sensor_data[0]+sensor_data[1]+sensor_data[2]+sensor_data[3]) & 0xff ) != sensor_data[4])
+	{
+		PORTB&=~(1<<PINB0);
+		return 7;
+	}
+	if (sensor_data[2]&0x80) { //minus
+		sensor_data[2]&=~(0x80);
+		lam2302_temp=-( sensor_data[2]*10);
+	} else
+		lam2302_temp=(sensor_data[2]*10);
+	if (!testSW()) {
+		double htemp=lam2302_temp;
+        double hhum=(1.0546-0.000216*htemp)*(sensor_data[0]*10);
+		//htemp=Temperauter * 10 
+		//lam2302_hum=0.318*hhum +76;
+		lam2302_hum=0.31*hhum +80; //hhum = Hum*10 -> 5V also all *5
+		config_info[5]=7;
+	}
+	else {
+		
+		lam2302_hum=(sensor_data[0]*10);
+		config_info[5]=12;
+	}
+	lam2302_temp=lam2302_temp*25.6;
+	rSREG=SREG;
+	cli();
+	am2302_hum=lam2302_hum;
+	am2302_temp=lam2302_temp;
+	SREG=rSREG;
+	return 0;
+}
+
+
+
+
+
+
+
+
+	int main(void){
+		PRR|=(1<<PRUSI)|(1<<PRADC);   // adc and usi for save Power
+		PORTA=0xFF;
+		PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+		DDRB|=(1<<PORTB0); //Als Ausgang und 0
+		
+		
+		OWINIT();
+
+		ACSR|=(1<<ACD);  //Disable Comparator
+		ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+		MCUCR &=~(1<<PUD); //All Pins Pullup...
+		MCUCR |=(1<<BODS);
+
+		
+		DDRA|=(1<<PINA1); //stromversorgung
+#define SENSON PORTA|=(1<<PINA1);
+#define SENSOFF PORTA&=~(1<<PINA1);
+
+		// Set up Watch Dog Timer for Inactivity
+		WDTCSR |= (1<<WDCE) ;   // Enable the WD Change Bit
+		WDTCSR =   (1<<WDIE) |              // Enable WDT Interrupt
+			(1<<WDP2) | (1<<WDP1);   // Set Timeout to ~2 seconds		
+		
+		if (testSW()) {
+			config_info[5]=12;  //hum *10
+			}else{
+			config_info[5]=7; //HIH4031
+		}
+		
+		uint8_t i;
+		for(i=0;i<64;i++) pack.bytes[i]=0;
+		pack.page3[0]=0xF1; //Wiregate Code
+		MCUSR=0;
+		
+		uint8_t err;
+		uint8_t pn=1;
+		SENSON
+		_delay_ms(4000);
+		err =am2302();
+		am2302_temp=err*256;
+		sei();
+		
+		while(1)   {
+			if (gcontrol) {
+				if (wdcounter>2) {
+					wdcounter=0;
+					SENSON
+				}
+				gcontrol=0;
+			}
+			if (wdcounter==2) {
+				err=am2302();
+				if (err!=0) {
+					pack.page3[pn]=err;
+					pn=pn+1;if (pn>31) pn=1;
+				}
+				//SENSOFF
+				wdcounter=3;
+			}
+			if (wdcounter>=16) {
+				wdcounter=0;
+				SENSON
+			}
+			
+			
+
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
+				MCUCR|=(1<<SE)|(1<<SM1);
+				MCUCR&=~(1<<ISC01);
+				} else {
+				MCUCR|=(1<<SE);
+				MCUCR&=~(1<<SM1);
+			}
+			asm("SLEEP");
+		}
+
+
+	}
\ No newline at end of file
diff --git a/DS2438_DHT11/DS2438_DHT22.cproj b/DS2438_DHT11/DS2438_DHT22.cproj
new file mode 100644
index 0000000..4986240
--- /dev/null
+++ b/DS2438_DHT11/DS2438_DHT22.cproj
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2438_DHT22</AssemblyName>
+    <Name>DS2438_DHT22</Name>
+    <RootNamespace>DS2438_DHT22</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\OWDS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_DHT22.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_DHT22/DS2438_DHT22.cproj b/DS2438_DHT22/DS2438_DHT22.cproj
index 3dc3802..4986240 100644
--- a/DS2438_DHT22/DS2438_DHT22.cproj
+++ b/DS2438_DHT22/DS2438_DHT22.cproj
@@ -29,15 +29,15 @@
     <ExternalProgrammingToolCommand />
     <AsfFrameworkConfig>
       <framework-data>
-  <options />
-  <configurations />
-  <files />
-  <documentation help="" />
-  <offline-documentation help="" />
-  <dependencies>
-    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
-  </dependencies>
-</framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
     </AsfFrameworkConfig>
     <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
     <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
diff --git a/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.atsln b/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.atsln
new file mode 100644
index 0000000..a43f92a
--- /dev/null
+++ b/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_Fenster_Kontakt", "DS2438_Fenster_Kontakt.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.c b/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.c
new file mode 100644
index 0000000..7a7418c
--- /dev/null
+++ b/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.c
@@ -0,0 +1,208 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x26, 0xA3, 0xD9, 0x89, 0xDD, 0xDD, 0x05, 0x64};/**/
+uint8_t config_info[26]={0x01,0x06, 0x05,0x08, 0x06,0x08, 0x00,0x00, 0x02,0x09,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint8_t wdcounter;
+
+
+typedef union {
+
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+volatile int16_t ds_temp;
+volatile uint16_t ds_vad;
+volatile uint16_t ds_vdd;
+
+#define CH1 (1<<PORTA0)
+#define CH2 (1<<PORTA1)
+#define CH3 (1<<PORTA2)
+#define PIN_CH1 PINA
+#define PIN_CH2 PINA
+#define PIN_CH3 PINA
+
+volatile uint8_t ch1,ch2,ch3;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+	#else
+ISR(WDT_vect) {
+	#endif
+	wdcounter++;if (wdcounter==11) wdcounter=10;
+	if (ch1>1) ch1++;
+	if (ch2>1) ch2++;
+	if (ch3>1) ch3++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+
+}
+	
+ISR(PCINT0_vect) {
+
+				if ((PIN_CH1&CH1)==0) {if (ch1==0) ch1=1;} else {ds_temp=25600;ch1=0;}
+				if ((PIN_CH2&CH2)==0) {if (ch2==0) ch2=1;} else {ds_vdd=0x1f4;ch2=0;}
+				if ((PIN_CH3&CH3)==0) {if (ch3==0) ch3=1;} else {ds_vad=0x1f4;ch3=0;}
+	
+	wdcounter=10;
+}
+
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	__asm__ __volatile__ ("nop");
+	PORTB|=(1<<PORTB0); //Pullup
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	r=PINB&(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	PORTB&=~(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);
+}
+
+
+
+
+
+
+
+
+	int main(void){
+		PRR|=(1<<PRUSI);   //  usi for save Power
+		PORTA=0xFF;  
+		PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+		DDRB|=(1<<PORTB0); //Als Ausgang und 0
+		
+		
+		OWINIT();
+
+		ACSR|=(1<<ACD);  //Disable Comparator
+		//ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+		MCUCR &=~(1<<PUD); //All Pins Pullup...
+		
+		// Set up Watch Dog Timer for Inactivity
+		WDTCSR |= (1<<WDCE) ;   // Enable the WD Change Bit
+		WDTCSR =   (1<<WDIE) |              // Enable WDT Interrupt
+			(1<<WDP2) | (1<<WDP1);   // Set Timeout to ~2 seconds		
+		
+		GIMSK|=(1<<PCIE0);
+		PCMSK0=(CH1)|(CH2)|(CH3);
+
+		
+		sei();
+		
+		while(1)   {
+				if ((PIN_CH1&CH1)==0) {if (ch1==0) ch1=1;} else {ds_temp=25600;ch1=0;}
+				if ((PIN_CH2&CH2)==0){if (ch2==0) ch2=1;} else {ds_vdd=0x1f4;ch2=0;}
+				if ((PIN_CH3&CH3)==0) {if (ch3==0) ch3=1;} else {ds_vad=0x1f4;ch3=0;}
+
+				if (ch1==10) {ch1=0;ds_temp=0;};
+				if (ch2==10) {ch2=0;ds_vdd=0;};
+				if (ch3==10) {ch3=0;ds_vad=0;};
+
+				if ((gcontrol&1)==1) {
+					if (ch1==1) {
+						ch1=2;
+					}
+				}
+				if ((gcontrol&2)==2) {
+					if ((ch2==1)) {
+						ch2=2;
+					}
+				}
+				if ((gcontrol&4)==4) {
+					if (ch3==1) {
+						ch3=2;
+					}
+				}
+				gcontrol=0;
+	
+
+	#define TEST_TIMER  ((TIMSK0 & (1<<TOIE0))==0)
+	if (TEST_TIMER&&(mode==0)) {
+		MCUCR|=(1<<SE)|(1<<SM1); //Power Down, only low level on 1-Wire and pin change on PCINT wakes up
+		MCUCR&=~(1<<ISC01);
+		} else {
+		MCUCR|=(1<<SE);
+		MCUCR&=~(1<<SM1);
+	}
+	asm("SLEEP");
+
+		}
+
+
+	}
\ No newline at end of file
diff --git a/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.cproj b/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.cproj
new file mode 100644
index 0000000..1710f22
--- /dev/null
+++ b/DS2438_Fenster_Kontakt/DS2438_Fenster_Kontakt.cproj
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2438_DHT22</AssemblyName>
+    <Name>DS2438_Fenster_Kontakt</Name>
+    <RootNamespace>DS2438_DHT22</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="DS2438_Fenster_Kontakt.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2438.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_Fenster_Kontakt/OWDS2438.S b/DS2438_Fenster_Kontakt/OWDS2438.S
new file mode 100644
index 0000000..eff1ad7
--- /dev/null
+++ b/DS2438_Fenster_Kontakt/OWDS2438.S
@@ -0,0 +1,196 @@
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+//#define _DIS_FLASH_
+#define _ZERO_POLLING_
+//#define _DB_
+//#define __4MHZ__
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC8.s"
+
+#if  defined(__AVR_ATtiny25__)
+.extern pack,16
+#else
+.extern pack,64
+#endif
+.extern  ds_temp,2
+.extern  ds_vdd,2
+.extern  ds_vad,2
+
+.comm block,1 ; Block der augegeben, geschrieben wird (Parameter von READ/WRITE Scratchpad)
+
+
+.macro CHIP_INIT
+.endm
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_SCRATCHPAD_ADR OW_FIRST_COMMAND+0
+#define OW_READ_SCRATCHPAD OW_FIRST_COMMAND+1
+#define OW_WRITE_SCRATCHPAD_ADR OW_FIRST_COMMAND+2
+#define OW_WRITE_SCRATCHPAD OW_FIRST_COMMAND+3
+
+
+
+.macro COMMAND_TABLE
+		rjmp h_readscratchpad_adr
+		rjmp h_readscratchpad
+		rjmp h_writescratchpad_adr
+		rjmp h_writescratchpad
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xBE,OW_READ_SCRATCHPAD_ADR
+	cset 0x4E,OW_WRITE_SCRATCHPAD_ADR
+	cjmp 0x44,hrc_set_convertT
+	cjmp 0xB4,hrc_set_convertV
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	rjmp handle_end_sleep
+
+
+hrc_set_convertT:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	lds r_temp,ds_temp
+	sts pack+1,r_temp
+	lds r_temp,ds_temp+1
+	sts pack+2,r_temp
+	rjmp handle_end_sleep
+hrc_set_convertV:
+	lds r_temp,pack
+	sbrs r_temp,3
+	rjmp hrc_set_convertVV
+	ldi r_temp,2
+	sts gcontrol,r_temp
+	//ldi r_temp,0xF4#
+	lds r_temp,ds_vdd
+	sts pack+3,r_temp
+	//ldi r_temp,0x01
+	lds r_temp,ds_vdd+1
+	sts pack+4,r_temp
+	rjmp hrc_set_convertend
+hrc_set_convertVV:
+	ldi r_temp,4
+	sts gcontrol,r_temp
+	lds r_temp,ds_vad
+	sts pack+3,r_temp
+	lds r_temp,ds_vad+1
+	sts pack+4,r_temp
+hrc_set_convertend:
+	rjmp handle_end_sleep
+
+
+
+;---------------------------------------------------
+;   READ SCRATCHPAD
+;---------------------------------------------------
+
+h_readscratchpad_adr:
+	lsl r_rwbyte
+	lsl r_rwbyte
+	lsl r_rwbyte
+#if  defined(__AVR_ATtiny25__)
+	andi r_rwbyte,0x01 ;nur Page 0 und 1 und das immer wiederholen
+#endif
+	sts block,r_rwbyte
+	ldi r_sendflag,1
+	ldi r_mode,OW_READ_SCRATCHPAD
+	ldi r_temp,8
+	sts gcontrol,r_temp
+	CRCInit2
+h_readscratchpad:
+	cpi  r_bytep,8
+	breq h_readscratchpad_crc
+	cpi  r_bytep,9
+	breq h_readscratchpad_all
+	lds  r_temp,block
+	add  r_temp,r_bytep
+	configZ pack,r_temp
+	ld   r_rwbyte,Z
+	rjmp handle_end_inc
+h_readscratchpad_crc:
+	lds  r_rwbyte,crc
+	rjmp handle_end_inc
+h_readscratchpad_all:
+	rjmp handle_end_sleep
+
+
+
+
+;---------------------------------------------------
+;   WRITE SCRATCHPAD
+;---------------------------------------------------
+h_writescratchpad_adr:
+	lsl r_rwbyte
+	lsl r_rwbyte
+	lsl r_rwbyte
+#if  defined(__AVR_ATtiny25__)
+	andi r_rwbyte,0x01 ;nur Page 0 und 1 und das immer wiederholen
+#endif
+	sts block,r_rwbyte
+	ldi r_mode,OW_WRITE_SCRATCHPAD
+	ldi  r_bcount,1 
+	rjmp handle_end	
+h_writescratchpad:
+	cpi  r_bytep,8
+	breq h_writescratchpad_all
+	lds  r_temp,block
+	add  r_temp,r_bytep
+	configZ pack,r_temp
+	st   Z,r_rwbyte
+	rjmp handle_end_inc
+h_writescratchpad_all:
+	rjmp handle_end_sleep
+
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2438_HDC1080/DS2438_HDC1080.atsln b/DS2438_HDC1080/DS2438_HDC1080.atsln
index da1d586..4812b38 100644
--- a/DS2438_HDC1080/DS2438_HDC1080.atsln
+++ b/DS2438_HDC1080/DS2438_HDC1080.atsln
@@ -1,22 +1,22 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_HDC1080", "DS2438_HDC1080.cproj", "{91468D4F-8AE2-4C59-8A35-549C49E00934}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|AVR = Debug|AVR
-		Release|AVR = Release|AVR
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.ActiveCfg = Debug|AVR
-		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.Build.0 = Debug|AVR
-		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.ActiveCfg = Release|AVR
-		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.Build.0 = Release|AVR
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_HDC1080", "DS2438_HDC1080.cproj", "{91468D4F-8AE2-4C59-8A35-549C49E00934}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.ActiveCfg = Debug|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.Build.0 = Debug|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.ActiveCfg = Release|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_HDC2010/DS2438_HDC2010.atsln b/DS2438_HDC2010/DS2438_HDC2010.atsln
new file mode 100644
index 0000000..92feefd
--- /dev/null
+++ b/DS2438_HDC2010/DS2438_HDC2010.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_HDC2010", "DS2438_HDC2010.cproj", "{91468D4F-8AE2-4C59-8A35-549C49E00934}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.ActiveCfg = Debug|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.Build.0 = Debug|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.ActiveCfg = Release|AVR
+		{91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_HDC2010/DS2438_HDC2010.c b/DS2438_HDC2010/DS2438_HDC2010.c
new file mode 100644
index 0000000..d47fd90
--- /dev/null
+++ b/DS2438_HDC2010/DS2438_HDC2010.c
@@ -0,0 +1,199 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/HDC1080.h"
+#include "../common/calibr.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x00, 0x05, 0x16};/**/
+uint8_t config_info[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,11,0x00,11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+	
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint8_t wdcounter=5;
+
+
+typedef union {
+
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		uint16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		//uint8_t crc;  //65
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH;
+volatile double l;
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+
+
+}
+
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB|=(1<<PORTB0); //Pullup
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 r=PINB&(1<<PORTB0);
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB&=~(1<<PORTB0); 
+	 __asm__ __volatile__ ("nop"); 
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);
+	 
+	 
+}
+
+int main(void){
+     PRR|=(1<<PRADC);  // adc for save Power
+	PORTA=0xFF;
+	PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+	DDRB|=(1<<PORTB0); //Als Ausgang und 0
+	
+	
+	OWINIT();
+
+	ACSR|=(1<<ACD);  //Disable Comparator
+	ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+
+	
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	 if (testSW()) {
+		config_info[5]=8;
+	}else{
+		config_info[5]=7;
+	 }
+	
+    uint8_t i;
+    for(i=0;i<64;i++) pack.bytes[i]=0;
+	MCUSR=0;
+	USI_TWI_Master_Initialise();
+	HDC2010_Init();
+	HDC2010_Readf(&temperatureC,&humidityRH);
+	
+	sei();
+	
+	 while(1)   {
+		 if (gcontrol) {
+			 wdcounter=3;
+			 gcontrol=0;
+		 }
+		 if (wdcounter>2) {
+			 //PORTB|=(1<<PINB1); //Dauer 440ms
+			 HDC2010_Readf(&temperatureC,&humidityRH);
+
+			 humidityRH = calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+			 temperatureC-=0.2;
+			 temperatureC*=10.0;
+			 if (testSW()) {
+				 am2302_hum= humidityRH;
+				 am2302_temp=temperatureC*25.6;
+				 //am2302_temp=am2302_temp-45;
+				 config_info[5]=12;	
+				 
+			 }else{
+				 
+				double hhum=(1.0546-0.000216*temperatureC)*(humidityRH);
+				//am2302_hum=0.318*hhum +76.0;
+				am2302_hum=0.31*hhum +80;
+				am2302_temp=temperatureC*25.6;
+				//am2302_temp=am2302_temp-45;
+				config_info[5]=7;
+			 }
+			 //PORTB&=~(1<<PINB1);
+			 wdcounter=0;
+		 }
+
+		if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+	}
+
+
+}
\ No newline at end of file
diff --git a/DS2438_HDC2010/DS2438_HDC2010.cproj b/DS2438_HDC2010/DS2438_HDC2010.cproj
new file mode 100644
index 0000000..5a393ef
--- /dev/null
+++ b/DS2438_HDC2010/DS2438_HDC2010.cproj
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{91468d4f-8ae2-4c59-8a35-549c49e00934}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2438_SHT2X</AssemblyName>
+    <Name>DS2438_HDC2010</Name>
+    <RootNamespace>DS2438_SHT2X</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+  <options />
+  <configurations />
+  <files />
+  <documentation help="" />
+  <offline-documentation help="" />
+  <dependencies>
+    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+  </dependencies>
+</framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -D__4MHZ__</avrgcc.compiler.miscellaneous.OtherFlags>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.AssemblerFlags>-D__4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\HDC2010.c">
+      <SubType>compile</SubType>
+      <Link>HDC2010.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_HDC2010.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_DS2438.c b/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_DS2438.c
new file mode 100644
index 0000000..f4aef4a
--- /dev/null
+++ b/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_DS2438.c
@@ -0,0 +1,444 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+//#define __4MHZ__
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/HDC2010.h"
+#include "../common/I2C/MAX44009.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+
+
+volatile uint8_t owid1[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x50};/**/
+volatile uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/
+                                        //18
+volatile uint8_t config_info1[26]={3,28, 0x05,0x08, 8,27, 0x00,0x00, 0x02,17,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+volatile uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 11,0x08, 0x02,0x07,0x00,0x07,17,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+#if (owid>128)
+#error "Variable not correct"
+#endif
+
+extern uint8_t cpsp2;
+
+OWST_WDT_ISR
+
+/*
+
+
+	typedef union {
+		volatile uint8_t bytes[8];
+		struct {
+			uint16_t temp;  //0
+			uint8_t TH;  //2
+			uint8_t TL;  //3
+			uint8_t config;  //4
+			uint8_t rrFF; //5
+			uint8_t rr00; //6
+			uint8_t rr10; //7
+		};
+	} pack1_t;
+	volatile pack1_t pack1;
+*/
+
+
+	typedef union {
+		#if  defined(__AVR_ATtiny25__)
+		uint8_t bytes[16];
+		#else
+		uint8_t bytes[64];
+		#endif
+		struct {
+			uint8_t status;  //1
+			int16_t temp;  //2
+			uint16_t voltage;  //4
+			int16_t current;  //6
+			uint8_t threshold; //8
+			
+			uint8_t page1[8]; //9
+			#if  defined(__AVR_ATtiny25__)
+			#else
+			uint8_t page2[8]; //17
+			union{
+				uint8_t page3[8]; //25
+				struct {
+					uint8_t free;
+					uint16_t R0;
+					uint16_t VS;
+					uint8_t cmode;
+					int16_t ip;
+					
+				};
+			};
+			union{
+				uint8_t page4[8];  //33
+				struct {
+					uint16_t tol_s8;
+					uint16_t tol_d;
+					uint16_t r_day_max;
+					uint16_t r_week_max;
+				};
+			};
+			union{
+				uint8_t page5[8];  //41
+				struct {
+					uint8_t codeVOC; // immer 0x37 nach Neustart
+					uint8_t days_of_r0; //Anzahl der Tage fuer die r0 ermittelt wird
+					int8_t corr_VOC_mult; //r0 corr
+					int8_t corr_VOC_div;
+					uint16_t vv3;
+					uint8_t time_corr; //Wiregate;
+					uint8_t reset_code;
+				};
+				uint16_t page5d[4];
+			};
+			uint8_t page6[8];  //49
+			uint8_t page7[8];  //57
+			
+			#endif
+		};
+	} pack2_t;
+	volatile pack2_t pack2,pack1;
+
+
+
+
+	volatile int16_t DS2438_2_TEMP;
+	volatile uint16_t DS2438_2_VAD;
+	volatile uint16_t DS2438_2_VDD=0x01F4;
+	volatile int16_t DS2438_1_TEMP;
+	volatile uint16_t DS2438_1_VAD;
+	volatile uint16_t DS2438_1_VDD=0x01F4;
+
+	OWST_TESTSW
+
+
+	double temperatureC,humidityRH,hhum;
+	double l;
+
+
+	uint16_t weekmaxarr[33];
+
+	//Kompensieren der Abhänigkeit von RS/RO von Temperatur und Luftfeuchte
+	inline double interp(double t, double h) {
+		double h2;
+		double t2;
+		h2=h*h;
+		t2=t*t;
+		return 4.76111e-9*h2*t2-3.96956e-7*h2*t+0.0000408889*h2-1.07132e-6*h*t2+0.000115968*h*t-0.0101333*h+0.000163806*t2-0.0241179*t+1.80591;
+	}
+	inline double calibr_hum05(double t,double hum) {
+		double y=-0.0006*t*t-0.2455*t-28.5902;
+		return -(hum/y)+hum;
+	}
+	inline double calibr_hum075(double t,double hum) {
+		double y=-0.0004*t*t-0.1636*t-18.9173;
+		return -(hum/y)+hum;
+	}
+	inline double calibr_hum1(double t,double hum) {
+		double y=-0.0003*t*t-0.1228*t-14.0808;
+		return -(hum/y)+hum;
+	}
+
+	double R0;
+	uint16_t mr;
+	uint8_t startup=10;
+	double ip;
+	double la[4];
+	uint8_t lainit=1;
+
+
+	
+	#define EEPROM_R0 0
+	#define EEPROM_R0d 2
+	#define EEPROM_R0w 4
+	#define EEPROM_dol 6
+	#define EEPROM_CODE_DAYOFR0 8
+	#define EEPROM_CORR 10
+	#define EEPROM_FREE 12
+	#define EEPROM_TCORR_RESET 14
+
+	uint16_t readEEPROM(uint8_t addr,uint16_t def) {
+		uint16_t hr;
+		while(EECR & (1<<EEPE));
+		EEARL=addr+1;
+		EECR |= (1<<EERE);
+		hr=EEDR;
+		if (hr!=0xFF) {
+			hr=hr<<8;
+			while(EECR & (1<<EEPE));
+			EEARL=addr;
+			EECR |= (1<<EERE);
+			hr|=EEDR;
+			return hr;
+		}
+		return def;
+	}
+
+	void writeEEPROM(uint8_t addr,uint16_t val) {
+		while(EECR & (1<<EEPE));
+		EECR = (0<<EEPM1)|(0<<EEPM0);
+		EEARL = addr;
+		EEDR = val&0xFF;
+		EECR |= (1<<EEMPE);
+		EECR |= (1<<EEPE);
+		while(EECR & (1<<EEPE));
+		EECR = (0<<EEPM1)|(0<<EEPM0);
+		EEARL = addr+1;
+		EEDR = val>>8;
+		EECR |= (1<<EEMPE);
+		EECR |= (1<<EEPE);
+	}
+
+	int main(void){
+		PORTA=0xFF-(1<<PINA1);
+		PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+		DDRB|=(1<<PORTB0); //Als Ausgang und 0
+		OWINIT();
+		DDRB|=(1<<PINB1);//Ausgang und 1
+		DDRA|=(1<<PINA0);
+		
+		WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+		WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+		//(1<<WDP0) |(1<<WDP2) | (1<<WDP1);    // Set Timeout to ~2 seconds
+		(1<<WDP3) | (1<<WDP0);    // Set Timeout to ~8 seconds
+
+		MCUSR=0;
+
+		//ADMUX=0b00001110; //ADC1 +   ADC3 -
+		ADMUX=0x01 ; //PA3 single and  3V
+		OWST_INIT_ADC
+		//ADCSRA = (1<<ADEN)|(1<<ADPS1)|(1<<ADPS0);//|
+		
+		
+
+		pack2.page3[0]=0xF1;
+		pack2.cmode=0;
+		pack2.R0=readEEPROM(EEPROM_R0,1);
+		R0=pack2.R0/100.0;
+		
+		pack2.r_day_max=readEEPROM(EEPROM_R0d,1);
+		pack2.r_week_max=readEEPROM(EEPROM_R0w,1);
+		pack2.tol_d=readEEPROM(EEPROM_dol,0);
+		pack2.tol_s8=0;  //Tag faengt mit Einschalten an
+
+		pack2.page5d[0]=readEEPROM(EEPROM_CODE_DAYOFR0,0x0437);
+		pack2.page5d[1]=readEEPROM(EEPROM_CORR,0x0101);
+		pack2.page5d[2]=readEEPROM(EEPROM_FREE,0x0);
+		pack2.page5d[3]=readEEPROM( EEPROM_TCORR_RESET,0x0005);
+
+		for(uint8_t i=0;i<pack2.days_of_r0;i++) {
+			weekmaxarr[i]=pack2.r_week_max;
+		}
+
+		for(uint8_t i=0;i<8;i++) pack2.page6[i]=owid1[i];
+		if (testSW()) {
+			config_info2[5]=12;
+			}else{
+			config_info2[5]=7;
+		}
+
+		TWI_Master_Initialise();
+		
+		//initSHT2x();
+		HDC2010_Init();
+		
+		_delay_ms(100);
+		gcontrol=1;
+		sei();
+		while(1)   {
+			
+			if ((cpsp2&0x80)!=0) {
+				if ((cpsp2&0x0F)==5) {
+					if (pack2.reset_code==0x01) {
+						R0=1;
+						pack2.R0=0;
+						writeEEPROM(EEPROM_R0,0);
+					} else if (pack2.reset_code==0x05) {
+						pack2.r_day_max=1;
+						pack2.r_week_max=1;
+						pack2.tol_d=0;
+						pack2.tol_s8=0;  //Tag faengt mit Einschalten an
+						R0=1;
+						writeEEPROM(EEPROM_R0,0xFF);
+						writeEEPROM(EEPROM_R0d,0xFF);  //Maximum des Tages
+						writeEEPROM(EEPROM_R0w,0xFF); //Maximum der Letzten 7 Tage
+						writeEEPROM(EEPROM_dol,0xFF); //Anzahl der Betriebstage
+						for(uint8_t i=0;i<7;i++) {
+							weekmaxarr[i]=1;
+						}
+					} else {
+						writeEEPROM(EEPROM_CODE_DAYOFR0,0x0037|(pack2.days_of_r0<<8));
+						writeEEPROM(EEPROM_CORR,pack2.page5d[1]);
+						writeEEPROM(EEPROM_FREE,pack2.page5d[2]);
+						writeEEPROM(EEPROM_TCORR_RESET,pack2.time_corr);
+					}
+				}
+				cpsp2=0;
+			}
+			if (wdcounter>0) {  //8s
+				pack2.tol_s8++;
+				if (pack2.tol_s8>(10000))  {//10800 ist theortisch der Tag aber meistens zu lang
+					pack2.tol_s8=0;
+					pack2.tol_d++;  //rund 180 Jahre :-)
+					pack2.r_week_max=0;
+					weekmaxarr[pack2.days_of_r0]=pack2.r_day_max;
+					for(uint8_t i=0;i<pack2.days_of_r0;i++) {
+						weekmaxarr[i]=weekmaxarr[i+1];
+						//maximum of week
+						if (weekmaxarr[i]>pack2.r_week_max) pack2.r_week_max=weekmaxarr[i];
+					}
+					if (pack2.tol_d>7) {
+						pack2.R0=pack2.r_week_max;
+					} else {
+						pack2.R0=pack2.r_day_max;
+					}
+					//R0=//R0-0.5*(pack2.R0/100-R0);
+					R0=R0-(R0-pack2.R0/100.0)*0.5	;
+					pack2.R0=R0*100;
+					writeEEPROM(EEPROM_R0,pack2.R0);
+					writeEEPROM(EEPROM_R0d,pack2.r_day_max);  //Maximum des Tages
+					writeEEPROM(EEPROM_R0w,pack2.r_week_max); //Maximum der Letzten 7 Tage
+					writeEEPROM(EEPROM_dol,pack2.tol_d); //Anzahl der Betriebstage
+					pack2.r_day_max=0;
+				}
+				if (startup!=0) startup--;
+				//getSHT2xHumTemp(&temperatureC,&humidityRH);
+				 HDC2010_Readf(&temperatureC,&humidityRH);
+				ip=interp(temperatureC,humidityRH);
+				pack2.ip=ip*1000;
+				//double RH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+				//double TC =temperatureC *10.0-2;
+				double RH=calibr_hum075(temperatureC,humidityRH)*10.0;
+				//double RH=humidityRH*10.0;
+				double TC=temperatureC*10.0-7.5;
+
+
+				if (testSW()) {
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=TC*25.6;
+					config_info2[5]=12;	//10V = 100%
+				}else{
+					hhum=(1.0546-0.000216*TC)*(RH);
+					DS2438_2_VAD=0.31*hhum +80;
+					DS2438_2_TEMP=TC*25.6;
+					config_info2[5]=7;
+				}
+				mr=0;
+				//Kritische Sektion !___Ein Breakpoint in dieser Section kann den TGS8100 zerstoeren!___________________________
+				PORTB&=~(1<<PINB1); //Auf 0 Ziehen
+				_delay_us(300);
+				for(uint8_t i=0;i<32;i++) {
+					ADCSRA|=(1<<ADSC);
+					while ((ADCSRA&(1<<ADSC)));
+					mr+=ADC;
+				 }
+				PORTB|=(1<<PINB1);
+				//ENDE Kritische Sektion !______________________________
+
+				//pack2.VS=mr*3/128;  //VS in Volt = VS/256  --> Nur zum Debug .... Speicher reicht sonst nicht....
+				l=mr*1.8/32768.0;  //Spannung in v
+				l=( 1.8/l- 1) *30; //l is resistance
+				if (lainit) {
+					la[0]=la[1]=la[2]=la[3]=l;  //smaller code
+					lainit=0;
+				} else {
+					//for (uint8_t i=0;i<3;i++) {
+					//	la[i]=la[i+1];
+					//}
+					la[0]=la[1];
+					la[1]=la[2];
+					la[2]=la[3];
+					la[3]=l;
+				}
+				double lasum=la[0]+la[1]+la[2]+la[3];
+				l=lasum/4.0;
+				
+				pack2.current=l*100;
+				
+				l=l/ip;
+				
+				if (startup==0){
+					if (l>R0) {
+						R0=l;
+						pack2.R0=R0*100;
+						writeEEPROM(EEPROM_R0,pack2.R0);
+
+					}
+					if (l*100>pack2.r_day_max) {
+						pack2.r_day_max=l*100;
+					}
+				} else if (l<R0) l=R0; //negative Werte am Anfang verhintern
+				//l=exp((1-(l/R0))*6.05)-1;// exp((1-($val)/55)*5.75);  (5.75 geht über 125 6.05 geht bis 240... mittlere Linie im Datenblatt)
+				//l=pow(R0/l,1.8)*3-3; 
+				if (l!=0) {
+					l=R0/l;
+					//l=l*l*12-12;
+					l=exp((1-(1/l))*6.05)-1;
+					l=l*(double)pack2.corr_VOC_mult/(double)pack2.corr_VOC_div;
+					l=l*8.0; //fuer DS18B20*/
+				}	
+				wdcounter=0;
+				DS2438_1_VAD=l;
+				DS2438_1_VDD=(l-DS2438_1_VAD)*1000.0;
+				
+				l=MAX44009getlux(1);
+				if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
+				//double l=1000;
+				l=log(l)*10*256;
+				DS2438_1_TEMP=l;
+
+				
+			}
+			
+			
+			if (gcontrol) {
+				gcontrol=0;
+				
+			}
+
+			
+			OWST_MAIN_END
+		}
+
+
+	}
diff --git a/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.atsln b/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.atsln
new file mode 100644
index 0000000..b70f413
--- /dev/null
+++ b/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_MAX44009_VOC_DS2438_HDC", "DS2438_MAX44009_VOC_DS2438_HDC.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.cproj b/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.cproj
new file mode 100644
index 0000000..087566c
--- /dev/null
+++ b/DS2438_MAX44009_VOC_DS2438_HDC_direct/DS2438_MAX44009_VOC_DS2438_HDC.cproj
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS2438_MAX44009_VOC_DS2438_HDC</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <ResetRule>0</ResetRule>
+    <EraseKey />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>__4MHZ__</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.AssemblerFlags>-D__4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+      <Value>__4MHZ__</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.preprocessor.UndefSymbols>
+    <ListValues>
+      <Value>_CHANGEABLE_ID_</Value>
+    </ListValues>
+  </avrgcc.compiler.preprocessor.UndefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.AssemblerFlags>-D__4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\HDC2010.c">
+      <SubType>compile</SubType>
+      <Link>HDC2010.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\MAX44009.c">
+      <SubType>compile</SubType>
+      <Link>MAX44009.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2438_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_DS2438.c b/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_DS2438.c
new file mode 100644
index 0000000..e4e3bbc
--- /dev/null
+++ b/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_DS2438.c
@@ -0,0 +1,442 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/I2C/MAX44009.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+
+
+volatile uint8_t owid1[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x50};/**/
+volatile uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/
+                                        //18
+volatile uint8_t config_info1[26]={3,28, 0x05,0x08, 8,27, 0x00,0x00, 0x02,17,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+volatile uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 11,0x08, 0x02,0x07,0x00,0x07,17,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+#if (owid>128)
+#error "Variable not correct"
+#endif
+
+extern uint8_t cpsp2;
+
+OWST_WDT_ISR
+
+/*
+
+
+	typedef union {
+		volatile uint8_t bytes[8];
+		struct {
+			uint16_t temp;  //0
+			uint8_t TH;  //2
+			uint8_t TL;  //3
+			uint8_t config;  //4
+			uint8_t rrFF; //5
+			uint8_t rr00; //6
+			uint8_t rr10; //7
+		};
+	} pack1_t;
+	volatile pack1_t pack1;
+*/
+
+
+	typedef union {
+		#if  defined(__AVR_ATtiny25__)
+		uint8_t bytes[16];
+		#else
+		uint8_t bytes[64];
+		#endif
+		struct {
+			uint8_t status;  //1
+			int16_t temp;  //2
+			uint16_t voltage;  //4
+			int16_t current;  //6
+			uint8_t threshold; //8
+			
+			uint8_t page1[8]; //9
+			#if  defined(__AVR_ATtiny25__)
+			#else
+			uint8_t page2[8]; //17
+			union{
+				uint8_t page3[8]; //25
+				struct {
+					uint8_t free;
+					uint16_t R0;
+					uint16_t VS;
+					uint8_t cmode;
+					int16_t ip;
+					
+				};
+			};
+			union{
+				uint8_t page4[8];  //33
+				struct {
+					uint16_t tol_s8;
+					uint16_t tol_d;
+					uint16_t r_day_max;
+					uint16_t r_week_max;
+				};
+			};
+			union{
+				uint8_t page5[8];  //41
+				struct {
+					uint8_t codeVOC; // immer 0x37 nach Neustart
+					uint8_t days_of_r0; //Anzahl der Tage fuer die r0 ermittelt wird
+					int8_t corr_VOC_mult; //r0 corr
+					int8_t corr_VOC_div;
+					uint16_t vv3;
+					uint8_t time_corr; //Wiregate;
+					uint8_t reset_code;
+				};
+				uint16_t page5d[4];
+			};
+			uint8_t page6[8];  //49
+			uint8_t page7[8];  //57
+			
+			#endif
+		};
+	} pack2_t;
+	volatile pack2_t pack2,pack1;
+
+
+
+
+	volatile int16_t DS2438_2_TEMP;
+	volatile uint16_t DS2438_2_VAD;
+	volatile uint16_t DS2438_2_VDD=0x01F4;
+	volatile int16_t DS2438_1_TEMP;
+	volatile uint16_t DS2438_1_VAD;
+	volatile uint16_t DS2438_1_VDD=0x01F4;
+
+	OWST_TESTSW
+
+
+	double temperatureC,humidityRH,hhum;
+	double l;
+
+
+	uint16_t weekmaxarr[33];
+
+	//Kompensieren der Abhänigkeit von RS/RO von Temperatur und Luftfeuchte
+	inline double interp(double t, double h) {
+		double h2;
+		double t2;
+		h2=h*h;
+		t2=t*t;
+		return 4.76111e-9*h2*t2-3.96956e-7*h2*t+0.0000408889*h2-1.07132e-6*h*t2+0.000115968*h*t-0.0101333*h+0.000163806*t2-0.0241179*t+1.80591;
+	}
+	inline double calibr_hum05(double t,double hum) {
+		double y=-0.0006*t*t-0.2455*t-28.5902;
+		return -(hum/y)+hum;
+	}
+	inline double calibr_hum075(double t,double hum) {
+		double y=-0.0004*t*t-0.1636*t-18.9173;
+		return -(hum/y)+hum;
+	}
+	inline double calibr_hum1(double t,double hum) {
+		double y=-0.0003*t*t-0.1228*t-14.0808;
+		return -(hum/y)+hum;
+	}
+
+	double R0;
+	uint16_t mr;
+	uint8_t startup=10;
+	double ip;
+	double la[4];
+	uint8_t lainit=1;
+
+
+	
+	#define EEPROM_R0 0
+	#define EEPROM_R0d 2
+	#define EEPROM_R0w 4
+	#define EEPROM_dol 6
+	#define EEPROM_CODE_DAYOFR0 8
+	#define EEPROM_CORR 10
+	#define EEPROM_FREE 12
+	#define EEPROM_TCORR_RESET 14
+
+	uint16_t readEEPROM(uint8_t addr,uint16_t def) {
+		uint16_t hr;
+		while(EECR & (1<<EEPE));
+		EEARL=addr+1;
+		EECR |= (1<<EERE);
+		hr=EEDR;
+		if (hr!=0xFF) {
+			hr=hr<<8;
+			while(EECR & (1<<EEPE));
+			EEARL=addr;
+			EECR |= (1<<EERE);
+			hr|=EEDR;
+			return hr;
+		}
+		return def;
+	}
+
+	void writeEEPROM(uint8_t addr,uint16_t val) {
+		while(EECR & (1<<EEPE));
+		EECR = (0<<EEPM1)|(0<<EEPM0);
+		EEARL = addr;
+		EEDR = val&0xFF;
+		EECR |= (1<<EEMPE);
+		EECR |= (1<<EEPE);
+		while(EECR & (1<<EEPE));
+		EECR = (0<<EEPM1)|(0<<EEPM0);
+		EEARL = addr+1;
+		EEDR = val>>8;
+		EECR |= (1<<EEMPE);
+		EECR |= (1<<EEPE);
+	}
+
+	int main(void){
+		PORTA=0xFF-(1<<PINA1);
+		PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+		DDRB|=(1<<PORTB0); //Als Ausgang und 0
+		OWINIT();
+		DDRB|=(1<<PINB1);//Ausgang und 1
+		DDRA|=(1<<PINA0);
+		
+		WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+		WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+		//(1<<WDP0) |(1<<WDP2) | (1<<WDP1);    // Set Timeout to ~2 seconds
+		(1<<WDP3) | (1<<WDP0);    // Set Timeout to ~8 seconds
+
+		MCUSR=0;
+
+		//ADMUX=0b00001110; //ADC1 +   ADC3 -
+		ADMUX=0x01 ; //PA3 single and  3V
+		OWST_INIT_ADC
+		//ADCSRA = (1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);//|
+		
+		
+
+		pack2.page3[0]=0xF1;
+		pack2.cmode=0;
+		pack2.R0=readEEPROM(EEPROM_R0,1);
+		R0=pack2.R0/100.0;
+		
+		pack2.r_day_max=readEEPROM(EEPROM_R0d,1);
+		pack2.r_week_max=readEEPROM(EEPROM_R0w,1);
+		pack2.tol_d=readEEPROM(EEPROM_dol,0);
+		pack2.tol_s8=0;  //Tag faengt mit Einschalten an
+
+		pack2.page5d[0]=readEEPROM(EEPROM_CODE_DAYOFR0,0x0437);
+		pack2.page5d[1]=readEEPROM(EEPROM_CORR,0x0101);
+		pack2.page5d[2]=readEEPROM(EEPROM_FREE,0x0);
+		pack2.page5d[3]=readEEPROM( EEPROM_TCORR_RESET,0x0005);
+
+		for(uint8_t i=0;i<pack2.days_of_r0;i++) {
+			weekmaxarr[i]=pack2.r_week_max;
+		}
+
+		for(uint8_t i=0;i<8;i++) pack2.page6[i]=owid1[i];
+		if (testSW()) {
+			config_info2[5]=12;
+			}else{
+			config_info2[5]=7;
+		}
+
+		TWI_Master_Initialise();
+		
+		initSHT2x();
+		
+		_delay_ms(100);
+		gcontrol=1;
+		sei();
+		while(1)   {
+			
+			if ((cpsp2&0x80)!=0) {
+				if ((cpsp2&0x0F)==5) {
+					if (pack2.reset_code==0x01) {
+						R0=1;
+						pack2.R0=0;
+						writeEEPROM(EEPROM_R0,0);
+					} else if (pack2.reset_code==0x05) {
+						pack2.r_day_max=1;
+						pack2.r_week_max=1;
+						pack2.tol_d=0;
+						pack2.tol_s8=0;  //Tag faengt mit Einschalten an
+						R0=1;
+						writeEEPROM(EEPROM_R0,0xFF);
+						writeEEPROM(EEPROM_R0d,0xFF);  //Maximum des Tages
+						writeEEPROM(EEPROM_R0w,0xFF); //Maximum der Letzten 7 Tage
+						writeEEPROM(EEPROM_dol,0xFF); //Anzahl der Betriebstage
+						for(uint8_t i=0;i<7;i++) {
+							weekmaxarr[i]=1;
+						}
+					} else {
+						writeEEPROM(EEPROM_CODE_DAYOFR0,0x0037|(pack2.days_of_r0<<8));
+						writeEEPROM(EEPROM_CORR,pack2.page5d[1]);
+						writeEEPROM(EEPROM_FREE,pack2.page5d[2]);
+						writeEEPROM(EEPROM_TCORR_RESET,pack2.time_corr);
+					}
+				}
+				cpsp2=0;
+			}
+			if (wdcounter>0) {  //8s
+				pack2.tol_s8++;
+				if (pack2.tol_s8>(10000))  {//10800 ist theortisch der Tag aber meistens zu lang
+					pack2.tol_s8=0;
+					pack2.tol_d++;  //rund 180 Jahre :-)
+					pack2.r_week_max=0;
+					weekmaxarr[pack2.days_of_r0]=pack2.r_day_max;
+					for(uint8_t i=0;i<pack2.days_of_r0;i++) {
+						weekmaxarr[i]=weekmaxarr[i+1];
+						//maximum of week
+						if (weekmaxarr[i]>pack2.r_week_max) pack2.r_week_max=weekmaxarr[i];
+					}
+					if (pack2.tol_d>7) {
+						pack2.R0=pack2.r_week_max;
+					} else {
+						pack2.R0=pack2.r_day_max;
+					}
+					//R0=//R0-0.5*(pack2.R0/100-R0);
+					R0=R0-(R0-pack2.R0/100.0)*0.5	;
+					pack2.R0=R0*100;
+					writeEEPROM(EEPROM_R0,pack2.R0);
+					writeEEPROM(EEPROM_R0d,pack2.r_day_max);  //Maximum des Tages
+					writeEEPROM(EEPROM_R0w,pack2.r_week_max); //Maximum der Letzten 7 Tage
+					writeEEPROM(EEPROM_dol,pack2.tol_d); //Anzahl der Betriebstage
+					pack2.r_day_max=0;
+				}
+				if (startup!=0) startup--;
+				getSHT2xHumTemp(&temperatureC,&humidityRH);
+				ip=interp(temperatureC,humidityRH);
+				pack2.ip=ip*1000;
+				//double RH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+				//double TC =temperatureC *10.0-2;
+				double RH=calibr_hum075(temperatureC,humidityRH)*10.0;
+				//double RH=humidityRH*10.0;
+				double TC=temperatureC*10.0-7.5;
+
+
+				if (testSW()) {
+					DS2438_2_VAD=RH;
+					DS2438_2_TEMP=TC*25.6;
+					config_info2[5]=12;	//10V = 100%
+				}else{
+					hhum=(1.0546-0.000216*TC)*(RH);
+					DS2438_2_VAD=0.31*hhum +80;
+					DS2438_2_TEMP=TC*25.6;
+					config_info2[5]=7;
+				}
+				mr=0;
+				//Kritische Sektion !___Ein Breakpoint in dieser Section kann den TGS8100 zerstoeren!___________________________
+				PORTB&=~(1<<PINB1); //Auf 0 Ziehen
+				_delay_us(500);
+				for(uint8_t i=0;i<32;i++) {
+					ADCSRA|=(1<<ADSC);
+					while ((ADCSRA&(1<<ADSC)));
+					mr+=ADC;
+				 }
+				PORTB|=(1<<PINB1);
+				//ENDE Kritische Sektion !______________________________
+
+				//pack2.VS=mr*3/128;  //VS in Volt = VS/256  --> Nur zum Debug .... Speicher reicht sonst nicht....
+				l=mr*3.0/32768.0;  //Spannung in v
+				l=( 3/l- 1) *30; //l is resistance
+				if (lainit) {
+					la[0]=la[1]=la[2]=la[3]=l;  //smaller code
+					lainit=0;
+				} else {
+					//for (uint8_t i=0;i<3;i++) {
+					//	la[i]=la[i+1];
+					//}
+					la[0]=la[1];
+					la[1]=la[2];
+					la[2]=la[3];
+					la[3]=l;
+				}
+				double lasum=la[0]+la[1]+la[2]+la[3];
+				l=lasum/4.0;
+				
+				pack2.current=l*100;
+				
+				l=l/ip;
+				
+				if (startup==0){
+					if (l>R0) {
+						R0=l;
+						pack2.R0=R0*100;
+						writeEEPROM(EEPROM_R0,pack2.R0);
+
+					}
+					if (l*100>pack2.r_day_max) {
+						pack2.r_day_max=l*100;
+					}
+				} else if (l<R0) l=R0; //negative Werte am Anfang verhintern
+				//l=exp((1-(l/R0))*6.05)-1;// exp((1-($val)/55)*5.75);  (5.75 geht über 125 6.05 geht bis 240... mittlere Linie im Datenblatt)
+				//l=pow(R0/l,1.8)*3-3; 
+				if (l!=0) {
+					l=R0/l;
+					//l=l*l*12-12;
+					l=exp((1-(1/l))*6.05)-1;
+					l=l*(double)pack2.corr_VOC_mult/(double)pack2.corr_VOC_div;
+					l=l*8.0; //fuer DS18B20*/
+				}	
+				wdcounter=0;
+				DS2438_1_VAD=l;
+				DS2438_1_VDD=(l-DS2438_1_VAD)*1000.0;
+				
+				l=MAX44009getlux(1);
+				if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
+				//double l=1000;
+				l=log(l)*10*256;
+				DS2438_1_TEMP=l;
+
+				
+			}
+			
+			
+			if (gcontrol) {
+				gcontrol=0;
+				
+			}
+
+			
+			OWST_MAIN_END
+		}
+
+
+	}
diff --git a/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.atsln b/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.atsln
new file mode 100644
index 0000000..51074a8
--- /dev/null
+++ b/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_MAX44009_VOC_DS2438_SHT", "DS2438_MAX44009_VOC_DS2438_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.cproj b/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.cproj
new file mode 100644
index 0000000..c0dbf44
--- /dev/null
+++ b/DS2438_MAX44009_VOC_DS2438_SHT_direct/DS2438_MAX44009_VOC_DS2438_SHT.cproj
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS2438_MAX44009_VOC_DS2438_SHT</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <ResetRule>0</ResetRule>
+    <EraseKey />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.preprocessor.UndefSymbols>
+    <ListValues>
+      <Value>_CHANGEABLE_ID_</Value>
+    </ListValues>
+  </avrgcc.compiler.preprocessor.UndefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.AssemblerFlags>-U_CHANGEABLE_ID_</avrgcc.assembler.general.AssemblerFlags>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\MAX44009.c">
+      <SubType>compile</SubType>
+      <Link>MAX44009.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2438_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_DS2438.c b/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_DS2438.c
new file mode 100644
index 0000000..eb3ad1e
--- /dev/null
+++ b/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_DS2438.c
@@ -0,0 +1,189 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>  
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/calibr.h"
+#include "../common/I2C/BMP280.h"
+#include "../common/I2C/MAX44009.h"
+#include "../common/owSlave_tools.h"
+
+
+OWST_EXTERN_VARS
+
+
+
+volatile uint8_t owid1[8]={0x26, 0x01, 0x01, 0x01, 0x00, 0x00, 0x03, 0xF6};/**/
+volatile uint8_t owid2[8]={0x26, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xAF};/**/
+volatile uint8_t config_info1[26]={0x01,0x06, 0x05,0x08, 4,7, 0x00,0x00, 0x02,7,0x00,7,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+volatile uint8_t config_info2[26]={3,4, 0x05,0x08, 2,20, 0,0           , 0x02,15,0x00,14,0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+	
+
+
+typedef union {
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		uint8_t page1[8]; //9
+		uint8_t page2[8]; //17
+			
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		
+	};
+} pack1_t;
+volatile pack1_t pack1;
+
+
+
+
+typedef union {
+	volatile uint8_t bytes[64];
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8]; //25
+		uint8_t page7[8];  //57
+		
+	};
+} pack2_t;
+volatile pack2_t pack2;
+
+OWST_WDT_ISR
+OWST_TESTSW
+
+
+
+
+
+volatile int16_t DS2438_1_TEMP;
+volatile uint16_t DS2438_1_VAD;
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+
+
+
+double temperatureC,humidityRH,hhum;
+double l;
+uint32_t P;
+int32_t t;
+uint8_t max_adr=0;
+
+
+int main(void){
+	OWST_INIT_USI_ON
+	OWINIT();
+	OWST_WDR_CONFIG8
+	OWST_EN_PULLUP
+	
+	pack1.page3[0]=0xF1;
+	pack2.page3[0]=0xF4;
+
+
+	USI_TWI_Master_Initialise();
+	_delay_ms(10);
+	bmp280Init();
+	_delay_ms(10);
+	initSHT2x();
+	_delay_ms(100);
+	if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
+	gcontrol=1;
+	sei();
+
+    while(1)   {
+		if (gcontrol) wdcounter=1;
+		if (wdcounter>0) {  //8s
+			getSHT2xHumTemp(&temperatureC,&humidityRH);
+			double RH=humidityRH*10.0;
+			double TC =temperatureC *10.0;
+			if (testSW()) {
+				DS2438_1_VAD=RH;
+				DS2438_1_TEMP=TC*25.6;
+				config_info1[5]=12;	//10V = 100%
+			}else{
+				hhum=(1.0546-0.000216*TC)*(RH);
+				//am2302_hum=0.318*hhum +76.0;
+				DS2438_1_VAD=0.31*hhum +80;
+				DS2438_1_TEMP=TC*25.6;
+				config_info1[5]=7;
+			}
+			wdcounter=0;
+			bmp280ConvertInt(&t,&P,1);
+			uint16_t Pu=P/50;
+			Pu=Pu-1400;
+			DS2438_2_VAD=Pu;
+			l=MAX44009getlux(max_adr);
+			if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
+			//double l=1000;
+			l=log(l)*10*16;
+			DS2438_2_TEMP=l;
+			
+		}
+	
+		if (gcontrol) {
+			gcontrol=0;
+		}
+
+		
+		OWST_MAIN_END
+   }
+
+
+}
diff --git a/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.atsln b/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.atsln
new file mode 100644
index 0000000..5103429
--- /dev/null
+++ b/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_SHT2X_DS2438_BMP280_MAX44009", "DS2438_SHT2X_DS2438_BMP280_MAX44009.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.cproj b/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.cproj
new file mode 100644
index 0000000..d3b09b1
--- /dev/null
+++ b/DS2438_SHT2X_DS2438_BMP280_MAX44009/DS2438_SHT2X_DS2438_BMP280_MAX44009.cproj
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS2438_SHT2X_DS2438_BMP280_MAX44009</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\BMP280.c">
+      <SubType>compile</SubType>
+      <Link>BMP280.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\MAX44009.c">
+      <SubType>compile</SubType>
+      <Link>MAX44009.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2438_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_SHT2X_DS2438_LPS225HB/DS2438_DS2438.c b/DS2438_SHT2X_DS2438_LPS225HB/DS2438_DS2438.c
new file mode 100644
index 0000000..3e71e92
--- /dev/null
+++ b/DS2438_SHT2X_DS2438_LPS225HB/DS2438_DS2438.c
@@ -0,0 +1,282 @@
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>  
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/LPS225HB.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/calibr.h"
+
+extern void OWINIT(void);
+extern void EXTERN_SLEEP(void);
+
+
+
+volatile uint8_t owid1[8]={0x26, 0x3B, 0xDA, 0x84, 0x00, 0x00, 0x03, 0xA2};/**/
+volatile uint8_t owid2[8]={0x26, 0x3C, 0xDA, 0x84, 0x00, 0x00, 0x03, 0x27};/**/
+volatile uint8_t config_info1[26]={0x02,23, 0x05,0x08, 0x2,20, 0x00,0x00, 0x02,29,0x00,29,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+volatile uint8_t config_info2[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0,0, 0x02,0x07,0x00,0x07,0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};	
+	
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=1;
+
+
+typedef union {
+	#if  defined(__AVR_ATtiny25__)
+	volatile uint8_t bytes[16];
+	#else
+	volatile uint8_t bytes[64];
+	#endif
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		union {
+		uint8_t page1[8]; //9
+		struct {
+			uint32_t etm;
+			uint8_t ica;
+			uint16_t offset;
+			uint8_t f1;
+		};
+		};
+		#if  defined(__AVR_ATtiny25__)
+		#else
+		union {
+				uint8_t page2[8]; //17
+				struct  {
+				uint32_t dis; 
+				uint32_t eoc;
+				};
+				};
+			
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		
+		#endif
+	};
+} pack1_t;
+volatile pack1_t pack1;
+
+
+
+
+typedef union {
+	#if  defined(__AVR_ATtiny25__)
+	volatile uint8_t bytes[16];
+	#else
+	volatile uint8_t bytes[64];
+	#endif
+	struct {
+		uint8_t status;  //1
+		int16_t temp;  //2
+		uint16_t voltage;  //4
+		int16_t current;  //6
+		uint8_t threshold; //8
+		
+		uint8_t page1[8]; //9
+		#if  defined(__AVR_ATtiny25__)
+		#else
+		uint8_t page2[8]; //17
+		uint8_t page3[8]; //25
+		
+		uint8_t page4[8];  //33
+		uint8_t page5[8];  //41
+		uint8_t page6[8];  //49
+		uint8_t page7[8];  //57
+		
+		#endif
+	};
+} pack2_t;
+volatile pack2_t pack2;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+
+
+
+volatile int16_t DS2438_1_TEMP;
+volatile uint16_t DS2438_1_VAD;
+volatile int16_t DS2438_2_TEMP;
+volatile uint16_t DS2438_2_VAD;
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH,hhum;
+double l;
+uint32_t P;
+int16_t t;
+
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB|=(1<<PORTB0); //Pullup
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 __asm__ __volatile__ ("nop"); 
+	 r=PINB&(1<<PORTB0);
+	 __asm__ __volatile__ ("nop"); 
+	 PORTB&=~(1<<PORTB0); 
+	 __asm__ __volatile__ ("nop"); 
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);  //Offen mal HIH4030
+	 
+	 
+}
+
+
+int main(void){
+    PRR|=(1<<PRADC);  // adc for save Power
+	PORTA=0xFF;
+	PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+	DDRB|=(1<<PORTB0); //Als Ausgang und 0
+	OWINIT();
+	DDRB|=(1<<PINB1);//Ausgang und 1
+	DDRA|=(1<<PINA0);
+	
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	
+	MCUSR=0;
+
+	pack2.page3[0]=0xF1; //Luftfeuchte
+	pack1.page3[0]=0xF4; //Spannung
+
+
+	if (testSW()) {
+		config_info2[5]=12;
+	}else{
+		config_info2[5]=7;
+	}
+
+	USI_TWI_Master_Initialise();
+	initSHT2x();
+	_delay_ms(10);
+	 LPS225HB_Init();
+	gcontrol=1;
+	sei();
+    while(1)   {
+		if (gcontrol) {
+			//wdcounter=3;
+			gcontrol=0;
+				
+		}
+		if (wdcounter>3) {  
+			getSHT2xHumTemp(&temperatureC,&humidityRH);
+			double RH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0;
+			double TC =temperatureC *10.0-2;
+
+
+			if (testSW()) {
+				 DS2438_2_VAD=RH;
+				 DS2438_2_TEMP=TC*25.6;
+				 
+				 config_info2[5]=12;	//10V = 100%
+			}else{
+				hhum=(1.0546-0.000216*TC)*(RH);
+				//am2302_hum=0.318*hhum +76.0;
+				DS2438_2_VAD=0.31*hhum +80;
+				DS2438_2_TEMP=TC*25.6;
+				config_info2[5]=7;
+			}
+			//DS2438_1_TEMP=DS2438_2_TEMP;
+
+			LPS225HB_Readi(&t,&P) ;
+			P=P-700*(uint32_t)(4096);
+			P=((double)P/102.4);
+			//cli();pack.A=ADC;sei();
+			//cli();DS2438_1_TEMP=P;sei();
+			DS2438_1_TEMP=P;
+			P=P/20;
+			DS2438_1_VAD=P;
+
+		//	gcontrol=1;
+			wdcounter=0;
+			
+		}
+	
+		
+
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+   }
+
+
+}
diff --git a/DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.atsln b/DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.atsln
new file mode 100644
index 0000000..3272c84
--- /dev/null
+++ b/DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_SHT2X_DS2438_LPS225HB", "DS2438_SHT2X_DS2438_LPS225HB.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+		{7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.cproj b/DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.cproj
new file mode 100644
index 0000000..8c358a6
--- /dev/null
+++ b/DS2438_SHT2X_DS2438_LPS225HB/DS2438_SHT2X_DS2438_LPS225HB.cproj
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS18B20_DS2438</AssemblyName>
+    <Name>DS2438_SHT2X_DS2438_LPS225HB</Name>
+    <RootNamespace>DS18B20_DS2438</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <com_atmel_avrdbg_tool_simulator>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>
+        </InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
+      <ToolNumber>
+      </ToolNumber>
+      <ToolName>Simulator</ToolName>
+    </com_atmel_avrdbg_tool_simulator>
+    <ExternalProgrammingToolCommand />
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\LPS225HB.c">
+      <SubType>compile</SubType>
+      <Link>LPS225HB.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2438_DS2438.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2438_DS2438.S</Link>
+    </Compile>
+    <Compile Include="DS2438_DS2438.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2438_SHT3X/DS2438_SHT3X.c b/DS2438_SHT3X/DS2438_SHT3X.c
index d283508..a5b53e1 100644
--- a/DS2438_SHT3X/DS2438_SHT3X.c
+++ b/DS2438_SHT3X/DS2438_SHT3X.c
@@ -150,7 +150,8 @@ int main(void){
 	MCUSR=0;
 	USI_TWI_Master_Initialise();
 
-	
+	pack.page3[0]=0xF1;
+
 	
 	initSHT3x(0);
 	_delay_ms(100);
@@ -188,6 +189,7 @@ int main(void){
 
 		if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {
 			MCUCR|=(1<<SE)|(1<<SM1);
+			
 			MCUCR&=~(1<<ISC01);
 		} else {
 			MCUCR|=(1<<SE);
diff --git a/DS2438_SHT3X/DS2438_SHT3X.cproj b/DS2438_SHT3X/DS2438_SHT3X.cproj
index bcc5eb3..18f6e87 100644
--- a/DS2438_SHT3X/DS2438_SHT3X.cproj
+++ b/DS2438_SHT3X/DS2438_SHT3X.cproj
@@ -25,7 +25,7 @@
     <preserveEEPROM>true</preserveEEPROM>
     <OverrideVtorValue>exception_table</OverrideVtorValue>
     <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <eraseonlaunchrule>0</eraseonlaunchrule>
     <AsfFrameworkConfig>
       <framework-data>
         <options />
@@ -42,87 +42,89 @@
     <com_atmel_avrdbg_tool_atmelice>
       <ToolOptions>
         <InterfaceProperties>
+          <IspClock>125000</IspClock>
         </InterfaceProperties>
-        <InterfaceName>debugWIRE</InterfaceName>
+        <InterfaceName>ISP</InterfaceName>
       </ToolOptions>
       <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
       <ToolNumber>J41800000789</ToolNumber>
       <ToolName>Atmel-ICE</ToolName>
     </com_atmel_avrdbg_tool_atmelice>
-    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <avrtoolinterface>ISP</avrtoolinterface>
     <ExternalProgrammingToolCommand />
     <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
     <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
     <ToolchainSettings>
       <AvrGcc>
-  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
-  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-  <avrgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>__4MHZ__</Value>
-    </ListValues>
-  </avrgcc.compiler.symbols.DefSymbols>
-  <avrgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
-    </ListValues>
-  </avrgcc.compiler.directories.IncludePaths>
-  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-  <avrgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </avrgcc.linker.libraries.Libraries>
-  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-</AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>__4MHZ__</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
     <ToolchainSettings>
       <AvrGcc>
-  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
-  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-  <avrgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-      <Value>__4MHZ__</Value>
-    </ListValues>
-  </avrgcc.compiler.symbols.DefSymbols>
-  <avrgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
-    </ListValues>
-  </avrgcc.compiler.directories.IncludePaths>
-  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-  <avrgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </avrgcc.linker.libraries.Libraries>
-  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-</AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+            <Value>__4MHZ__</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
diff --git a/DS2450/DS2450.c b/DS2450/DS2450.c
index e2fb6c3..0e92255 100644
--- a/DS2450/DS2450.c
+++ b/DS2450/DS2450.c
@@ -38,6 +38,7 @@
 #include <avr/wdt.h>
 #include <avr/sleep.h>
 #include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
 
 extern void OWINIT();
 extern void EXTERN_SLEEP();
@@ -49,12 +50,25 @@ uint8_t config_info[26]={0x06,0x09,0x06,0x09,0x06,0x09,0x06,0x09,0x02,20,20,20,2
 #error "Variable not correct"
 #endif
 
-extern uint8_t mode;
+extern volatile uint8_t mode;
 extern uint8_t gcontrol;
 extern uint8_t reset_indicator;
 extern uint8_t alarmflag;
 
 
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+	#else
+	ISR(WDT_vect) {
+	// mode=0;
+		#endif
+	//wdcounter++;
+			if (reset_indicator==1) reset_indicator++;
+		else if (reset_indicator==2) mode=0;
+	}
+
+
 typedef union {
 	volatile uint8_t bytes[0x20];
 	struct {
@@ -99,8 +113,15 @@ typedef union {
 volatile pack_t pack;
 
 
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__)||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+#define AD_PORT PORTA
+#define AD_DDR DDRA
+#endif
 
-
+#if  defined(__AVR_ATmega168__)||defined(__AVR_ATmega168A__) ||defined(__AVR_ATmega328__) ||defined(__AVR_ATmega328P__) ||defined(__AVR_ATmega328PB__) 
+#define AD_PORT PORTC
+#define AD_DDR DDRC
+#endif
 
 
 int main(void){
@@ -125,20 +146,31 @@ int main(void){
 	pack.HD=0xFF;
 	pack.LD=0x00;
 	pack.VCCP=0;
+	 MCUCR &=~(1<<PUD); //All Pins Pullup...
+	 MCUCR |=(1<<BODS);
+	 MCUSR=0;
 
-	PORTA=0xFF;
-	PORTB=0xFF;
 
-	OWINIT();
 
+	OWINIT();
+	DDRC=0xFF;
+	DDRB=0xFF;
+	DDRD=0xFF-(1<<PIND2);
+	PORTB=0xFF;
+	PORTC=0xFF;
+	PORTD=0xFF-(1<<PIND2);
+	PRR=0xCF;
+		
 	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
+	//MCUCR |=(1<<BODS);
 	//PORTA&=~((1<<PINA0)|(1<<PINA1)|(1<<PINA2)|(1<<PINA3));
 
-	ADCSRA=(1<<ADEN)|(1<ADPS0)|(1<<ADPS2);
+	//ADCSRA=(1<<ADEN)|(1<ADPS0)|(1<<ADPS2);
 
 	
-	
+		WDTCSR |= (1<<WDCE) |(1<<WDE);   // Enable the WD Change Bit//| (1<<WDE)
+		WDTCSR  =   (1<<WDIE) |              // Enable WDT Interrupt
+		(1<<WDP2) | (1<<WDP0);   // Set Timeout to ~8 seconds
 	gcontrol=1;
 	ADCSRB|=(1<<ADLAR); 
 	sei();
@@ -215,34 +247,53 @@ int main(void){
 		}
 
 		uint8_t bb=1;
-		for(uint8_t i=0;i<4;i++) {
+		for(volatile uint8_t i=0;i<4;i++) {
 			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
 				if (pack.bytes[8+i*2]&0x40) {
-					DDRA|=bb;
+				//	AD_DDR|=bb;
 				} else {
-					DDRA&=~bb;
+					cli();
+				//	AD_DDR&=~bb;
+					sei();
 				}
 			} else {
-				DDRA&=~bb;
+				cli();
+			//	AD_DDR&=~bb;
+				sei();
 			}
 			bb=bb*2;
 		}
 		
+
+#if defined(__AVR_ATmega168__)||defined(__AVR_ATmega168A__)  ||defined(__AVR_ATmega328__) ||defined(__AVR_ATmega328P__) ||defined(__AVR_ATmega328PB__) 
+	if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0)){
+	//if ( mode==0){
+		SMCR|=(1<<SE)|(1<<SM1);
+		EICRA&=~(1<<ISC01);
+	} else {
+		SMCR|=(1<<SE);
+		SMCR&=~(1<<SM1);
+	}
+	asm("SLEEP");
+#else
+
 #if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
 			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
 #endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__) 
 			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
 #endif
 			  {
 
 			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<SM0);
 			MCUCR&=~(1<<ISC01);
 		} else {
 			MCUCR|=(1<<SE);
 			MCUCR&=~(1<<SM1);
 		}
-	//	asm("SLEEP");
+		asm("SLEEP");
+#endif
    }
 
 
diff --git a/DS2450/DS2450.cproj b/DS2450/DS2450.cproj
index 5eb8631..bba1e99 100644
--- a/DS2450/DS2450.cproj
+++ b/DS2450/DS2450.cproj
@@ -5,7 +5,7 @@
     <ProjectVersion>7.0</ProjectVersion>
     <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
     <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATtiny84A</avrdevice>
+    <avrdevice>ATmega328P</avrdevice>
     <avrdeviceseries>none</avrdeviceseries>
     <OutputType>Executable</OutputType>
     <Language>C</Language>
@@ -25,7 +25,7 @@
     <preserveEEPROM>true</preserveEEPROM>
     <OverrideVtorValue>exception_table</OverrideVtorValue>
     <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <eraseonlaunchrule>0</eraseonlaunchrule>
     <ExternalProgrammingToolCommand />
     <AsfFrameworkConfig>
       <framework-data>
@@ -39,87 +39,106 @@
         </dependencies>
       </framework-data>
     </AsfFrameworkConfig>
-    <avrtool />
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolinterface>ISP</avrtoolinterface>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E950F</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
     <ToolchainSettings>
       <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>NDEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-      </AvrGcc>
+  <avrgcc.common.Device>-mmcu=atmega328p -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\include</Value>
+    </ListValues>
+  </avrgcc.assembler.general.IncludePaths>
+</AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
     <ToolchainSettings>
       <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>DEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-      </AvrGcc>
+  <avrgcc.common.Device>-mmcu=atmega328p -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\include</Value>
+    </ListValues>
+  </avrgcc.assembler.general.IncludePaths>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
     <Compile Include="DS2450.c">
       <SubType>compile</SubType>
     </Compile>
diff --git a/DS2450/OWDS2450.S b/DS2450/OWDS2450.S
index 61a1dad..a3381b4 100644
--- a/DS2450/OWDS2450.S
+++ b/DS2450/OWDS2450.S
@@ -33,8 +33,8 @@
 
 #define _CHANGEABLE_ID_
 #define _ZERO_POLLING_
-#define  __4MHZ__
-
+//#define  __4MHZ__
+//#define _DB_
 #include "../common/OWConfig.s"
 #include "../common/OWCRC16.s"
 
@@ -140,9 +140,9 @@ h_readmemory_init_crc:; init erstes CRC byte
 	;ldi r_bcount,1
 	rjmp handle_end
 h_readmemory_end:
-	ldi  r_mode,OW_SLEEP
-	clr r_sendflag
-	rjmp handle_end
+	//ldi  r_mode,OW_SLEEP
+	//clr r_sendflag
+	rjmp handle_end_sleep
 h_readmemorycrc1:;init zweites CRC Byte
 	lds r_rwbyte,crcsave
 	;ldi r_bcount,1
diff --git a/DS2450_ADC/DS2450.c b/DS2450_ADC/DS2450.c
new file mode 100644
index 0000000..2dc7006
--- /dev/null
+++ b/DS2450_ADC/DS2450.c
@@ -0,0 +1,305 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/owSlave_tools.h"
+
+
+OWST_EXTERN_VARS
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={0x06,0x09,0x06,9,0x06,9,0x06,9,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+OWST_WDT_ISR
+
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+OWST_ADC_CONF16_FUNC
+OWST_ADC_CONF16_OSS_FUNC
+OWST_TESTSW
+
+#define LPIN_CH2 (1<<PINB1)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LED2_ON LPORT_CH2&=~LPIN_CH2;
+#define LED2_OFF LPORT_CH2|=LPIN_CH2;
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+	OWST_INIT_ADC_ON
+	OWINIT();
+
+	OWST_WDR_CONFIG8
+	gcontrol=1;
+	OWST_INIT_ADC
+	AD_DDR&=~(1<<PINA0);
+	AD_PORT&=~(1<<PINA0);
+	AD_DDR&=~(1<<PINA1);
+	AD_PORT&=~(1<<PINA1);
+	AD_DDR&=~(1<<PINA3);
+	AD_PORT&=~(1<<PINA3);
+	AD_DDR&=~(1<<PINA7);
+	AD_PORT&=~(1<<PINA7);
+	DIDR0|=((1<<ADC7D)|(1<<ADC3D)|(1<<ADC1D)|(1<<ADC0D));
+	sei();
+	wdcounter=5;
+	//DDRB|=(1<<PINB1);
+	LDD_CH2 |=LPIN_CH2;
+	volatile double VCC;
+	volatile double VAD_A,VAD_B,VAD_C,VAD_D;
+    while(1)   {
+		if (wdcounter>3) {
+			LED2_ON
+			wdcounter=0;
+			ADMUX=OWST_ADCIN_REFINT;
+			_delay_us(100);
+			VCC=owst_ADC_runf();
+			VCC=(1.079*65472.0)/VCC;
+			//if (VCC>5.1) VCC=5.1;
+			//VAD=VCC*65535.0/5.1;
+			//if (VAD>65535) VAD=65535;
+			if (testSW()) {	 //Zwei differential Eingaenge
+				VAD_C=0;
+				ADMUX=0b001000; //ADC0 + ADC1 - Gain 1
+				_delay_us(100);
+				VAD_A=owst_ADC_runf();
+				if (VAD_A<3100) {
+					ADMUX=0b001001; //ADC0 + ADC1 - Gain 20
+					_delay_us(100);
+					VAD_A=owst_ADC_runf();
+					VAD_A=VCC/20.0*VAD_A/65472.0;
+					//VAD_A=VCC/20.0;
+					VAD_C+=12850;
+				} else {
+					VAD_A=owst_ADC_OSS_runf();
+					VAD_A=VCC*VAD_A/65472.0;
+					VAD_C+=0;
+				}
+				if (pack.CSA2&0x01) VAD_A=VAD_A*65535.0/5.1; else VAD_A=VAD_A*65535.0/2.55;
+				if (VAD_A>65535) VAD_A=65535;
+				///_------------------------ B---------------------
+				ADMUX=0b011000; //ADC3 + ADC7 - Gain 1
+				_delay_us(100);
+				VAD_B=owst_ADC_runf();
+				if (VAD_B<3100) {
+					ADMUX=0b011001; //ADC3 + ADC7 - Gain 20
+					_delay_us(100);
+					VAD_B=owst_ADC_runf();
+					VAD_B=VCC/20.0*VAD_B/65472.0;
+					//VAD_B=VAD_B20.0;
+					VAD_C+=12850*2;
+				} else {
+					VAD_B=owst_ADC_OSS_runf();
+					VAD_B=VCC*VAD_B/65472.0;
+					VAD_C+=0;
+				}
+				if (pack.CSB2&0x01) VAD_B=VAD_B*65535.0/5.1; else VAD_B=VAD_B*65535.0/2.55;
+				//VAD_B=VAD_B*65535.0/5.1;
+				if (VAD_B>65535) VAD_B=65535;
+				VAD_D=VCC*65535.0/5.1;
+				if (VAD_D>65535) VAD_D=65535;
+
+			} else { // 4 Eingaenge gegen Masse
+				ADMUX=OWST_ADCIN_PA0;
+				_delay_us(100);
+				VAD_A=owst_ADC_OSS_runf();
+				VAD_A=VCC*VAD_A/65472.0;
+				if (pack.CSA2&0x01) VAD_A=VAD_A*65535.0/5.1; else VAD_A=VAD_A*65535.0/2.55;
+				if (VAD_A>65535) VAD_A=65535;
+
+				ADMUX=OWST_ADCIN_PA1;
+				_delay_us(100);
+				VAD_B=owst_ADC_OSS_runf();
+				VAD_B=VCC*VAD_B/65472.0;
+				if (pack.CSB2&0x01) VAD_B=VAD_B*65535.0/5.1; else VAD_B=VAD_B*65535.0/2.55;
+				if (VAD_B>65535) VAD_B=65535;
+
+				ADMUX=OWST_ADCIN_PA3;
+				_delay_us(100);
+				VAD_C=owst_ADC_OSS_runf();
+				VAD_C=VCC*VAD_C/65472.0;
+				if (pack.CSC2&0x01) VAD_C=VAD_C*65535.0/5.1; else VAD_C=VAD_C*65535.0/2.55;
+				if (VAD_C>65535) VAD_C=65535;
+
+				ADMUX=OWST_ADCIN_PA7;
+				_delay_us(100);
+				VAD_D=owst_ADC_OSS_runf();
+				VAD_D=VCC*VAD_D/65472.0;
+				if (pack.CSD2&0x01) VAD_D=VAD_D*65535.0/5.1; else VAD_D=VAD_D*65535.0/2.55;
+				if (VAD_D>65535) VAD_D=65535;
+			}
+			LED2_OFF
+
+
+		}
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){ //Initialisieren mit 0 oder FF oder letzter Wert
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				//if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				cli();pack.A=VAD_A;sei();
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				//if (pack.CSB2&0x01)	ADMUX=1; else ADMUX=0x81;
+				cli();pack.B=VAD_B;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				//if (pack.CSC2&0x01)	ADMUX=2; else ADMUX=0x82;
+				cli();pack.C=VAD_C;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				cli();pack.D=VAD_D;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		uint8_t bb=1;
+		for(volatile uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+				//	AD_DDR|=bb;
+				} else {
+					cli();
+				//	AD_DDR&=~bb;
+					sei();
+				}
+			} else {
+				cli();
+			//	AD_DDR&=~bb;
+				sei();
+			}
+			bb=bb*2;
+		}
+		OWST_MAIN_END 
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_ADC/DS2450_ADC.atsln b/DS2450_ADC/DS2450_ADC.atsln
new file mode 100644
index 0000000..0ca60e9
--- /dev/null
+++ b/DS2450_ADC/DS2450_ADC.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_ADC", "DS2450_ADC.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_ADC/DS2450_ADC.cproj b/DS2450_ADC/DS2450_ADC.cproj
new file mode 100644
index 0000000..577de37
--- /dev/null
+++ b/DS2450_ADC/DS2450_ADC.cproj
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_ADC</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="DS2450.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_ADC/OWDS2450.S b/DS2450_ADC/OWDS2450.S
new file mode 100644
index 0000000..a3381b4
--- /dev/null
+++ b/DS2450_ADC/OWDS2450.S
@@ -0,0 +1,248 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+//#define  __4MHZ__
+//#define _DB_
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	//ldi  r_mode,OW_SLEEP
+	//clr r_sendflag
+	rjmp handle_end_sleep
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_ADC_JOE2/DS2450.c b/DS2450_ADC_JOE2/DS2450.c
new file mode 100644
index 0000000..edf3076
--- /dev/null
+++ b/DS2450_ADC_JOE2/DS2450.c
@@ -0,0 +1,305 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/owSlave_tools.h"
+
+
+OWST_EXTERN_VARS
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={0x06,0x09,0x06,9,0x06,9,0x06,9,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+OWST_WDT_ISR
+
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+OWST_ADC_CONF16_FUNC
+OWST_ADC_CONF16_OSS_FUNC
+OWST_TESTSW
+
+#define LPIN_CH2 (1<<PINB1)
#define LDD_CH2 DDRB
#define LPORT_CH2 PORTB
#define LED2_ON LPORT_CH2&=~LPIN_CH2;
+#define LED2_OFF LPORT_CH2|=LPIN_CH2;
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+	OWST_INIT_ADC_ON
+	OWINIT();
+
+	OWST_WDR_CONFIG8
+	gcontrol=1;
+	OWST_INIT_ADC
+	AD_DDR&=~(1<<PINA4);
+	AD_PORT&=~(1<<PINA4);
+	AD_DDR&=~(1<<PINA5);
+	AD_PORT&=~(1<<PINA5);
+	AD_DDR&=~(1<<PINA6);
+	AD_PORT&=~(1<<PINA6);
+	AD_DDR&=~(1<<PINA7);
+	AD_PORT&=~(1<<PINA7);
+	DIDR0|=((1<<ADC4D)|(1<<ADC5D)|(1<<ADC6D)|(1<<ADC7D));
+	sei();
+	wdcounter=5;
+	//DDRB|=(1<<PINB1);
+	LDD_CH2 |=LPIN_CH2;
+	volatile double VCC;
+	volatile double VAD_A,VAD_B,VAD_C,VAD_D;
+    while(1)   {
+		if (wdcounter>3) {
+			LED2_ON
+			wdcounter=0;
+			ADMUX=OWST_ADCIN_REFINT;
+			_delay_us(100);
+			VCC=owst_ADC_runf();
+			VCC=(1.079*65472.0)/VCC;
+			//if (VCC>5.1) VCC=5.1;
+			//VAD=VCC*65535.0/5.1;
+			//if (VAD>65535) VAD=65535;
+			if (testSW()) {	 //Zwei differential Eingaenge
+				VAD_C=0;
+				ADMUX=0b0011010; //ADC4 + ADC5 - Gain 1
+				_delay_us(100);
+				VAD_A=owst_ADC_runf();
+				if (VAD_A<3100) {
+					ADMUX=0b0011011; //ADC0 + ADC1 - Gain 20
+					_delay_us(100);
+					VAD_A=owst_ADC_runf();
+					VAD_A=VCC/20.0*VAD_A/65472.0;
+					//VAD_A=VCC/20.0;
+					VAD_C+=12850;
+				} else {
+					VAD_A=owst_ADC_OSS_runf();
+					VAD_A=VCC*VAD_A/65472.0;
+					VAD_C+=0;
+				}
+				if (pack.CSA2&0x01) VAD_A=VAD_A*65535.0/5.1; else VAD_A=VAD_A*65535.0/2.55;
+				if (VAD_A>65535) VAD_A=65535;
+				///_------------------------ B---------------------
+				ADMUX=0b011110; //ADC6 + ADC7 - Gain 1
+				_delay_us(100);
+				VAD_B=owst_ADC_runf();
+				if (VAD_B<3100) {
+					ADMUX=0b011111; //ADC6 + ADC7 - Gain 20
+					_delay_us(100);
+					VAD_B=owst_ADC_runf();
+					VAD_B=VCC/20.0*VAD_B/65472.0;
+					//VAD_B=VAD_B20.0;
+					VAD_C+=12850*2;
+				} else {
+					VAD_B=owst_ADC_OSS_runf();
+					VAD_B=VCC*VAD_B/65472.0;
+					VAD_C+=0;
+				}
+				if (pack.CSB2&0x01) VAD_B=VAD_B*65535.0/5.1; else VAD_B=VAD_B*65535.0/2.55;
+				//VAD_B=VAD_B*65535.0/5.1;
+				if (VAD_B>65535) VAD_B=65535;
+				VAD_D=VCC*65535.0/5.1;
+				if (VAD_D>65535) VAD_D=65535;
+
+			} else { // 4 Eingaenge gegen Masse
+				ADMUX=OWST_ADCIN_PA4;
+				_delay_us(100);
+				VAD_A=owst_ADC_OSS_runf();
+				VAD_A=VCC*VAD_A/65472.0;
+				if (pack.CSA2&0x01) VAD_A=VAD_A*65535.0/5.1; else VAD_A=VAD_A*65535.0/2.55;
+				if (VAD_A>65535) VAD_A=65535;
+
+				ADMUX=OWST_ADCIN_PA5;
+				_delay_us(100);
+				VAD_B=owst_ADC_OSS_runf();
+				VAD_B=VCC*VAD_B/65472.0;
+				if (pack.CSB2&0x01) VAD_B=VAD_B*65535.0/5.1; else VAD_B=VAD_B*65535.0/2.55;
+				if (VAD_B>65535) VAD_B=65535;
+
+				ADMUX=OWST_ADCIN_PA6;
+				_delay_us(100);
+				VAD_C=owst_ADC_OSS_runf();
+				VAD_C=VCC*VAD_C/65472.0;
+				if (pack.CSC2&0x01) VAD_C=VAD_C*65535.0/5.1; else VAD_C=VAD_C*65535.0/2.55;
+				if (VAD_C>65535) VAD_C=65535;
+
+				ADMUX=OWST_ADCIN_PA7;
+				_delay_us(100);
+				VAD_D=owst_ADC_OSS_runf();
+				VAD_D=VCC*VAD_D/65472.0;
+				if (pack.CSD2&0x01) VAD_D=VAD_D*65535.0/5.1; else VAD_D=VAD_D*65535.0/2.55;
+				if (VAD_D>65535) VAD_D=65535;
+			}
+			LED2_OFF
+
+
+		}
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){ //Initialisieren mit 0 oder FF oder letzter Wert
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				//if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				cli();pack.A=VAD_A;sei();
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				//if (pack.CSB2&0x01)	ADMUX=1; else ADMUX=0x81;
+				cli();pack.B=VAD_B;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				//if (pack.CSC2&0x01)	ADMUX=2; else ADMUX=0x82;
+				cli();pack.C=VAD_C;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				cli();pack.D=VAD_D;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		uint8_t bb=1;
+		for(volatile uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+				//	AD_DDR|=bb;
+				} else {
+					cli();
+				//	AD_DDR&=~bb;
+					sei();
+				}
+			} else {
+				cli();
+			//	AD_DDR&=~bb;
+				sei();
+			}
+			bb=bb*2;
+		}
+		OWST_MAIN_END 
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_ADC_JOE2/DS2450_ADC.atsln b/DS2450_ADC_JOE2/DS2450_ADC.atsln
new file mode 100644
index 0000000..e78802a
--- /dev/null
+++ b/DS2450_ADC_JOE2/DS2450_ADC.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_ADC_JOE2", "DS2450_ADC_JOE2.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_ADC_JOE2/DS2450_ADC_JOE2.cproj b/DS2450_ADC_JOE2/DS2450_ADC_JOE2.cproj
new file mode 100644
index 0000000..aba66b8
--- /dev/null
+++ b/DS2450_ADC_JOE2/DS2450_ADC_JOE2.cproj
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_ADC_JOE2</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="DS2450.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_ADC_JOE2/OWDS2450.S b/DS2450_ADC_JOE2/OWDS2450.S
new file mode 100644
index 0000000..a3381b4
--- /dev/null
+++ b/DS2450_ADC_JOE2/OWDS2450.S
@@ -0,0 +1,248 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+//#define  __4MHZ__
+//#define _DB_
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	//ldi  r_mode,OW_SLEEP
+	//clr r_sendflag
+	rjmp handle_end_sleep
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_APDS9960/DS2450_APDS9960.atsln b/DS2450_APDS9960/DS2450_APDS9960.atsln
index 06d2247..d6e53d6 100644
--- a/DS2450_APDS9960/DS2450_APDS9960.atsln
+++ b/DS2450_APDS9960/DS2450_APDS9960.atsln
@@ -1,22 +1,22 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_APDS9960", "DS2450_APDS9960.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|AVR = Debug|AVR
-		Release|AVR = Release|AVR
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_APDS9960", "DS2450_APDS9960.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_APDS9960/DS2450_APDS9960.cproj b/DS2450_APDS9960/DS2450_APDS9960.cproj
index 43e905b..aadfa77 100644
--- a/DS2450_APDS9960/DS2450_APDS9960.cproj
+++ b/DS2450_APDS9960/DS2450_APDS9960.cproj
@@ -1,152 +1,152 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATtiny84A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>DS2450</AssemblyName>
-    <Name>DS2450_APDS9960</Name>
-    <RootNamespace>DS2450</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>1</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data>
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
-    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
-    <com_atmel_avrdbg_tool_atmelice>
-      <ToolOptions>
-        <InterfaceProperties>
-        </InterfaceProperties>
-        <InterfaceName>debugWIRE</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
-      <ToolNumber>J41800000789</ToolNumber>
-      <ToolName>Atmel-ICE</ToolName>
-    </com_atmel_avrdbg_tool_atmelice>
-    <avrtoolinterface>debugWIRE</avrtoolinterface>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>NDEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-      </AvrGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>DEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-      </AvrGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="..\common\I2C\APDS9960.c">
-      <SubType>compile</SubType>
-      <Link>APDS9960.c</Link>
-    </Compile>
-    <Compile Include="..\common\I2C\USI_TWI_Master.c">
-      <SubType>compile</SubType>
-      <Link>USI_TWI_Master.c</Link>
-    </Compile>
-    <Compile Include="DS2450_APDS9960.c">
-      <SubType>compile</SubType>
-    </Compile>
-    <Compile Include="OWDS2450.S">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_APDS9960</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\APDS9960.c">
+      <SubType>compile</SubType>
+      <Link>APDS9960.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_APDS9960.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
 </Project>
\ No newline at end of file
diff --git a/DS2450_APDS9960/OWDS2450.S b/DS2450_APDS9960/OWDS2450.S
new file mode 100644
index 0000000..61a1dad
--- /dev/null
+++ b/DS2450_APDS9960/OWDS2450.S
@@ -0,0 +1,248 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+#define  __4MHZ__
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_BME680/DS2450_BME680.atsln b/DS2450_BME680/DS2450_BME680.atsln
new file mode 100644
index 0000000..0c0f0c7
--- /dev/null
+++ b/DS2450_BME680/DS2450_BME680.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_BME680", "DS2450_BME680.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_BME680/DS2450_BME680.c b/DS2450_BME680/DS2450_BME680.c
new file mode 100644
index 0000000..c93bd56
--- /dev/null
+++ b/DS2450_BME680/DS2450_BME680.c
@@ -0,0 +1,272 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/BME680.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x23, 0x20};/**/
+//uint8_t config_info[26]={0x03,13,0x03,13,0x03,13,0x3,15,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+//uint8_t config_info[26]={1,14,4,8,2,8,11,18,0x02,24,24,24,24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info[26]={1,13,4,13,2,8,11,8,0x02,24,24,24,24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=10;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+	#else
+	ISR(WDT_vect) {
+		#endif
+		wdcounter++;
+	//	if (reset_indicator==1) reset_indicator++;
+		//else if (reset_indicator==2) mode=0;
+	}
+
+typedef union {
+	volatile uint8_t bytes[0x22];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+int16_t T;
+uint16_t H;
+uint32_t P;
+uint16_t G;
+
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+
+	PORTA=0xFF;
+	//PORTB=0xFF;
+	//PORTC=0xFF;
+//	PORTD=0xFF;
+
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+
+	//PORTA&=~((1<<PINA0)|(1<<PINA1)|(1<<PINA2)|(1<<PINA3));
+
+
+
+	WDTCSR |= (1<<WDCE) |(1<<WDE);   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR  =   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+
+	wdcounter=4;
+	
+	gcontrol=1;
+	TWI_Master_Initialise();
+	
+	initBME680();
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+		if (wdcounter>1) {
+			readBMP680(&T,&H,&P,&G);
+			wdcounter=0;
+		}
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				
+				//cli();pack.A=rlight[0];sei();
+				//cli();pack.A=r_gain;sei();
+				//cli();pack.A=T+32767;sei();
+				cli();pack.A=T;sei();
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				//cli();pack.B=rlight[1];sei();
+				//cli();pack.B=atime;sei();
+				cli();pack.B=H;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				//cli();pack.C=rlight[2];sei();
+				cli();pack.C=P/10;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				//cli();pack.D=rlight[3];sei();
+				cli();pack.D=G;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					//DDRA|=bb;
+				} else {
+					//DDRA&=~bb;
+				}
+			} else {
+				//DDRA&=~bb;
+			}
+			bb=bb*2;
+		}
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__) ||defined(__AVR_ATmega168__)||defined(__AVR_ATmega168A__)  ||defined(__AVR_ATmega328__) ||defined(__AVR_ATmega328P__) ||defined(__AVR_ATmega328PB__)
+
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_BME680/DS2450_BME680.cproj b/DS2450_BME680/DS2450_BME680.cproj
new file mode 100644
index 0000000..d947301
--- /dev/null
+++ b/DS2450_BME680/DS2450_BME680.cproj
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_BME680</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>0</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>ISP</avrtoolinterface>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+    </ListValues>
+  </avrgcc.assembler.general.IncludePaths>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include</Value>
+    </ListValues>
+  </avrgcc.assembler.general.IncludePaths>
+  <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\BME680.c">
+      <SubType>compile</SubType>
+      <Link>BME680.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_BME680.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_BME680/OWDS2450.S b/DS2450_BME680/OWDS2450.S
new file mode 100644
index 0000000..61a1dad
--- /dev/null
+++ b/DS2450_BME680/OWDS2450.S
@@ -0,0 +1,248 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+#define  __4MHZ__
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_BMP280/OWDS2450.S b/DS2450_BMP280/OWDS2450.S
new file mode 100644
index 0000000..1d81abd
--- /dev/null
+++ b/DS2450_BMP280/OWDS2450.S
@@ -0,0 +1,247 @@
+
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_CDM7160/DS2450_CDM7160.atsln b/DS2450_CDM7160/DS2450_CDM7160.atsln
new file mode 100644
index 0000000..6ee8119
--- /dev/null
+++ b/DS2450_CDM7160/DS2450_CDM7160.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_CDM7160", "DS2450_CDM7160.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_CDM7160/DS2450_CDM7160.c b/DS2450_CDM7160/DS2450_CDM7160.c
new file mode 100644
index 0000000..f69e8b4
--- /dev/null
+++ b/DS2450_CDM7160/DS2450_CDM7160.c
@@ -0,0 +1,280 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/CDM7160.h"
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+//6A02160084D9A320
+//uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t owid[8]={0x20, 0xB3, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x31};/**/
+uint8_t config_info[26]={0x10,13,0x0,0x0, 0,0, 0,0,0x02,16,0,0x00,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=10;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+
+uint16_t CO2;
+
+
+
+
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+ PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+ DDRB|=(1<<PORTB0); //Als Ausgang und 0
+ 
+ 
+ OWINIT();
+
+ ACSR|=(1<<ACD);  //Disable Comparator
+ ADCSRB|=(1<<ACME); //Disable Analog multiplexer
+ MCUCR &=~(1<<PUD); //All Pins Pullup...
+ MCUCR |=(1<<BODS);
+
+ 
+ WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+ WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+ (1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+
+	
+	gcontrol=1;
+	
+	USI_TWI_Master_Initialise();
+	CDM7160softReset();
+	_delay_ms(200);
+
+	CDM7160setMode(0); //Power Down Mode
+	_delay_ms(200);
+	CDM7160setAvCount(0x3F);
+	CDM7160setFMode(1);
+	CO2=CDM7160getCO2();
+	CDM7160setMode(1);
+	_delay_ms(200);
+
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+	
+	if (wdcounter>2) {	
+		
+		CO2=CDM7160getCO2();
+
+		wdcounter=0;
+	}
+	
+
+		
+		
+
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+		
+				cli();pack.A=CO2;sei();
+				//wdcounter=10;
+				alarmflag=0;
+				
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+
+				cli();pack.B=0;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+		
+				cli();pack.C=0;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+			
+				cli();pack.D=0;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		/*uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}*/
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_CDM7160/DS2450_CDM7160.cproj b/DS2450_CDM7160/DS2450_CDM7160.cproj
new file mode 100644
index 0000000..bfa0cb9
--- /dev/null
+++ b/DS2450_CDM7160/DS2450_CDM7160.cproj
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_CDM7160</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000779</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000779</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -D__4MHZ__</avrgcc.compiler.miscellaneous.OtherFlags>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.AssemblerFlags>-D__4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\CDM7160.c">
+      <SubType>compile</SubType>
+      <Link>CDM7160.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="..\common\OWDS2450.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2450.S</Link>
+    </Compile>
+    <Compile Include="DS2450_CDM7160.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_CDM7160/OWDS2450.S b/DS2450_CDM7160/OWDS2450.S
new file mode 100644
index 0000000..1d81abd
--- /dev/null
+++ b/DS2450_CDM7160/OWDS2450.S
@@ -0,0 +1,247 @@
+
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.atsln b/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.atsln
new file mode 100644
index 0000000..8e5ac3e
--- /dev/null
+++ b/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_CDM7160_BMP280", "DS2450_CDM7160_BMP280.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.c b/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.c
new file mode 100644
index 0000000..204aa20
--- /dev/null
+++ b/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.c
@@ -0,0 +1,272 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/TWI_Master.h"
+#include "../common/I2C/CDM7160.h"
+#include "../common/I2C/BMP280.h"
+#include "../common/owSlave_tools.h"
+
+OWST_EXTERN_VARS
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={10,13,10,13, 2,16, 1,14,0x02,16,16,14,14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+OWST_WDT_ISR
+
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+
+
+ double temperatureC,humidityRH;
+ double l;
+uint32_t P;
+int32_t t;
+int16_t CO2;
+uint8_t max_adr=0;
+
+
+
+int main(void){
+	OWST_INIT_USI_ON
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+
+	OWINIT();
+
+	OWST_WDR_CONFIG8
+	OWST_EN_PULLUP
+	
+	gcontrol=1;
+	TWI_Master_Initialise();
+	CDM7160softReset();
+	_delay_ms(200);
+
+	CDM7160setMode(0); //Power Down Mode
+	_delay_ms(200);
+	CDM7160setAvCount(0x3F);
+	CDM7160setFMode(1);
+	CO2=CDM7160getCO2();
+	CDM7160setMode(1);
+	_delay_ms(200);
+	
+	bmp280Init();
+	
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+	
+	if (wdcounter>3) {	
+		
+		bmp280ConvertInt(&t,&P,1);
+		CO2=CDM7160getCO2();
+		wdcounter=0;
+	}
+	
+
+		
+		
+
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				/*if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.A=ADC;sei();*/
+				double cc=(double)CO2/(P/101300.0*298.0/(273.0+t/100.0));
+				cli();pack.A=cc;sei();
+				wdcounter=10;
+				alarmflag=0;
+				
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				/*if (pack.CSB2&0x01)	ADMUX=1; else ADMUX=0x81;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.B=ADC;sei();*/
+				wdcounter=10;
+				cli();pack.B=CO2;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				/*if (pack.CSC2&0x01)	ADMUX=2; else ADMUX=0x82;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.C=ADC;sei();*/
+				wdcounter=10;
+				uint16_t hd=P/100.0*32.0;
+				cli();pack.C=hd;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				/*if (pack.CSD2&0x01)	ADMUX=3; else ADMUX=0x83;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.D=ADC;sei();*/
+				wdcounter=10;
+				uint16_t ct=(t)+32767;
+				cli();pack.D=ct;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		/*uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}*/
+		
+		OWST_MAIN_END
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.cproj b/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.cproj
new file mode 100644
index 0000000..7bbbdcc
--- /dev/null
+++ b/DS2450_CDM7160_BMP280/DS2450_CDM7160_BMP280.cproj
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_CDM7160_BMP280</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000779</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000779</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\BMP280.c">
+      <SubType>compile</SubType>
+      <Link>BMP280.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\CDM7160.c">
+      <SubType>compile</SubType>
+      <Link>CDM7160.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_CDM7160_BMP280.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_DSM501A/DS2450_DSM501A.atsln b/DS2450_DSM501A/DS2450_DSM501A.atsln
new file mode 100644
index 0000000..b65d9ec
--- /dev/null
+++ b/DS2450_DSM501A/DS2450_DSM501A.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_DSM501A", "DS2450_DSM501A.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_DSM501A/DS2450_DSM501A.c b/DS2450_DSM501A/DS2450_DSM501A.c
new file mode 100644
index 0000000..710e9ae
--- /dev/null
+++ b/DS2450_DSM501A/DS2450_DSM501A.c
@@ -0,0 +1,312 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={0x9,13,0x06,0x09,0x06,0x013,0x06,0x013,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+volatile uint16_t ltime_list[32];
+volatile uint16_t pcount_list[32];
+volatile uint8_t wsp=0;
+volatile uint16_t max_count;
+volatile uint16_t max_ptime=0;
+volatile uint16_t min_ptime=0;
+
+uint16_t ds;
+
+
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+volatile uint16_t count;
+volatile uint16_t ltime;
+volatile uint16_t startt;
+
+#define SEC_TIME 31250+300
+
+ISR(TIM1_OVF_vect){
+	TCNT1=~(SEC_TIME);
+	ltime_list[wsp]=ltime;
+	pcount_list[wsp]=count;
+	wsp++;
+	if (wsp>=32) wsp=0;
+	//if (count>max) max=count;
+	//if (mess) 
+	//count=(SEC_TIME)
+	startt=~(SEC_TIME);
+	count=0;
+	ltime=0;
+	
+}
+#define PIN_WIND (1<<PINA2)
+#define PIN_REG PINA
+volatile uint8_t istat;
+volatile uint8_t mess=0;
+
+
+ISR(PCINT0_vect) {
+	if (((PIN_REG&PIN_WIND)==0)&&((istat&PIN_WIND)==PIN_WIND)) {	
+	 startt=TCNT1;
+	 mess=1;
+	PORTB&=~(1<<PINB1);
+	}
+	if (((PIN_REG&PIN_WIND)==PIN_WIND)&&((istat&PIN_WIND)==0)) {
+		uint16_t duration=(+TCNT1-startt);
+		ltime+=duration;
+		count++;
+		if (min_ptime==0) min_ptime=duration;
+		if (duration>max_ptime)max_ptime=duration;
+		if (duration<min_ptime)min_ptime=duration;
+		
+		mess=0;
+	}
+
+	istat=PIN_REG;
+	
+}
+
+
+int main(void){
+	for(uint8_t i=0;i<16;i++) {ltime_list[i]=0;pcount_list[i]=0;}
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+	PORTA&=~((1<<PINA0)|(1<<PINA1)|(1<<PINA2)|(1<<PINA3));
+	ADCSRA=(1<<ADEN)|(1<ADPS0)|(1<<ADPS2);
+
+	
+	
+	gcontrol=1;
+	ADCSRB|=(1<<ADLAR); 
+	sei();
+	
+	DDRB|=(1<<PINB1);
+	TCCR1B|=(1<<CS12); //8000000/256 =31250
+	TIMSK1|=(1<<TOIE1); 
+	istat=PIN_REG;
+	GIMSK|=(1<<PCIE0);
+	PCMSK0=(PIN_WIND);
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	PORTA|=0xFF; 
+    while(1)   {
+		//PORTB&=~(1<<PINB1);
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				//if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				//_delay_us(100);
+				//ADCSRA|=(1<<ADSC);
+				//while ((ADCSRA&(1<<ADSC)));
+				//cli();pack.A=ADC;sei();
+				ds=0;
+				for(uint8_t i=0;i<32;i++) {
+					ds+=pcount_list[i];
+					//if (wspeed[i]>ds) ds=wspeed[i];
+				}
+				cli();pack.A=ds;sei();
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				double fds=0;
+				for(uint8_t i=0;i<32;i++) {
+					fds+=ltime_list[i];
+					//if (wspeed[i]>ds) ds=wspeed[i];
+				}
+				double lr=(fds/32.0)/(SEC_TIME)*65535/5.1;
+				cli();pack.B=lr;sei();
+				//max=0;
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				double mu_sek=(double)max_ptime/(SEC_TIME)*1e6;
+				max_ptime=0;
+				cli();pack.C=mu_sek;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				double mu_sek=(double)min_ptime/(SEC_TIME)*1e6;
+				min_ptime=0;
+				cli();pack.D=mu_sek;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//
+		}
+
+		uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}
+		if ((PORTB&(1<<PINB1))==0) {
+			_delay_ms(100);
+			PORTB|=(1<<PINB1);
+		 }
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+	//	asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_DSM501A/DS2450_DSM501A.cproj b/DS2450_DSM501A/DS2450_DSM501A.cproj
new file mode 100644
index 0000000..bc44dfa
--- /dev/null
+++ b/DS2450_DSM501A/DS2450_DSM501A.cproj
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_DSM501A</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\OWDS2450.S">
+      <SubType>compile</SubType>
+      <Link>OWDS2450.S</Link>
+    </Compile>
+    <Compile Include="DS2450_DSM501A.c">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_IAQCORE/DS2450_IAQCORE.atsln b/DS2450_IAQCORE/DS2450_IAQCORE.atsln
index cd34225..37cfa07 100644
--- a/DS2450_IAQCORE/DS2450_IAQCORE.atsln
+++ b/DS2450_IAQCORE/DS2450_IAQCORE.atsln
@@ -1,22 +1,22 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_IAQCORE", "DS2450_IAQCORE.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|AVR = Debug|AVR
-		Release|AVR = Release|AVR
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_IAQCORE", "DS2450_IAQCORE.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_IAQCORE/DS2450_IAQCORE.c b/DS2450_IAQCORE/DS2450_IAQCORE.c
index 750cb9b..006c9b8 100644
--- a/DS2450_IAQCORE/DS2450_IAQCORE.c
+++ b/DS2450_IAQCORE/DS2450_IAQCORE.c
@@ -45,7 +45,7 @@ extern void OWINIT();
 extern void EXTERN_SLEEP();
 
 uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
-uint8_t config_info[26]={0x06,13,0x06,13,0x06,13,0x06,13,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info[26]={10,13,8,13,11,13,5,13,0x02,27,27,27,27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 
 #if (owid>128) 
 #error "Variable not correct"
diff --git a/DS2450_IAQCORE/DS2450_IAQCORE.cproj b/DS2450_IAQCORE/DS2450_IAQCORE.cproj
index 5bb475f..e17cbba 100644
--- a/DS2450_IAQCORE/DS2450_IAQCORE.cproj
+++ b/DS2450_IAQCORE/DS2450_IAQCORE.cproj
@@ -1,139 +1,139 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATtiny84A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>DS2450</AssemblyName>
-    <Name>DS2450_IAQCORE</Name>
-    <RootNamespace>DS2450</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>1</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data>
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <avrtool />
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>NDEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-      </AvrGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <AvrGcc>
-        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
-        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
-        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
-        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
-        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
-        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
-        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
-        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
-        <avrgcc.compiler.symbols.DefSymbols>
-          <ListValues>
-            <Value>DEBUG</Value>
-          </ListValues>
-        </avrgcc.compiler.symbols.DefSymbols>
-        <avrgcc.compiler.directories.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.compiler.directories.IncludePaths>
-        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
-        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
-        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
-        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
-        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
-        <avrgcc.linker.libraries.Libraries>
-          <ListValues>
-            <Value>libm</Value>
-          </ListValues>
-        </avrgcc.linker.libraries.Libraries>
-        <avrgcc.assembler.general.IncludePaths>
-          <ListValues>
-            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
-          </ListValues>
-        </avrgcc.assembler.general.IncludePaths>
-        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
-      </AvrGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="..\common\I2C\IAQCORE.c">
-      <SubType>compile</SubType>
-      <Link>IAQCORE.c</Link>
-    </Compile>
-    <Compile Include="..\common\I2C\USI_TWI_Master.c">
-      <SubType>compile</SubType>
-      <Link>USI_TWI_Master.c</Link>
-    </Compile>
-    <Compile Include="DS2450_IAQCORE.c">
-      <SubType>compile</SubType>
-    </Compile>
-    <Compile Include="OWDS2450.S">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_IAQCORE</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\IAQCORE.c">
+      <SubType>compile</SubType>
+      <Link>IAQCORE.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_IAQCORE.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
 </Project>
\ No newline at end of file
diff --git a/DS2450_LPS225HB/DS2450_LPS225HB.atsln b/DS2450_LPS225HB/DS2450_LPS225HB.atsln
new file mode 100644
index 0000000..73505ee
--- /dev/null
+++ b/DS2450_LPS225HB/DS2450_LPS225HB.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_LPS225HB", "DS2450_LPS225HB.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_LPS225HB/DS2450_LPS225HB.c b/DS2450_LPS225HB/DS2450_LPS225HB.c
new file mode 100644
index 0000000..75dbbad
--- /dev/null
+++ b/DS2450_LPS225HB/DS2450_LPS225HB.c
@@ -0,0 +1,292 @@
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/LPS225HB.h"
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={0x02,16,0x01,14, 0,0, 0x0,0,0x02,14,14,0x00,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=10;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+volatile double temperatureC,humidityRH;
+uint32_t P;
+int16_t t;
+
+
+
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+    PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+	DDRB|=(1<<PORTB0); //Als Ausgang und 0
+	PORTA=0xFF;  //All Pull up;
+	 PRR|=(1<<PRADC);  // adc for save Power
+
+	ACSR|=(1<<ACD);  //Disable Comparator
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	
+	gcontrol=1;
+	
+	USI_TWI_Master_Initialise();
+	LPS225HB_Init() ;
+	
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+	
+	if (wdcounter>3) {	
+		LPS225HB_Readi(&t,&P);
+		
+	
+		wdcounter=0;
+	}
+	
+
+		
+		
+
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				/*if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.A=ADC;sei();*/
+				cli();pack.A=P/128;sei();
+				wdcounter=10;
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				/*if (pack.CSB2&0x01)	ADMUX=1; else ADMUX=0x81;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.B=ADC;sei();*/
+				wdcounter=10;
+				uint16_t ct=(t)+32767;
+				cli();pack.B=ct;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				/*if (pack.CSC2&0x01)	ADMUX=2; else ADMUX=0x82;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.C=ADC;sei();*/
+				wdcounter=10;
+				cli();pack.C=0;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				/*if (pack.CSD2&0x01)	ADMUX=3; else ADMUX=0x83;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.D=ADC;sei();*/
+				wdcounter=10;
+				cli();pack.D=0;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		/*uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}*/
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+	//	asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_LPS225HB/DS2450_LPS225HB.cproj b/DS2450_LPS225HB/DS2450_LPS225HB.cproj
new file mode 100644
index 0000000..f11555c
--- /dev/null
+++ b/DS2450_LPS225HB/DS2450_LPS225HB.cproj
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_LPS225HB</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000779</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000779</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\LPS225HB.c">
+      <SubType>compile</SubType>
+      <Link>LPS225HB.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_LPS225HB.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_LPS225HB/OWDS2450.S b/DS2450_LPS225HB/OWDS2450.S
new file mode 100644
index 0000000..1d81abd
--- /dev/null
+++ b/DS2450_LPS225HB/OWDS2450.S
@@ -0,0 +1,247 @@
+
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_MAX44008/DS2450_MAX44008.atsln b/DS2450_MAX44008/DS2450_MAX44008.atsln
new file mode 100644
index 0000000..71471d5
--- /dev/null
+++ b/DS2450_MAX44008/DS2450_MAX44008.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_MAX44008", "DS2450_MAX44008.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_MAX44008/DS2450_MAX44008.c b/DS2450_MAX44008/DS2450_MAX44008.c
new file mode 100644
index 0000000..2741d88
--- /dev/null
+++ b/DS2450_MAX44008/DS2450_MAX44008.c
@@ -0,0 +1,270 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={0x06,0x09,0x06,0x09,0x06,0x09,0x06,0x09,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+	uint8_t checkMAX44008(uint8_t nr) {
+		volatile uint8_t b1;
+		nr=(nr<<1)&0x02f;
+		
+		I2c_StartCondition();
+		I2c_WriteByte(0b10000000|nr);
+		I2c_WriteByte(0x00);
+		I2c_StartCondition();
+		I2c_WriteByte (0b10000001|nr);
+		b1 =I2c_ReadByte(NO_ACK);
+		I2c_StopCondition();
+		return b1!=0xFF;
+		
+	}
+
+
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+
+	PORTA=0xFF;
+	PORTB=0xFF;
+
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+	//PORTA&=~((1<<PINA0)|(1<<PINA1)|(1<<PINA2)|(1<<PINA3));
+
+	ADCSRA=(1<<ADEN)|(1<ADPS0)|(1<<ADPS2);
+
+	
+	
+	gcontrol=1;
+	ADCSRB|=(1<<ADLAR); 
+	USI_TWI_Master_Initialise();
+	
+
+
+
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.A=ADC;sei();
+				pack.A= checkMAX44008(0);
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				if (pack.CSB2&0x01)	ADMUX=1; else ADMUX=0x81;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.B=ADC;sei();
+				pack.B= checkMAX44008(1);
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				if (pack.CSC2&0x01)	ADMUX=2; else ADMUX=0x82;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.C=ADC;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				if (pack.CSD2&0x01)	ADMUX=3; else ADMUX=0x83;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.D=ADC;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+	//	asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_MAX44008/DS2450_MAX44008.cproj b/DS2450_MAX44008/DS2450_MAX44008.cproj
new file mode 100644
index 0000000..7dff5bc
--- /dev/null
+++ b/DS2450_MAX44008/DS2450_MAX44008.cproj
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_MAX44008</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_MAX44008.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_MAX44008/OWDS2450.S b/DS2450_MAX44008/OWDS2450.S
new file mode 100644
index 0000000..61a1dad
--- /dev/null
+++ b/DS2450_MAX44008/OWDS2450.S
@@ -0,0 +1,248 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+#define  __4MHZ__
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_SGP30/DS2450_SGP30.atsln b/DS2450_SGP30/DS2450_SGP30.atsln
new file mode 100644
index 0000000..5f82c4f
--- /dev/null
+++ b/DS2450_SGP30/DS2450_SGP30.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_SGP30", "DS2450_SGP30.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_SGP30/DS2450_SGP30.c b/DS2450_SGP30/DS2450_SGP30.c
new file mode 100644
index 0000000..f0b881c
--- /dev/null
+++ b/DS2450_SGP30/DS2450_SGP30.c
@@ -0,0 +1,265 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/SGP30.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x23, 0x20};/**/
+//uint8_t config_info[26]={0x03,13,0x03,13,0x03,13,0x3,15,0x02,20,20,20,20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+uint8_t config_info[26]={10,13,8,13,8,13,8,13,0x02,25,25,25,25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=10;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+	#else
+	ISR(WDT_vect) {
+		#endif
+		wdcounter++;
+		if (reset_indicator==1) reset_indicator++;
+		else if (reset_indicator==2) mode=0;
+	}
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+uint16_t CO2;
+uint16_t VOC;
+uint16_t ETH;
+uint16_t H2;
+
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+
+	PORTA=0xFF;
+	PORTB=0xFF;
+
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+	//PORTA&=~((1<<PINA0)|(1<<PINA1)|(1<<PINA2)|(1<<PINA3));
+
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP2) | (1<<WDP1);   // Set Timeout to ~1 seconds
+
+	wdcounter=4;
+	
+	gcontrol=1;
+	USI_TWI_Master_Initialise();
+	initSGP30();
+	_delay_ms(200);
+	runSGP30(&CO2,&VOC,&ETH,&H2);
+	
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+		if (wdcounter>1) {
+			runSGP30(&CO2,&VOC,&ETH,&H2);
+			wdcounter=0;
+		}
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				
+				//cli();pack.A=rlight[0];sei();
+				//cli();pack.A=r_gain;sei();
+				cli();pack.A=CO2;sei();
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				//cli();pack.B=rlight[1];sei();
+				//cli();pack.B=atime;sei();
+				cli();pack.B=VOC;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				//cli();pack.C=rlight[2];sei();
+				cli();pack.C=ETH;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				//cli();pack.D=rlight[3];sei();
+				cli();pack.D=H2;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+	//	asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_SGP30/DS2450_SGP30.cproj b/DS2450_SGP30/DS2450_SGP30.cproj
new file mode 100644
index 0000000..b11d7bb
--- /dev/null
+++ b/DS2450_SGP30/DS2450_SGP30.cproj
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_SGP30</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+            <Value>__4MHZ__</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.AssemblerFlags>-D  __4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+            <Value>__4MHZ__</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.AssemblerFlags>-D __4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\I2C\SGP30.c">
+      <SubType>compile</SubType>
+      <Link>SGP30.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_SGP30.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_SGP30/OWDS2450.S b/DS2450_SGP30/OWDS2450.S
new file mode 100644
index 0000000..0b56d13
--- /dev/null
+++ b/DS2450_SGP30/OWDS2450.S
@@ -0,0 +1,250 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+//#define  __4MHZ__
+
+
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.atsln b/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.atsln
index c9b2ef7..526fac6 100644
--- a/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.atsln
+++ b/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.atsln
@@ -1,22 +1,22 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_SHT2X_BMP280", "DS2450_SHT2X_BMP280.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|AVR = Debug|AVR
-		Release|AVR = Release|AVR
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_SHT2X_BMP280", "DS2450_SHT2X_BMP280.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c b/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c
index 683b765..2d10504 100644
--- a/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c
+++ b/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c
@@ -39,11 +39,13 @@
 #include <avr/sleep.h>
 #include <avr/pgmspace.h>
 #include "../common/I2C/USI_TWI_Master.h"
-#include "../common/I2C/SHT2x.h"
+#include "../common/I2C/SHT2xV2.h"
 #include "../common/I2C/BMP280.h"
 #include "../common/I2C/MAX44009.h"
-extern void OWINIT();
-extern void EXTERN_SLEEP();
+#include "../common/owSlave_tools.h"
+#include "../common/calibr.h"
+
+OWST_EXTERN_VARS
 
 uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
 uint8_t config_info[26]={0x01,14,0x04,0x08, 0x03,15, 0x02,16,0x02,7,7,15,14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
@@ -52,22 +54,8 @@ uint8_t config_info[26]={0x01,14,0x04,0x08, 0x03,15, 0x02,16,0x02,7,7,15,14,0x00
 #error "Variable not correct"
 #endif
 
-extern uint8_t mode;
-extern uint8_t gcontrol;
-extern uint8_t reset_indicator;
-extern uint8_t alarmflag;
-volatile uint8_t wdcounter=10;
-
+OWST_WDT_ISR
 
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-ISR(WATCHDOG_vect) {
-#else
-ISR(WDT_vect) {
-#endif 
-	wdcounter++;
-	if (reset_indicator==1) reset_indicator++;
-	else if (reset_indicator==2) mode=0;
-}
 
 typedef union {
 	volatile uint8_t bytes[0x20];
@@ -114,14 +102,10 @@ volatile pack_t pack;
 
 
 
-volatile int16_t am2302_temp;
-volatile uint16_t am2302_hum;
 
 
-uint8_t userRegister[1];
-int16_t sRH,sT;
-volatile double temperatureC,humidityRH;
-volatile double l;
+ double temperatureC,humidityRH;
+ double l;
 uint32_t P;
 int32_t t;
 uint8_t max_adr=0;
@@ -129,6 +113,7 @@ uint8_t max_adr=0;
 
 
 int main(void){
+	OWST_INIT_USI_ON
 	pack.A=0;
 	pack.B=0;
 	pack.C=0;
@@ -150,35 +135,17 @@ int main(void){
 	pack.HD=0xFF;
 	pack.LD=0x00;
 	pack.VCCP=0;
-    PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
-	DDRB|=(1<<PORTB0); //Als Ausgang und 0
-	PORTA=0xFF;  //All Pull up;
-	 PRR|=(1<<PRADC);  // adc for save Power
 
-	ACSR|=(1<<ACD);  //Disable Comparator
 	OWINIT();
 
-	MCUCR &=~(1<<PUD); //All Pins Pullup...
-	MCUCR |=(1<<BODS);
-	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
-	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
-	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	OWST_WDR_CONFIG8
+	OWST_EN_PULLUP
 	
 	gcontrol=1;
 	
-	USI_TWI_Master_Initialise();
+	initSHT2x();
+	_delay_ms(10);
 	bmp280Init();
-	SHT2x_SoftReset();
-	SHT2x_ReadUserRegister(userRegister);
-	//(userRegister & ~SHT2x_RES_MASK) | SHT2x_RES_10_13BIT;
-	SHT2x_WriteUserRegister(userRegister); //write changed user reg
-	// --- measure humidity with "Hold Master Mode (HM)" ---
-	//SHT2x_MeasurePoll(HUMIDITY, &sRH);
-	// --- measure temperature with "Polling Mode" (no hold master) ---
-	//SHT2x_MeasurePoll(TEMP, &sT);
-	//-- calculate humidity and temperature --
-	//temperatureC = SHT2x_CalcTemperatureC(sT);
-	//humidityRH = SHT2x_CalcRH(sRH);
 	if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
 	
 	sei();
@@ -188,12 +155,9 @@ int main(void){
     while(1)   {
 	
 	if (wdcounter>3) {	
-		SHT2x_MeasurePoll(HUMIDITY, &sRH);
-		// --- measure temperature with "Polling Mode" (no hold master) ---
-		SHT2x_MeasurePoll(TEMP, &sT);
-		//-- calculate humidity and temperature --
-		temperatureC = SHT2x_CalcTemperatureC(sT);
-		humidityRH = SHT2x_CalcRH(sRH);
+		getSHT2xHumTemp(&temperatureC,&humidityRH);
+		humidityRH=calibr_hum(temperatureC,-0.2,humidityRH);
+		temperatureC =temperatureC -0.2;
 		bmp280ConvertInt(&t,&P,1);
 		l=MAX44009getlux(max_adr);
 		if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
@@ -245,7 +209,8 @@ int main(void){
 				while ((ADCSRA&(1<<ADSC)));
 				cli();pack.B=ADC;sei();*/
 				wdcounter=10;
-				cli();pack.B=humidityRH*100;sei();
+				uint16_t hb=humidityRH*100;
+				cli();pack.B=hb;sei();
 				if (pack.CSB2&0x08)  //AEH
 					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
 				if (pack.CSB2&0x04)  //AEL
@@ -272,7 +237,8 @@ int main(void){
 				while ((ADCSRA&(1<<ADSC)));
 				cli();pack.D=ADC;sei();*/
 				wdcounter=10;
-				cli();pack.D=P/100.0*32.0;sei();
+				uint16_t hd=P/100.0*32.0;
+				cli();pack.D=hd;sei();
 				if (pack.CSD2&0x08)  //AEH
 					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
 				if (pack.CSD2&0x04)  //AEL
@@ -297,21 +263,7 @@ int main(void){
 			bb=bb*2;
 		}*/
 		
-#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
-			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
-#endif			
-#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
-			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
-#endif
-			  {
-
-			MCUCR|=(1<<SE)|(1<<SM1);
-			MCUCR&=~(1<<ISC01);
-		} else {
-			MCUCR|=(1<<SE);
-			MCUCR&=~(1<<SM1);
-		}
-	//	asm("SLEEP");
+		OWST_MAIN_END
    }
 
 
diff --git a/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.cproj b/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.cproj
index 2b6a417..6de6c7f 100644
--- a/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.cproj
+++ b/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.cproj
@@ -28,14 +28,14 @@
     <eraseonlaunchrule>1</eraseonlaunchrule>
     <ExternalProgrammingToolCommand />
     <AsfFrameworkConfig>
-      <framework-data xmlns="">
+      <framework-data>
         <options />
         <configurations />
         <files />
         <documentation help="" />
         <offline-documentation help="" />
         <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
         </dependencies>
       </framework-data>
     </AsfFrameworkConfig>
@@ -123,6 +123,10 @@
     </ToolchainSettings>
   </PropertyGroup>
   <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
     <Compile Include="..\common\I2C\BMP280.c">
       <SubType>compile</SubType>
       <Link>BMP280.c</Link>
@@ -131,13 +135,9 @@
       <SubType>compile</SubType>
       <Link>MAX44009.c</Link>
     </Compile>
-    <Compile Include="..\common\I2C\SHT2x.c">
-      <SubType>compile</SubType>
-      <Link>SHT2x.c</Link>
-    </Compile>
-    <Compile Include="..\common\I2C\TSL256x.c">
+    <Compile Include="..\common\I2C\SHT2xV2.c">
       <SubType>compile</SubType>
-      <Link>TSL256x.c</Link>
+      <Link>SHT2xV2.c</Link>
     </Compile>
     <Compile Include="..\common\I2C\USI_TWI_Master.c">
       <SubType>compile</SubType>
diff --git a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.atsln b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.atsln
index 542967c..5739ec3 100644
--- a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.atsln
+++ b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.atsln
@@ -1,22 +1,22 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_SHT2X_MAX44009", "DS2450_SHT2X_MAX44009.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|AVR = Debug|AVR
-		Release|AVR = Release|AVR
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_SHT2X_MAX44009", "DS2450_SHT2X_MAX44009.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c
index 8f5d4f9..b5ed22b 100644
--- a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c
+++ b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c
@@ -38,7 +38,7 @@
 #include <avr/wdt.h>
 #include <avr/sleep.h>
 #include <avr/pgmspace.h>
-#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/TWI_Master.h"
 #include "../common/I2C/SHT2x.h"
 #include "../common/I2C/MAX44009.h"
 extern void OWINIT();
@@ -165,7 +165,7 @@ int main(void){
 	
 	gcontrol=1;
 	
-	USI_TWI_Master_Initialise();
+	TWI_Master_Initialise();
 	SHT2x_SoftReset();
 	SHT2x_ReadUserRegister(userRegister);
 	//(userRegister & ~SHT2x_RES_MASK) | SHT2x_RES_10_13BIT;
@@ -309,7 +309,7 @@ int main(void){
 			MCUCR|=(1<<SE);
 			MCUCR&=~(1<<SM1);
 		}
-	//	asm("SLEEP");
+		asm("SLEEP");
    }
 
 
diff --git a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj
index 56aab1a..2ec9b25 100644
--- a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj
+++ b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj
@@ -28,16 +28,16 @@
     <eraseonlaunchrule>1</eraseonlaunchrule>
     <ExternalProgrammingToolCommand />
     <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
+      <framework-data>
+  <options />
+  <configurations />
+  <files />
+  <documentation help="" />
+  <offline-documentation help="" />
+  <dependencies>
+    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+  </dependencies>
+</framework-data>
     </AsfFrameworkConfig>
     <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
     <avrtoolserialnumber>J41800000779</avrtoolserialnumber>
@@ -135,9 +135,9 @@
       <SubType>compile</SubType>
       <Link>TSL256x.c</Link>
     </Compile>
-    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+    <Compile Include="..\common\I2C\TWI_Master.c">
       <SubType>compile</SubType>
-      <Link>USI_TWI_Master.c</Link>
+      <Link>TWI_Master.c</Link>
     </Compile>
     <Compile Include="DS2450_SHT2X_MAX44009.c">
       <SubType>compile</SubType>
diff --git a/DS2450_SHT3X/DS2450_SHT3X.atsln b/DS2450_SHT3X/DS2450_SHT3X.atsln
new file mode 100644
index 0000000..c8f5c00
--- /dev/null
+++ b/DS2450_SHT3X/DS2450_SHT3X.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_SHT3X", "DS2450_SHT3X.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_SHT3X/DS2450_SHT3X.c b/DS2450_SHT3X/DS2450_SHT3X.c
new file mode 100644
index 0000000..26d723b
--- /dev/null
+++ b/DS2450_SHT3X/DS2450_SHT3X.c
@@ -0,0 +1,298 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/SHT3x.h"
+#include "../common/calibr.h"
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+//6A02160084D9A320
+//uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t owid[8]={0x20, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x6A};/**/
+uint8_t config_info[26]={0x01,14,0x04,0x08, 0,0, 0,0,0x02,21,21,0x00,0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=10;
+
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif 
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+ double temperatureC,humidityRH;
+uint32_t P;
+int32_t t;
+
+
+
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+    PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+	DDRB|=(1<<PORTB0); //Als Ausgang und 0
+	PORTA=0xFF;  //All Pull up;
+	 PRR|=(1<<PRADC);  // adc for save Power
+
+	ACSR|=(1<<ACD);  //Disable Comparator
+	OWINIT();
+
+	MCUCR &=~(1<<PUD); //All Pins Pullup...
+	MCUCR |=(1<<BODS);
+	WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+	WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+	(1<<WDP3) | (1<<WDP0);   // Set Timeout to ~8 seconds
+	
+	gcontrol=1;
+	
+	USI_TWI_Master_Initialise();
+
+	initSHT3x(0);
+	_delay_ms(100);
+	getSHT3xHumTemp(0,&temperatureC,&humidityRH);
+
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+	
+	if (wdcounter>3) {	
+		
+		getSHT3xHumTemp(0,&temperatureC,&humidityRH);
+
+		wdcounter=0;
+	}
+	
+
+		
+		
+
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				/*if (pack.CSA2&0x01)	ADMUX=0; else ADMUX=0x80;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.A=ADC;sei();*/
+				uint16_t ct=(temperatureC*100.0)+32767;
+				cli();pack.A=ct;sei();
+				wdcounter=10;
+				alarmflag=0;
+				
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				/*if (pack.CSB2&0x01)	ADMUX=1; else ADMUX=0x81;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.B=ADC;sei();*/
+				wdcounter=10;
+				cli();pack.B=humidityRH*100;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				/*if (pack.CSC2&0x01)	ADMUX=2; else ADMUX=0x82;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.C=ADC;sei();*/
+				wdcounter=10;
+				cli();pack.C=0;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				/*if (pack.CSD2&0x01)	ADMUX=3; else ADMUX=0x83;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.D=ADC;sei();*/
+				wdcounter=10;
+				cli();pack.D=P/100.0*32.0;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		/*uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}*/
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+		asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_SHT3X/DS2450_SHT3X.cproj b/DS2450_SHT3X/DS2450_SHT3X.cproj
new file mode 100644
index 0000000..2441aed
--- /dev/null
+++ b/DS2450_SHT3X/DS2450_SHT3X.cproj
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_SHT3X</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000779</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+        </InterfaceProperties>
+        <InterfaceName>debugWIRE</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000779</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+  <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+  <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+  <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+  <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+  <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+  <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+  <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+  <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+  <avrgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </avrgcc.compiler.symbols.DefSymbols>
+  <avrgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+    </ListValues>
+  </avrgcc.compiler.directories.IncludePaths>
+  <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+  <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+  <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+  <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+  <avrgcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -D__4MHZ__</avrgcc.compiler.miscellaneous.OtherFlags>
+  <avrgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </avrgcc.linker.libraries.Libraries>
+  <avrgcc.assembler.general.AssemblerFlags>-D__4MHZ__</avrgcc.assembler.general.AssemblerFlags>
+</AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.68\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT3x.c">
+      <SubType>compile</SubType>
+      <Link>SHT3x.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_SHT3X.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_SHT3X/OWDS2450.S b/DS2450_SHT3X/OWDS2450.S
new file mode 100644
index 0000000..1d81abd
--- /dev/null
+++ b/DS2450_SHT3X/OWDS2450.S
@@ -0,0 +1,247 @@
+
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/DS2450_VOC_SHT/DS2450_VOC_SHT.atsln b/DS2450_VOC_SHT/DS2450_VOC_SHT.atsln
new file mode 100644
index 0000000..97e522a
--- /dev/null
+++ b/DS2450_VOC_SHT/DS2450_VOC_SHT.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450_VOC_SHT", "DS2450_VOC_SHT.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/DS2450_VOC_SHT/DS2450_VOC_SHT.c b/DS2450_VOC_SHT/DS2450_VOC_SHT.c
new file mode 100644
index 0000000..80c06a1
--- /dev/null
+++ b/DS2450_VOC_SHT/DS2450_VOC_SHT.c
@@ -0,0 +1,519 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//!!!!!Max Program size 7551 Byte
+
+
+
+
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include <avr/pgmspace.h>
+#include "../common/I2C/USI_TWI_Master.h"
+#include "../common/I2C/MAX1164x.h"
+#include "../common/I2C/SHT2xV2.h"
+#include "../common/calibr.h"
+
+extern void OWINIT();
+extern void EXTERN_SLEEP();
+
+uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
+uint8_t config_info[26]={0x01,14,0x04,0x08, 8,8,11,0x08,0x02,7,7,17,17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+
+#if (owid>128) 
+#error "Variable not correct"
+#endif
+
+extern uint8_t mode;
+extern uint8_t gcontrol;
+extern uint8_t reset_indicator;
+extern uint8_t alarmflag;
+volatile uint8_t wdcounter=1;
+
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+ISR(WATCHDOG_vect) {
+#else
+ISR(WDT_vect) {
+#endif
+	wdcounter++;
+	if (reset_indicator==1) reset_indicator++;
+	else if (reset_indicator==2) mode=0;
+}
+
+
+typedef union {
+	volatile uint8_t bytes[0x20];
+	struct {
+		//Page0
+		uint16_t A;  //0
+		uint16_t B;  //2
+		uint16_t C;  //4
+		uint16_t D;  //6
+		//Page1
+		uint8_t CSA1;
+		uint8_t CSA2;
+		uint8_t CSB1;
+		uint8_t CSB2;
+		uint8_t CSC1;
+		uint8_t CSC2;
+		uint8_t CSD1;
+		uint8_t CSD2;
+		//Page2
+		uint8_t LA;
+		uint8_t HA;
+		uint8_t LB;
+		uint8_t HB;
+		uint8_t LC;
+		uint8_t HC;
+		uint8_t LD;
+		uint8_t HD;
+		//Page3
+		uint8_t FC1;
+		uint8_t FC2;
+		uint8_t FC3;
+		uint8_t FC4;
+		uint8_t VCCP;
+		uint8_t FC5;
+		uint8_t FC6;
+		uint8_t FC7;
+		uint8_t convc1;
+		uint8_t convc2;
+		
+		
+	};
+} pack_t;
+volatile pack_t pack;
+
+
+
+
+
+volatile int16_t am2302_temp;
+volatile uint16_t am2302_hum;
+
+
+uint8_t userRegister[1];
+int16_t sRH,sT;
+double temperatureC,humidityRH,hhum;
+double l;
+double RH;
+double TC;
+
+
+uint8_t max_adr=0;
+#define CH0_M MAX1164x_C_SCAN0|MAX1164x_C_SGL
+#define CH1_M MAX1164x_C_SCAN0|MAX1164x_C_SGL|MAX1164x_C_CS0
+#define CH0_CH1 MAX1164x_C_SCAN0
+//|MAX1164x_C_CS0
+
+uint16_t weekmaxarr[8];
+
+//Kompensieren der Abhänigkeit von RS/RO von Temperatur und Luftfeuchte
+inline double interp(double t, double h) {
+	double h2;
+	double t2;
+	h2=h*h;
+	t2=t*t;
+	return 4.76111e-9*h2*t2-3.96956e-7*h2*t+0.0000408889*h2-1.07132e-6*h*t2+0.000115968*h*t-0.0101333*h+0.000163806*t2-0.0241179*t+1.80591;
+}
+
+double R0;
+uint16_t mr;
+uint8_t startup=10;
+double ip;
+
+
+int testSW(void) {
+	uint8_t r;
+	DDRB&=~(1<<PORTB0);  //Eingang
+	__asm__ __volatile__ ("nop");
+	PORTB|=(1<<PORTB0); //Pullup
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	__asm__ __volatile__ ("nop");
+	r=PINB&(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	PORTB&=~(1<<PORTB0);
+	__asm__ __volatile__ ("nop");
+	DDRB|=(1<<PORTB0);  //Eingang
+	return (r==0);  //Offen mal HIH4030
+	
+	
+}
+
+#define EEPROM_R0 0
+#define EEPROM_R0d 2
+#define EEPROM_R0w 4
+#define EEPROM_dol 6
+
+
+uint16_t readEEPROM(uint8_t addr,uint16_t def) {
+	uint16_t hr;
+	while(EECR & (1<<EEPE));
+	EEARL=addr+1;
+	EECR |= (1<<EERE);
+	hr=EEDR;
+	if (hr!=0xFF) {
+		hr=hr<<8;
+		while(EECR & (1<<EEPE));
+		EEARL=addr;
+		EECR |= (1<<EERE);
+		hr|=EEDR;
+		return hr;
+	}
+	return def;
+}
+
+void writeEEPROM(uint8_t addr,uint16_t val) {
+	while(EECR & (1<<EEPE));
+	EECR = (0<<EEPM1)|(0<<EEPM0);
+	EEARL = addr;
+	EEDR = val&0xFF;
+	EECR |= (1<<EEMPE);
+	EECR |= (1<<EEPE);
+	while(EECR & (1<<EEPE));
+	EECR = (0<<EEPM1)|(0<<EEPM0);
+	EEARL = addr+1;
+	EEDR = val>>8;
+	EECR |= (1<<EEMPE);
+	EECR |= (1<<EEPE);
+}
+
+uint16_t pR0;
+uint16_t pVS;
+uint8_t pcmode;
+int16_t pip;
+uint16_t ptol_s8;
+uint16_t ptol_d;
+uint16_t pr_day_max;
+uint16_t pr_week_max;
+uint16_t RA;
+
+int main(void){
+	pack.A=0;
+	pack.B=0;
+	pack.C=0;
+	pack.D=0;
+	pack.CSA1=0x08;
+	pack.CSA2=0x8C;
+	pack.CSB1=0x08;
+	pack.CSB2=0x8C;
+	pack.CSC1=0x08;
+	pack.CSC2=0x8C;
+	pack.CSD1=0x08;
+	pack.CSD2=0x8C;
+	pack.HA=0xFF;
+	pack.LA=0x00;
+	pack.HB=0xFF;
+	pack.LB=0x00;
+	pack.HC=0xFF;
+	pack.LC=0x00;
+	pack.HD=0xFF;
+	pack.LD=0x00;
+	pack.VCCP=0;
+
+    PRR|=(1<<PRADC);  // adc for save Power
+    PORTA=0xFF;
+    PORTB=0xFF-(1<<PORTB0); //Schalter kann gegen Masse sein und zieht dann immer Strom
+    DDRB|=(1<<PORTB0); //Als Ausgang und 0
+    OWINIT();
+    DDRB|=(1<<PINB1);//Ausgang und 1
+    DDRA|=(1<<PINA0);
+    
+    WDTCSR |= ((1<<WDCE) );   // Enable the WD Change Bit//| (1<<WDE)
+    WDTCSR |=   (1<<WDIE) |              // Enable WDT Interrupt
+    //(1<<WDP0) |(1<<WDP2) | (1<<WDP1);    // Set Timeout to ~2 seconds
+    (1<<WDP3) | (1<<WDP0);    // Set Timeout to ~8 seconds
+
+    MCUSR=0;
+	if (testSW()) {
+			writeEEPROM(EEPROM_R0,0xFF);
+			writeEEPROM(EEPROM_R0d,0xFF);  //Maximum des Tages
+			writeEEPROM(EEPROM_R0w,0xFF); //Maximum der Letzten 7 Tage
+			writeEEPROM(EEPROM_dol,0xFF); //Anzahl der Betriebstage
+
+	}
+
+
+	
+	OWINIT();
+	pcmode=0;
+	pR0=readEEPROM(EEPROM_R0,1);
+	R0=pR0/100.0;
+	
+	pr_day_max=readEEPROM(EEPROM_R0d,1);
+	pr_week_max=readEEPROM(EEPROM_R0w,1);
+	ptol_d=readEEPROM(EEPROM_dol,0);
+	ptol_s8=0;  //Tag faengt mit Einschalten an
+	for(uint8_t i=0;i<7;i++) {
+		weekmaxarr[i]=pr_week_max;
+	}
+
+	USI_TWI_Master_Initialise();
+	initSHT2x();
+	_delay_ms(100);
+	MAX1164x_config(MAX1164x_S_SEL2|MAX1164x_S_SEL0,CH0_M);//#define MAX1164x_C_CS0
+	_delay_ms(30); //Internal Referenz start
+	//2970 -> 1,5V
+	gcontrol=1;
+ 
+	sei();
+	
+	//DDRB|=(1<<PINB1);
+
+    while(1)   {
+		if (testSW()) {
+			R0=1;
+			pR0=0;
+			writeEEPROM(EEPROM_R0,0);
+		}
+
+
+		if (wdcounter>0) {  //8s
+			ptol_s8++;
+			if (ptol_s8>(10000))  {//10800 ist theortisch der Tag aber meistens zu lang
+				ptol_s8=0;
+				ptol_d++;  //rund 180 Jahre :-)
+				pr_week_max=0;
+				weekmaxarr[7]=pr_day_max;
+				for(uint8_t i=0;i<7;i++) {
+					weekmaxarr[i]=weekmaxarr[i+1];
+					//maximum of week
+					if (weekmaxarr[i]>pr_week_max) pr_week_max=weekmaxarr[i];
+				}
+				if (ptol_d>7) {
+					pR0=pr_week_max;
+					} else {
+					pR0=pr_day_max;
+				}
+				//R0=//R0-0.5*(pack2.R0/100-R0);
+				R0=R0-(R0-pR0/100.0)*0.5	;
+				pR0=R0*100;
+				writeEEPROM(EEPROM_R0,pR0);
+				writeEEPROM(EEPROM_R0d,pr_day_max);  //Maximum des Tages
+				writeEEPROM(EEPROM_R0w,pr_week_max); //Maximum der Letzten 7 Tage
+				writeEEPROM(EEPROM_dol,ptol_d); //Anzahl der Betriebstage
+				pr_day_max=0;
+			}
+			if (startup!=0) startup--;
+			getSHT2xHumTemp(&temperatureC,&humidityRH);
+			ip=interp(temperatureC,humidityRH);
+			pip=ip*1000;
+			RH=calibr_hum(temperatureC,-0.2,humidityRH);
+			TC =temperatureC -0.2;
+			mr=0;
+			//Kritische Sektion !___Ein Breakpoint in dieser Section kann den TGS8100 zerstoeren!___________________________
+			PORTB&=~(1<<PINB1); //Auf 0 Ziehen
+			_delay_us(150);
+			mr+=MAX1164x_read();
+			_delay_us(150);
+			mr+=MAX1164x_read();
+			PORTB|=(1<<PINB1);
+			//ENDE Kritische Sektion !______________________________
+			//l=mr/2.0*2.048/4096;
+			// l maximal 2  mr max 4096  //mr 2V=8000
+			
+			if (pcmode) { //cmode=0 V 0..2 V cmode=1 V 1.5..3.5V
+				//l+=1.5; //Spannung real
+				mr+=6000;
+			}
+			//if (l>1.8) {
+			if (mr>7200) {
+				if (pcmode==0) {
+					MAX1164x_config(MAX1164x_S_SEL2|MAX1164x_S_SEL0,CH0_CH1);
+					pcmode=1;
+				}
+			}
+			//if (l<1.6) {
+			if (mr<6400) {
+				if (pcmode==1) {
+					MAX1164x_config(MAX1164x_S_SEL2|MAX1164x_S_SEL0,CH0_M);
+					pcmode=0;
+				}
+				
+				
+			}
+			pVS=mr*5/2;
+			l=mr/4000.0;
+			l=( 3/l- 1) *30;
+			RA=l*100;
+			
+			l=l/ip;
+			
+			if (startup==0){
+				if (l>R0) {
+					R0=l;
+					pR0=R0*100;
+					writeEEPROM(EEPROM_R0,pR0);
+
+				}
+				if (l*100>pr_day_max) {
+					pr_day_max=l*100;
+				}
+				l=exp((1-(l/R0))*6.05)-1;// exp((1-($val)/55)*5.75);  (5.75 geht über 125 6.05 geht bis 240... mittlere Linie im Datenblatt)
+				//l=(l/R0*100.0);
+				l=l*100; //fuer DS2450
+
+			} 
+			else l=0; //negative Werte am Anfang verhintern
+			wdcounter=0;
+			
+		}
+
+
+		if (gcontrol) {
+			//PORTB|=(1<<PINB1);
+			uint8_t bb=1;
+			uint8_t bb1=1;
+			for(uint8_t i=0;i<4;i++){
+				if (pack.convc1&bb1) {
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0;pack.bytes[i*2+1]=0;}
+					bb=bb<<1;
+					if (pack.convc2&(bb)) {pack.bytes[i*2]=0xFF;pack.bytes[i*2+1]=0xFF;}
+					bb=bb<<1;
+				} else bb=bb<<2;
+				bb1=bb1<<1;				
+			}
+			//CHanel A
+			if (pack.convc1&1) {
+				uint16_t ct=(temperatureC*100.0)+32767;
+				cli();pack.A=ct;sei();
+				alarmflag=0;
+				if (pack.CSA2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HA) {alarmflag=1;pack.CSA2|=0x20;}
+				if (pack.CSA2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LA) {alarmflag=1;pack.CSA2|=0x10;}
+			}
+
+			if (pack.convc1&2) {
+				cli();pack.B=humidityRH*100;sei();
+				if (pack.CSB2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HB) {alarmflag=1;pack.CSB2|=0x20;}
+				if (pack.CSB2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LB) {alarmflag=1;pack.CSB2|=0x10;}
+			}
+
+			if (pack.convc1&4) {
+				cli();pack.C=l;sei();
+				if (pack.CSC2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HC) {alarmflag=1;pack.CSC2|=0x20;}
+				if (pack.CSC2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LC) {alarmflag=1;pack.CSC2|=0x10;}
+			} 
+			if (pack.convc1&8) {
+				if (pack.CSD2&0x01)	ADMUX=3; else ADMUX=0x83;
+				_delay_us(100);
+				ADCSRA|=(1<<ADSC);
+				while ((ADCSRA&(1<<ADSC)));
+				cli();pack.D=RA;sei();
+				if (pack.CSD2&0x08)  //AEH
+					if (pack.bytes[1]>pack.HD) {alarmflag=1;pack.CSD2|=0x20;}
+				if (pack.CSD2&0x04)  //AEL
+					if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
+			}
+			
+			EXTERN_SLEEP();
+			//PORTB&=~(1<<PINB1);
+		}
+
+		uint8_t bb=1;
+		for(uint8_t i=0;i<4;i++) {
+			if (pack.bytes[8+i*2]&0x80) {  //Chanel as output
+				if (pack.bytes[8+i*2]&0x40) {
+					DDRA|=bb;
+				} else {
+					DDRA&=~bb;
+				}
+			} else {
+				DDRA&=~bb;
+			}
+			bb=bb*2;
+		}
+		
+#if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
+			if (((TIMSK & (1<<TOIE0))==0)&& (mode==0))
+#endif			
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+			if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))
+#endif
+			  {
+
+			MCUCR|=(1<<SE)|(1<<SM1);
+			MCUCR&=~(1<<ISC01);
+		} else {
+			MCUCR|=(1<<SE);
+			MCUCR&=~(1<<SM1);
+		}
+	//	asm("SLEEP");
+   }
+
+
+}
\ No newline at end of file
diff --git a/DS2450_VOC_SHT/DS2450_VOC_SHT.cproj b/DS2450_VOC_SHT/DS2450_VOC_SHT.cproj
new file mode 100644
index 0000000..33bd70e
--- /dev/null
+++ b/DS2450_VOC_SHT/DS2450_VOC_SHT.cproj
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATtiny84A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>DS2450</AssemblyName>
+    <Name>DS2450_VOC_SHT</Name>
+    <RootNamespace>DS2450</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data>
+  <options />
+  <configurations />
+  <files />
+  <documentation help="" />
+  <offline-documentation help="" />
+  <dependencies>
+    <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
+  </dependencies>
+</framework-data>
+    </AsfFrameworkConfig>
+    <avrtool />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>NDEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrGcc>
+        <avrgcc.common.Device>-mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a"</avrgcc.common.Device>
+        <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
+        <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
+        <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
+        <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
+        <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
+        <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
+        <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
+        <avrgcc.compiler.symbols.DefSymbols>
+          <ListValues>
+            <Value>DEBUG</Value>
+          </ListValues>
+        </avrgcc.compiler.symbols.DefSymbols>
+        <avrgcc.compiler.directories.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.compiler.directories.IncludePaths>
+        <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
+        <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
+        <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
+        <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
+        <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
+        <avrgcc.linker.libraries.Libraries>
+          <ListValues>
+            <Value>libm</Value>
+          </ListValues>
+        </avrgcc.linker.libraries.Libraries>
+        <avrgcc.assembler.general.IncludePaths>
+          <ListValues>
+            <Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include</Value>
+          </ListValues>
+        </avrgcc.assembler.general.IncludePaths>
+        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
+      </AvrGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="..\common\calibr.c">
+      <SubType>compile</SubType>
+      <Link>calibr.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\MAX1164x.c">
+      <SubType>compile</SubType>
+      <Link>MAX1164x.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\SHT2xV2.c">
+      <SubType>compile</SubType>
+      <Link>SHT2xV2.c</Link>
+    </Compile>
+    <Compile Include="..\common\I2C\USI_TWI_Master.c">
+      <SubType>compile</SubType>
+      <Link>USI_TWI_Master.c</Link>
+    </Compile>
+    <Compile Include="DS2450_VOC_SHT.c">
+      <SubType>compile</SubType>
+    </Compile>
+    <Compile Include="OWDS2450.S">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
diff --git a/DS2450_VOC_SHT/OWDS2450.S b/DS2450_VOC_SHT/OWDS2450.S
new file mode 100644
index 0000000..1d81abd
--- /dev/null
+++ b/DS2450_VOC_SHT/OWDS2450.S
@@ -0,0 +1,247 @@
+
+// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr
+		rjmp h_readmemory
+		rjmp h_readmemorycrc1
+		rjmp h_readmemorycrc2
+		rjmp h_writememoryaddr
+		rjmp h_writememory
+		rjmp h_writememorycrc1
+		rjmp h_writememorycrc2
+		rjmp h_writememoryreadback
+		rjmp h_convert
+		rjmp h_convertcrc1
+		rjmp h_convertcrc2
+		rjmp h_convert_conv
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC2 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC1 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC2 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK OW_FIRST_COMMAND+8
+#define OW_CONVERT OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR
+	cset 0x55,OW_WRITE_MEMORY_ADDR
+	cset 0x3C,OW_CONVERT
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory2
+h_readmemory:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc
+h_readmemory2:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC2
+	rjmp handle_end
+h_readmemorycrc2:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end; ende des speichers
+	ldi r_mode,OW_READ_MEMORY
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory2
+
+h_writememoryaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte1 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory:
+	lds r_bytep,addr
+	configZ pack,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC1
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC2
+	rjmp handle_end
+h_writememorycrc2:
+	lds r_temp,addr
+	configZ pack,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK
+	rjmp handle_end
+h_writememoryreadback:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY
+	rjmp handle_end
+
+h_convert:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte1 ;nein dann weiter
+	inc r_bytep
+	sts pack+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte1: ;zweies byte glesen go crc#
+	sts pack+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC1
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc1:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC2
+	rjmp handle_end
+h_convertcrc2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/common/I2C/BME680.c b/common/I2C/BME680.c
index 9907867..3d2bec7 100644
--- a/common/I2C/BME680.c
+++ b/common/I2C/BME680.c
@@ -76,8 +76,9 @@
 
 #include <util/delay.h>
 #include <avr/pgmspace.h>
+#include <avr/interrupt.h>
 
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include "BME680.h"
 
 #define WC 0b11101100
@@ -237,6 +238,14 @@ const float lookup_k2_range[16] PROGMEM = {
 	8e6, 4e6, 2e6, 1e6,499500.4995, 248262.1648, 125000, 63004.03226,
 31281.28128, 15625, 7812.5, 3906.25,1953.125,976.5625, 488.28125, 244.140625};
 
+const float lookup_k1_range1[16]  = {
+	1, 1, 1, 1, 1,0.99, 1, 0.992,
+1, 1, 0.998, 0.995, 1, 0.99, 1, 1};
+const float lookup_k2_range1[16]  = {
+	8e6, 4e6, 2e6, 1e6,499500.4995, 248262.1648, 125000, 63004.03226,
+31281.28128, 15625, 7812.5, 3906.25,1953.125,976.5625, 488.28125, 244.140625};
+
+
 double bme680_compensate_gas_double(uint16_t gas_adc_u16, uint8_t gas_range_u8)
 {
 	double gas_res_d = 0;
@@ -248,11 +257,14 @@ double bme680_compensate_gas_double(uint16_t gas_adc_u16, uint8_t gas_range_u8)
 	double var1 = 0;
 	float a1= pgm_read_float(&(lookup_k1_range[gas_range_u8]));
 	float a2= pgm_read_float(&(lookup_k2_range[gas_range_u8]));
+	//float a1=lookup_k1_range1[gas_range_u8];
+	//float a2=lookup_k2_range1[gas_range_u8];
 
 	range_switching_error_val =	calib.range_switching_error;
 
 
 	var1 = (1340.0 + (5.0 * range_switching_error_val))*a1;
+
 	gas_res_d = var1*a2/(gas_adc_u16-512.0+var1);
 	return gas_res_d;
 }
@@ -345,6 +357,7 @@ void readBMP680(int16_t *T,uint16_t *H,uint32_t *P,uint16_t *G){
 	I2c_StopCondition();
 	*G=(((uint16_t)g1)<<2)|(g2>>6);
 	*P=*G;
+	
 	*G= bme680_compensate_gas_double(*G,g2&0xF)/10.0;
 
 	int32_t temp_comp = 0;
@@ -431,6 +444,5 @@ void readBMP680(int16_t *T,uint16_t *H,uint32_t *P,uint16_t *G){
 	*H=g2;
 	//*P=
 
-
 }
 
diff --git a/common/I2C/BMP280.c b/common/I2C/BMP280.c
index 97ab51d..9fb4319 100644
--- a/common/I2C/BMP280.c
+++ b/common/I2C/BMP280.c
@@ -4,7 +4,7 @@
 #include <util/delay.h>
 #include <avr/wdt.h>
 #include <avr/sleep.h>
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 
 uint16_t dig_T1;
 int16_t dig_T2;
@@ -45,6 +45,12 @@ short bmp280ReadShort(unsigned char address)
 }
 
 void bmp280Init(void) {
+	I2c_StartCondition();
+	I2c_WriteByte(0xEC);
+	I2c_WriteByte(0xF4);
+	I2c_WriteByte(0b01010111); //2x Temp over 16x Press over   Normal mode
+	I2c_WriteByte(0b11100000);  //4s time / no IIfilter
+	I2c_StopCondition();
 	dig_T1=bmp280ReadShort(0x88);
 	dig_T2=bmp280ReadShort(0x8A);
 	dig_T3=bmp280ReadShort(0x8C);
@@ -57,12 +63,7 @@ void bmp280Init(void) {
 	dig_P7=bmp280ReadShort(0x9A);
 	dig_P8=bmp280ReadShort(0x9C);
 	dig_P9=bmp280ReadShort(0x9E);
-	I2c_StartCondition();
-	I2c_WriteByte(0xEC);
-	I2c_WriteByte(0xF4);
-	I2c_WriteByte(0b01010111); //2x Temp over 16x Press over   Normal mode
-	I2c_WriteByte(0b11100000);  //4s time / no IIfilter
-	I2c_StopCondition();
+	
 	
 	
 }
@@ -133,11 +134,78 @@ int32_t bmp280ReadPressure_simple() {
 
 
 }
+#define BMP280_S32_t int32_t
+// Returns temperature in DegC, double precision. Output value of “51.23” equals 51.23 DegC.
+// t_fine carries fine temperature as global value
+BMP280_S32_t t_fine;
+double bmp280_compensate_T_double(BMP280_S32_t adc_T)
+{
+	double var1, var2, T;
+	var1 = (((double)adc_T)/16384.0 - ((double)dig_T1)/1024.0) * ((double)dig_T2);
+	var2 = ((((double)adc_T)/131072.0 - ((double)dig_T1)/8192.0) *
+	(((double)adc_T)/131072.0 - ((double) dig_T1)/8192.0)) * ((double)dig_T3);
+	t_fine = (BMP280_S32_t)(var1 + var2);
+	T = (var1 + var2) / 5120.0;
+	return T;
+}
+// Returns pressure in Pa as double. Output value of “96386.2” equals 96386.2 Pa = 963.862 hPa
+double bmp280_compensate_P_double(BMP280_S32_t adc_P)
+{
+	double var1, var2, p;
+	var1 = ((double)t_fine/2.0) - 64000.0;
+	var2 = var1 * var1 * ((double)dig_P6) / 32768.0;
+	var2 = var2 + var1 * ((double)dig_P5) * 2.0;
+	var2 = (var2/4.0)+(((double)dig_P4) * 65536.0);
+	var1 = (((double)dig_P3) * var1 * var1 / 524288.0 + ((double)dig_P2) * var1) / 524288.0;
+	var1 = (1.0 + var1 / 32768.0)*((double)dig_P1);
+	if (var1 == 0.0)
+	{
+		return 0; // avoid exception caused by division by zero
+	}
+	p = 1048576.0 - (double)adc_P;
+	p = (p - (var2 / 4096.0)) * 6250.0 / var1;
+	var1 = ((double)dig_P9) * p * p / 2147483648.0;
+	var2 = p * ((double)dig_P8) / 32768.0;
+	p = p + (var1 + var2 + ((double)dig_P7)) / 16.0;
+	return p;
+}
+
+void bmp280ConvertInt_df(int32_t * temperature,uint32_t *pressure,uint8_t oss) {
+		//bmp280Init();
+		double var1, var2, T;
+		int32_t adc_T=bmp280ReadTemp();
+		var1 = (((double)adc_T)/16384.0 - ((double)dig_T1)/1024.0) * ((double)dig_T2);
+		var2 = ((((double)adc_T)/131072.0 - ((double)dig_T1)/8192.0) *
+		(((double)adc_T)/131072.0 - ((double) dig_T1)/8192.0)) * ((double)dig_T3);
+		t_fine = (BMP280_S32_t)(var1 + var2);
+		T = (var1 + var2) / 5120.0;
+
+		int32_t adc_P= bmp280ReadPressure(oss);
+		double  p;
+		var1 = ((double)t_fine/2.0) - 64000.0;
+		var2 = var1 * var1 * ((double)dig_P6) / 32768.0;
+		var2 = var2 + var1 * ((double)dig_P5) * 2.0;
+		var2 = (var2/4.0)+(((double)dig_P4) * 65536.0);
+		var1 = (((double)dig_P3) * var1 * var1 / 524288.0 + ((double)dig_P2) * var1) / 524288.0;
+		var1 = (1.0 + var1 / 32768.0)*((double)dig_P1);
+		if (var1 == 0.0)
+		{
+			return ; // avoid exception caused by division by zero
+		}
+		p = 1048576.0 - (double)adc_P;
+		p = (p - (var2 / 4096.0)) * 6250.0 / var1;
+		var1 = ((double)dig_P9) * p * p / 2147483648.0;
+		var2 = p * ((double)dig_P8) / 32768.0;
+		p = p + (var1 + var2 + ((double)dig_P7)) / 16.0;
+		*temperature=(int32_t) (T*100.0);
+		*pressure=(uint32_t) p;
+		return;
+}
+
+
 
 void bmp280ConvertInt(int32_t * temperature,uint32_t *pressure,uint8_t oss) {
 	int32_t var1,var2,T,t_fine;
-	
-	
 	int32_t adc_T=bmp280ReadTemp();
 	var1 = ((((adc_T>>3) - ((int32_t)dig_T1<<1))) * ((int32_t)dig_T2)) >> 11;
 	var2 = ((((((adc_T>>4) - ((int32_t)dig_T1)) * ((adc_T>>4) - (int32_t)dig_T1))) >> 12) *((int32_t)dig_T3)) >> 14;
@@ -145,7 +213,7 @@ void bmp280ConvertInt(int32_t * temperature,uint32_t *pressure,uint8_t oss) {
 	T = (t_fine * 5 + 128) >> 8;
 	*temperature=T;
 	int32_t adc_P= bmp280ReadPressure(oss);
-	uint32_t p;
+	int32_t p;
 	var1 = (((int32_t)t_fine)>>1) - (int32_t)64000;
 	var2 = (((var1>>2) * (var1>>2)) >> 11 ) * ((int32_t)dig_P6);
 	var2 = var2 + ((var1*((int32_t)dig_P5))<<1);
@@ -164,7 +232,8 @@ void bmp280ConvertInt(int32_t * temperature,uint32_t *pressure,uint8_t oss) {
 	var1 = (((int32_t)dig_P9) * ((int32_t)(((p>>3) * (p>>3))>>13)))>>12;
 	var2 = (((int32_t)(p>>2)) * ((int32_t)dig_P8))>>13;
 	p = (uint32_t)((int32_t)p + ((var1 + var2 + dig_P7) >> 4));
-	*pressure=p;
+
+	*pressure=(uint32_t)(p);
 
 }
 
diff --git a/common/I2C/BMP280.h b/common/I2C/BMP280.h
index 5c9f86d..330eccd 100644
--- a/common/I2C/BMP280.h
+++ b/common/I2C/BMP280.h
@@ -9,6 +9,7 @@ int32_t bmp280ReadPressure(uint8_t oss);
 int32_t bmp280ReadPressure_simple();
 void bmp280Convert(double * temperature, double * pressure,uint8_t oss);
 void bmp280ConvertInt(int32_t * temperature,uint32_t *pressure,uint8_t oss);
+void bmp280ConvertInt_df(int32_t * temperature,uint32_t *pressure,uint8_t oss);
 void bmp280ConvertIntP(int32_t temp256,uint32_t *pressure) ;
 void bmp280ConvertIntP1(uint32_t *pressure) ;
 
diff --git a/common/I2C/CDM7160.c b/common/I2C/CDM7160.c
index e82a138..868f344 100644
--- a/common/I2C/CDM7160.c
+++ b/common/I2C/CDM7160.c
@@ -35,7 +35,7 @@
 #include <util/delay.h>
 
 
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include "CDM7160.h"
 
 
diff --git a/common/I2C/HDC2010.c b/common/I2C/HDC2010.c
new file mode 100644
index 0000000..03036a3
--- /dev/null
+++ b/common/I2C/HDC2010.c
@@ -0,0 +1,291 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//---------- Includes ----------------------------------------------------------
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include "TWI_Master.h"
+#include "HDC2010.h"
+typedef enum{
+	I2C_ADR_W = 130, // sensor I2C address + write bit //ADR=VDD
+	I2C_ADR_R = 131 // sensor I2C address + read bit
+}etI2cHeader;
+
+uint8_t HDC2010_Init() {
+	volatile uint8_t error=0;
+	/*I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x02); // Config
+	error |= I2c_WriteByte (0x0); // 14 bit
+	error |= I2c_WriteByte (0x0); // 
+	I2c_StopCondition();*/
+	return error;
+
+}
+
+uint8_t HDC2010_Readf(double * temperature, double * hum) {	
+	int16_t t;
+	uint16_t h;
+	uint8_t error=0;
+	error=HDC2010_Readi(&t,&h);
+	*temperature=(double)t/65536.0*165.0-40.0;
+	*hum=(double)h/65536.0*100;
+	return error;
+
+}
+uint8_t HDC2010_Readi(int16_t * temperature, uint16_t * hum) {
+	volatile uint8_t error=0;
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x0F); //
+	error |= I2c_WriteByte (0x01); //
+	I2c_StopCondition();
+	_delay_ms(10);
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x0); //
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R); //I2C address
+	*temperature=0;
+	*temperature |= I2c_ReadByte(ACK);
+	*temperature |= I2c_ReadByte(ACK)<<8; 
+	*hum=0;
+	*hum|= I2c_ReadByte(ACK);
+	*hum|= I2c_ReadByte(NO_ACK)<<8;
+	I2c_StopCondition();
+
+	return error;
+	}
+
+/*
+
+const uint16_t POLYNOMIAL = 0x131; //P(x)=x^8+x^5+x^4+1 = 100110001
+
+
+//==============================================================================
+uint8_t SHT2x_CheckCrc(uint8_t data[], uint8_t nbrOfBytes, uint8_t checksum)
+//==============================================================================
+{
+	uint8_t crc = 0;
+	uint8_t byteCtr;
+	//calculates 8-Bit checksum with given polynomial
+	for (byteCtr = 0; byteCtr < nbrOfBytes; ++byteCtr)
+	{ crc ^= (data[byteCtr]);
+		for (uint8_t bit = 8; bit > 0; --bit)
+		{ if (crc & 0x80) crc = (crc << 1) ^ POLYNOMIAL;
+			else crc = (crc << 1);
+		}
+	}
+	if (crc != checksum) return CHECKSUM_ERROR;
+	else return 0;
+}
+//===========================================================================
+uint8_t SHT2x_ReadUserRegister(uint8_t *pRegisterValue)
+//===========================================================================
+{
+	uint8_t checksum; //variable for checksum byte
+	uint8_t error=0; //variable for error code
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W);
+	error |= I2c_WriteByte (USER_REG_R);
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R);
+	*pRegisterValue = I2c_ReadByte(ACK);
+	checksum=I2c_ReadByte(NO_ACK);
+	error |= SHT2x_CheckCrc (pRegisterValue,1,checksum);
+	I2c_StopCondition();
+	return error;
+}
+//===========================================================================
+uint8_t SHT2x_WriteUserRegister(uint8_t *pRegisterValue)
+//===========================================================================
+{
+	uint8_t error=0; //variable for error code
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W);
+	error |= I2c_WriteByte (USER_REG_W);
+	error |= I2c_WriteByte (*pRegisterValue);
+	I2c_StopCondition();
+	return error;
+}
+//===========================================================================
+uint8_t SHT2x_MeasureHM(etSHT2xMeasureType eSHT2xMeasureType, int16_t *pMeasurand)
+//===========================================================================
+{
+	uint8_t checksum; //checksum
+	uint8_t data[2]; //data array for checksum verification
+	uint8_t error=0; //error variable
+	uint16_t i; //counting variable
+	//-- write I2C sensor address and command --
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	switch(eSHT2xMeasureType)
+	{ case HUMIDITY: error |= I2c_WriteByte (TRIG_RH_MEASUREMENT_HM); break;
+		case TEMP : error |= I2c_WriteByte (TRIG_T_MEASUREMENT_HM); break;
+		//default: assert(0);
+	}
+	//-- wait until hold master is released --
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R);
+	//SCL=HIGH; // set SCL I/O port as input
+	DDR_USI&=~(1<<PIN_USI_SCL);
+	for(i=0; i<1000; i++) // wait until master hold is released or ;;;;; Son quatsch.... 1000 s *kopfschuettel*
+	{ _delay_ms(1); // a timeout (~1s) is reached
+		//if (SCL_CONF==1) break;
+		if (PIN_USI&(1<<PIN_USI_SCL)) break;
+	}
+	//-- check for timeout --
+	//Was wenn der SHT2x die leitung auf 0 laesst? Kurzschluss???
+	if((PIN_USI&(1<<PIN_USI_SCL))==0) error |= TIME_OUT_ERROR; else DDR_USI|=(1<<PIN_USI_SCL);
+	
+	//-- read two data bytes and one checksum byte --
+	*pMeasurand=((data[0] = I2c_ReadByte(ACK))>>8) & 0xFF;
+	*pMeasurand|=0xFF & (data[1] = I2c_ReadByte(ACK));
+//	pMeasurand->s16.u8H = data[0] = I2c_ReadByte(ACK);
+//	pMeasurand->s16.u8L = data[1] = I2c_ReadByte(ACK);
+
+	checksum=I2c_ReadByte(NO_ACK);
+	//-- verify checksum --
+	error |= SHT2x_CheckCrc (data,2,checksum);
+	I2c_StopCondition();
+	return error;
+}
+//===========================================================================
+uint8_t SHT2x_MeasurePoll(etSHT2xMeasureType eSHT2xMeasureType, int16_t *pMeasurand)
+//===========================================================================
+{
+	uint8_t checksum; //checksum
+	uint8_t data[2]; //data array for checksum verification
+	uint8_t error=0; //error variable
+	uint16_t i=0; //counting variable
+	//-- write I2C sensor address and command --
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	switch(eSHT2xMeasureType)
+	{ case HUMIDITY: error |= I2c_WriteByte (TRIG_RH_MEASUREMENT_POLL); break;
+		case TEMP : error |= I2c_WriteByte (TRIG_T_MEASUREMENT_POLL); break;
+		//default: assert(0);
+	}
+	//-- poll every 10ms for measurement ready. Timeout after 20 retries (200ms)--
+	do
+	{ I2c_StartCondition();
+		_delay_ms(200); //delay 10ms
+		if(i++ >= 20) break;
+	} while(I2c_WriteByte (I2C_ADR_R) == ACK_ERROR);
+	if (i>=20) error |= TIME_OUT_ERROR;
+	//-- read two data bytes and one checksum byte --
+	data[0]=I2c_ReadByte(ACK);
+	data[1]=I2c_ReadByte(ACK);
+	*pMeasurand=(data[0]<<8)|data[1];
+	
+//	pMeasurand->s16.u8H = data[0] = I2c_ReadByte(ACK);
+//	pMeasurand->s16.u8L = data[1] = I2c_ReadByte(ACK);
+	checksum=I2c_ReadByte(NO_ACK);
+	//-- verify checksum --
+	error |= SHT2x_CheckCrc (data,2,checksum);
+	I2c_StopCondition();
+	return error;
+}
+//===========================================================================
+uint8_t SHT2x_SoftReset(void)
+//===========================================================================
+{
+	uint8_t error=0; //error variable
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (SOFT_RESET); // Command
+	I2c_StopCondition();
+	_delay_ms(15); // wait till sensor has restarted
+	return error;
+}
+//==============================================================================
+float SHT2x_CalcRH(uint16_t u16sRH)
+//==============================================================================
+{
+	double humidityRH; // variable for result
+	u16sRH &= ~0x0003; // clear bits [1..0] (status bits)
+	//-- calculate relative humidity [%RH] --
+	humidityRH = -6.0 + 125.0/65536 * (double)u16sRH; // RH= -6 + 125 * SRH/2^16
+	return humidityRH;
+}
+//==============================================================================
+float SHT2x_CalcTemperatureC(uint16_t u16sT)
+//==============================================================================
+{
+	double temperatureC; // variable for result
+	u16sT &= ~0x0003; // clear bits [1..0] (status bits)
+	//-- calculate temperature [°C] --
+	temperatureC= -46.85 + 175.72/65536 *(double)u16sT; //T= -46.85 + 175.72 * ST/2^16
+	return temperatureC;
+}
+//==============================================================================
+uint8_t SHT2x_GetSerialNumber(uint8_t u8SerialNumber[])
+//==============================================================================
+{
+	uint8_t error=0; //error variable
+	//Read from memory location 1
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); //I2C address
+	error |= I2c_WriteByte (0xFA); //Command for readout on-chip memory
+	error |= I2c_WriteByte (0x0F); //on-chip memory address
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R); //I2C address
+	u8SerialNumber[5] = I2c_ReadByte(ACK); //Read SNB_3
+	I2c_ReadByte(ACK); //Read CRC SNB_3 (CRC is not analyzed)
+	u8SerialNumber[4] = I2c_ReadByte(ACK); //Read SNB_2
+	I2c_ReadByte(ACK); //Read CRC SNB_2 (CRC is not analyzed)
+	u8SerialNumber[3] = I2c_ReadByte(ACK); //Read SNB_1
+	I2c_ReadByte(ACK); //Read CRC SNB_1 (CRC is not analyzed)
+	u8SerialNumber[2] = I2c_ReadByte(ACK); //Read SNB_0
+	I2c_ReadByte(NO_ACK); //Read CRC SNB_0 (CRC is not analyzed)
+	I2c_StopCondition();
+	//Read from memory location 2
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); //I2C address
+	error |= I2c_WriteByte (0xFC); //Command for readout on-chip memory
+	error |= I2c_WriteByte (0xC9); //on-chip memory address
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R); //I2C address
+	u8SerialNumber[1] = I2c_ReadByte(ACK); //Read SNC_1
+	u8SerialNumber[0] = I2c_ReadByte(ACK); //Read SNC_0
+	I2c_ReadByte(ACK); //Read CRC SNC0/1 (CRC is not analyzed)
+	u8SerialNumber[7] = I2c_ReadByte(ACK); //Read SNA_1
+	u8SerialNumber[6] = I2c_ReadByte(ACK); //Read SNA_0
+	I2c_ReadByte(NO_ACK); //Read CRC SNA0/1 (CRC is not analyzed)
+	I2c_StopCondition();
+	return error;
+}
+*/
\ No newline at end of file
diff --git a/common/I2C/HDC2010.h b/common/I2C/HDC2010.h
new file mode 100644
index 0000000..84f133e
--- /dev/null
+++ b/common/I2C/HDC2010.h
@@ -0,0 +1,42 @@
+#ifndef HDC2010_H
+#define HDC2010_H
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+uint8_t HDC2010_Init();
+
+uint8_t HDC2010_Readf(double * temperature, double * hum);
+uint8_t HDC2010_Readi(int16_t * temperature, uint16_t * hum);
+
+
+#endif
diff --git a/common/I2C/LPS225HB.c b/common/I2C/LPS225HB.c
new file mode 100644
index 0000000..eafb35c
--- /dev/null
+++ b/common/I2C/LPS225HB.c
@@ -0,0 +1,129 @@
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+//---------- Includes ----------------------------------------------------------
+#define F_CPU 8000000UL
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/wdt.h>
+#include <avr/sleep.h>
+#include "USI_TWI_Master.h"
+#include "LPS225HB.h"
+typedef enum{
+	I2C_ADR_W = 0b10111000, // sensor I2C address + write bit //ADR=VDD
+	I2C_ADR_R = 0b10111001 // sensor I2C address + read bit
+}etI2cHeader;
+
+uint8_t LPS225HB_Init() {
+	volatile uint8_t error=0;
+	/*I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x02); // Config
+	error |= I2c_WriteByte (0x0); // 14 bit
+	error |= I2c_WriteByte (0x0); // 
+	I2c_StopCondition();*/
+
+
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x11); //
+	//error |= I2c_WriteByte (0b01110001); //
+	error |= I2c_WriteByte (0b00010100); //
+	I2c_StopCondition();
+	return error;
+
+}
+
+uint8_t LPS225HB_Readf(double * temperature, double * pressure) {	
+	int16_t t;
+	uint32_t p;
+	uint8_t error=0;
+	error= LPS225HB_Readi(&t,&p);
+	*temperature=(double)t/100.0;
+	*pressure=(double)p/4096.0;
+	return error;
+
+}
+uint8_t readReg(uint8_t reg) {
+	volatile uint8_t error=0;
+	uint8_t ret;
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (reg); //
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R); //I2C address
+	ret= I2c_ReadByte(NO_ACK);
+	I2c_StopCondition();
+	return ret;
+}
+
+uint8_t LPS225HB_Readi(int16_t * temperature, uint32_t * pressure) {
+	volatile uint8_t error=0;
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x11); //
+	//error |= I2c_WriteByte (0b00000001); //
+	error |= I2c_WriteByte (0b01010001); //
+	I2c_StopCondition();
+	_delay_ms(1000);
+//	uint16_t status=0;
+//	status=readReg(0x27);
+//	status|=readReg(0x26)<<8;
+//	*pressure=0;
+//	*pressure|= readReg(0x28);
+//	*pressure|= ((uint32_t)readReg(0x29))<<8;
+//	*pressure|= ((uint32_t)readReg(0x2A))<<16;
+
+
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_W); // I2C Adr
+	error |= I2c_WriteByte (0x28); //
+	I2c_StartCondition();
+	error |= I2c_WriteByte (I2C_ADR_R); //I2C address
+//	status= I2c_ReadByte(ACK)<<8;
+//	status|= I2c_ReadByte(ACK);
+
+
+	*pressure=0;
+	*pressure|= I2c_ReadByte(ACK);
+	*pressure|= ((uint32_t)I2c_ReadByte(ACK))<<8;
+	*pressure|= ((uint32_t)I2c_ReadByte(ACK))<<16;
+	*temperature=0;
+	*temperature |= I2c_ReadByte(ACK);
+	*temperature |= ((int16_t)I2c_ReadByte(NO_ACK)<<8); 
+	I2c_StopCondition();
+	//*temperature=status;
+
+	return error;
+	}
+
diff --git a/common/I2C/LPS225HB.h b/common/I2C/LPS225HB.h
new file mode 100644
index 0000000..c69f90c
--- /dev/null
+++ b/common/I2C/LPS225HB.h
@@ -0,0 +1,42 @@
+#ifndef LPS225HB_H
+#define LPS225HB_H
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//  * Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//  * Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the
+//    distribution.
+//  * All advertising materials mentioning features or use of this
+//    software must display the following acknowledgement: This product
+//    includes software developed by tm3d.de and its contributors.
+//  * Neither the name of tm3d.de nor the names of its contributors may
+//    be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+uint8_t LPS225HB_Init();
+
+uint8_t LPS225HB_Readf(double * temperature, double * pressure);
+uint8_t LPS225HB_Readi(int16_t * temperature, uint32_t * pressure);
+
+
+#endif
diff --git a/common/I2C/MAX44009.c b/common/I2C/MAX44009.c
index 212524b..3340dbb 100644
--- a/common/I2C/MAX44009.c
+++ b/common/I2C/MAX44009.c
@@ -35,7 +35,7 @@
 #include <util/delay.h>
 
 
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include "MAX44009.h"
 
 uint8_t checkMAX44009(uint8_t nr) {
diff --git a/common/I2C/SGP30.c b/common/I2C/SGP30.c
index 62841c4..00b24cd 100644
--- a/common/I2C/SGP30.c
+++ b/common/I2C/SGP30.c
@@ -162,6 +162,8 @@ void save_baseline(uint16_t b1,uint16_t b2 ) {
 void read_baseline(uint16_t *b1,uint16_t *b2) {
 	*b1=readEEPROM(0,0xFFFF);
 	*b2=readEEPROM(2,0xFFFF);
+	*b1=0xFFFF;
+	*b2=0xFFFF;
 }
 
 void set_baseline(uint16_t b1,uint16_t b2) {
diff --git a/common/I2C/SHT2x.c b/common/I2C/SHT2x.c
index ae9f352..bc5b662 100644
--- a/common/I2C/SHT2x.c
+++ b/common/I2C/SHT2x.c
@@ -15,7 +15,7 @@
 #include <util/delay.h>
 #include <avr/wdt.h>
 #include <avr/sleep.h>
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include "SHT2x.h"
 
 const uint16_t POLYNOMIAL = 0x131; //P(x)=x^8+x^5+x^4+1 = 100110001
diff --git a/common/I2C/SHT2xV2.c b/common/I2C/SHT2xV2.c
index 130e85b..adbaf06 100644
--- a/common/I2C/SHT2xV2.c
+++ b/common/I2C/SHT2xV2.c
@@ -34,7 +34,7 @@
 #define F_CPU 8000000UL
 #include <avr/io.h>
 #include <util/delay.h>
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include "SHT2xV2.h"
 
 uint8_t initSHT2x(){
@@ -97,9 +97,13 @@ uint8_t getSHT2xHumTemp(double *temp,double *hum) {
 	if (calcCRCSHT2x(t1,t2)==tc)
 		*temp=-46.85 + 175.72/65536 *(double)(((uint16_t)t1<<8)|(t2&0xF8));
 	else ret=0;
-	if (calcCRCSHT2x(f1,f2)==fc)
+	if (calcCRCSHT2x(f1,f2)==fc) {
 		*hum=-6.0+125.0/65536*(double)(((uint16_t)f1<<8)|(f2&0xF8));
+		*hum=(*hum)-((100.0/(*hum)*2.5)-2.5);
+		}
 	else ret=0;
+	//*temp=20;
+	//*hum=10;
 	return ret;
 }
 
diff --git a/common/I2C/SHT3x.c b/common/I2C/SHT3x.c
index b20de79..8246a32 100644
--- a/common/I2C/SHT3x.c
+++ b/common/I2C/SHT3x.c
@@ -12,7 +12,7 @@
 #define F_CPU 8000000UL
 #include <avr/io.h>
 #include <util/delay.h>
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include "SHT3x.h"
 
 uint8_t initSHT3x(uint8_t adrline){
diff --git a/common/I2C/TSL256x.c b/common/I2C/TSL256x.c
index d32ab0f..979a903 100644
--- a/common/I2C/TSL256x.c
+++ b/common/I2C/TSL256x.c
@@ -4,7 +4,7 @@
 #include <util/delay.h>
 #include <avr/wdt.h>
 #include <avr/sleep.h>
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 
 void TSL256x_init() {
 	I2c_StartCondition();
diff --git a/common/I2C/TWI_Master.c b/common/I2C/TWI_Master.c
new file mode 100644
index 0000000..ed125ec
--- /dev/null
+++ b/common/I2C/TWI_Master.c
@@ -0,0 +1,367 @@
+
+#ifdef  __4MHZ__
+#define F_CPU 4000000UL
+#else
+#define F_CPU 8000000UL
+#endif
+#include <avr/io.h>
+#include "TWI_Master.h"
+#include <util/delay.h>
+
+#if defined(__AVR_AT90Mega169__) | defined(__AVR_ATmega169PA__) | \
+defined(__AVR_AT90Mega165__) | defined(__AVR_ATmega165__) | \
+defined(__AVR_ATmega325__) | defined(__AVR_ATmega3250__) | \
+defined(__AVR_ATmega645__) | defined(__AVR_ATmega6450__) | \
+defined(__AVR_ATmega329__) | defined(__AVR_ATmega3290__) | \
+defined(__AVR_ATmega649__) | defined(__AVR_ATmega6490__) |\
+defined(__AVR_ATtiny25__) | defined(__AVR_ATtiny45__) | defined(__AVR_ATtiny85__) | \
+defined(__AVR_AT90Tiny26__) | defined(__AVR_ATtiny26__) |\
+defined(__AVR_AT90Tiny2313__) | defined(__AVR_ATtiny2313__) |\
+defined(__AVR_ATtiny84__) | defined(__AVR_ATtiny84A__)
+
+unsigned char USI_TWI_Master_Transfer( unsigned char );
+unsigned char USI_TWI_Master_Stop( void );
+
+union  USI_TWI_state
+{
+  unsigned char errorState;         // Can reuse the TWI_state for error states due to that it will not be need if there exists an error.
+  struct
+  {
+    unsigned char addressMode         : 1;
+    unsigned char masterWriteDataMode : 1;
+    unsigned char unused              : 6;
+  }; 
+}   USI_TWI_state;
+
+/*---------------------------------------------------------------
+ USI TWI single master initialization function
+---------------------------------------------------------------*/
+void TWI_Master_Initialise( void )
+{
+  PORT_USI |= (1<<PIN_USI_SDA);           // Enable pullup on SDA, to set high as released state.
+  PORT_USI |= (1<<PIN_USI_SCL);           // Enable pullup on SCL, to set high as released state.
+  
+  DDR_USI  |= (1<<PIN_USI_SCL);           // Enable SCL as output.
+  DDR_USI  |= (1<<PIN_USI_SDA);           // Enable SDA as output.
+  
+  USIDR    =  0xFF;                       // Preload dataregister with "released level" data.
+  USICR    =  (0<<USISIE)|(0<<USIOIE)|                            // Disable Interrupts.
+              (1<<USIWM1)|(0<<USIWM0)|                            // Set USI in Two-wire mode.
+              (1<<USICS1)|(0<<USICS0)|(1<<USICLK)|                // Software stobe as counter clock source
+              (0<<USITC);
+  USISR   =   (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Clear flags,
+              (0x0<<USICNT0);                                     // and reset counter.
+}
+
+/*---------------------------------------------------------------
+Use this function to get hold of the error message from the last transmission
+---------------------------------------------------------------*/
+unsigned char USI_TWI_Get_State_Info( void )
+{
+  return ( USI_TWI_state.errorState );                            // Return error state.
+}
+
+/*---------------------------------------------------------------
+ USI Transmit and receive function. LSB of first byte in data 
+ indicates if a read or write cycles is performed. If set a read
+ operation is performed.
+
+ Function generates (Repeated) Start Condition, sends address and
+ R/W, Reads/Writes Data, and verifies/sends ACK.
+ 
+ Success or error code is returned. Error codes are defined in 
+ USI_TWI_Master.h
+---------------------------------------------------------------*/
+unsigned char USI_TWI_Start_Transceiver_With_Data( unsigned char *msg, unsigned char msgSize)
+{
+  unsigned char tempUSISR_8bit = (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Prepare register value to: Clear flags, and
+                                 (0x0<<USICNT0);                                     // set USI to shift 8 bits i.e. count 16 clock edges.
+  unsigned char tempUSISR_1bit = (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Prepare register value to: Clear flags, and
+                                 (0xE<<USICNT0);                                     // set USI to shift 1 bit i.e. count 2 clock edges.
+
+  USI_TWI_state.errorState = 0;
+  USI_TWI_state.addressMode = TRUE;
+
+#ifdef PARAM_VERIFICATION
+  if(msg > (unsigned char*)RAMEND)                 // Test if address is outside SRAM space
+  {
+    USI_TWI_state.errorState = USI_TWI_DATA_OUT_OF_BOUND;
+    return (FALSE);
+  }
+  if(msgSize <= 1)                                 // Test if the transmission buffer is empty
+  {
+    USI_TWI_state.errorState = USI_TWI_NO_DATA;
+    return (FALSE);
+  }
+#endif
+
+#ifdef NOISE_TESTING                                // Test if any unexpected conditions have arrived prior to this execution.
+  if( USISR & (1<<USISIF) )
+  {
+    USI_TWI_state.errorState = USI_TWI_UE_START_CON;
+    return (FALSE);
+  }
+  if( USISR & (1<<USIPF) )
+  {
+    USI_TWI_state.errorState = USI_TWI_UE_STOP_CON;
+    return (FALSE);
+  }
+  if( USISR & (1<<USIDC) )
+  {
+    USI_TWI_state.errorState = USI_TWI_UE_DATA_COL;
+    return (FALSE);
+  }
+#endif
+
+  if ( !(*msg & (1<<TWI_READ_BIT)) )                // The LSB in the address byte determines if is a masterRead or masterWrite operation.
+  {
+    USI_TWI_state.masterWriteDataMode = TRUE;
+  }
+
+/* Release SCL to ensure that (repeated) Start can be performed */
+  PORT_USI |= (1<<PIN_USI_SCL);                     // Release SCL.
+  while( !(PIN_USI & (1<<PIN_USI_SCL)) );          // Verify that SCL becomes high.
+#ifdef TWI_FAST_MODE
+  _delay_us( T4_TWI/4 );                         // Delay for T4TWI if TWI_FAST_MODE
+#else
+  _delay_us( T2_TWI/4 );                         // Delay for T2TWI if TWI_STANDARD_MODE
+#endif
+
+/* Generate Start Condition */
+  PORT_USI &= ~(1<<PIN_USI_SDA);                    // Force SDA LOW.
+  _delay_us( T4_TWI/4 );                         
+  PORT_USI &= ~(1<<PIN_USI_SCL);                    // Pull SCL LOW.
+  PORT_USI |= (1<<PIN_USI_SDA);                     // Release SDA.
+
+#ifdef SIGNAL_VERIFY
+  if( !(USISR & (1<<USISIF)) )
+  {
+    USI_TWI_state.errorState = USI_TWI_MISSING_START_CON;  
+    return (FALSE);
+  }
+#endif
+
+/*Write address and Read/Write data */
+  do
+  {
+    /* If masterWrite cycle (or inital address tranmission)*/
+    if (USI_TWI_state.addressMode || USI_TWI_state.masterWriteDataMode)
+    {
+      /* Write a byte */
+      PORT_USI &= ~(1<<PIN_USI_SCL);                // Pull SCL LOW.
+      USIDR     = *(msg++);                        // Setup data.
+      USI_TWI_Master_Transfer( tempUSISR_8bit );    // Send 8 bits on bus.
+      
+      /* Clock and verify (N)ACK from slave */
+      DDR_USI  &= ~(1<<PIN_USI_SDA);                // Enable SDA as input.
+      if( USI_TWI_Master_Transfer( tempUSISR_1bit ) & (1<<TWI_NACK_BIT) ) 
+      {
+        if ( USI_TWI_state.addressMode )
+          USI_TWI_state.errorState = USI_TWI_NO_ACK_ON_ADDRESS;
+        else
+          USI_TWI_state.errorState = USI_TWI_NO_ACK_ON_DATA;
+        return (FALSE);
+      }
+      USI_TWI_state.addressMode = FALSE;            // Only perform address transmission once.
+    }
+    /* Else masterRead cycle*/
+    else
+    {
+      /* Read a data byte */
+      DDR_USI   &= ~(1<<PIN_USI_SDA);               // Enable SDA as input.
+      *(msg++)  = USI_TWI_Master_Transfer( tempUSISR_8bit );
+
+      /* Prepare to generate ACK (or NACK in case of End Of Transmission) */
+      if( msgSize == 1)                            // If transmission of last byte was performed.
+      {
+        USIDR = 0xFF;                              // Load NACK to confirm End Of Transmission.
+      }
+      else
+      {
+        USIDR = 0x00;                              // Load ACK. Set data register bit 7 (output for SDA) low.
+      }
+      USI_TWI_Master_Transfer( tempUSISR_1bit );   // Generate ACK/NACK.
+    }
+  }while( --msgSize) ;                             // Until all data sent/received.
+  
+  USI_TWI_Master_Stop();                           // Send a STOP condition on the TWI bus.
+
+/* Transmission successfully completed*/
+  return (TRUE);
+}
+
+/*---------------------------------------------------------------
+ Core function for shifting data in and out from the USI.
+ Data to be sent has to be placed into the USIDR prior to calling
+ this function. Data read, will be return'ed from the function.
+---------------------------------------------------------------*/
+unsigned char USI_TWI_Master_Transfer( unsigned char temp )
+{
+  USISR = temp;                                     // Set USISR according to temp.
+                                                    // Prepare clocking.
+  temp  =  (0<<USISIE)|(0<<USIOIE)|                 // Interrupts disabled
+           (1<<USIWM1)|(0<<USIWM0)|                 // Set USI in Two-wire mode.
+           (1<<USICS1)|(0<<USICS0)|(1<<USICLK)|     // Software clock strobe as source.
+           (1<<USITC);                              // Toggle Clock Port.
+  do
+  {
+    _delay_us( T2_TWI/4 );              
+    USICR = temp;                          // Generate positve SCL edge.
+    while( !(PIN_USI & (1<<PIN_USI_SCL)) );// Wait for SCL to go high.
+    _delay_us( T4_TWI/4 );              
+    USICR = temp;                          // Generate negative SCL edge.
+  }while( !(USISR & (1<<USIOIF)) );        // Check for transfer complete.
+  
+  _delay_us( T2_TWI/4 );                
+  temp  = USIDR;                           // Read out data.
+  USIDR = 0xFF;                            // Release SDA.
+  DDR_USI |= (1<<PIN_USI_SDA);             // Enable SDA as output.
+
+  return temp;                             // Return the data from the USIDR
+}
+
+/*---------------------------------------------------------------
+ Function for generating a TWI Stop Condition. Used to release 
+ the TWI bus.
+---------------------------------------------------------------*/
+unsigned char USI_TWI_Master_Stop( void )
+{
+  PORT_USI &= ~(1<<PIN_USI_SDA);           // Pull SDA low.
+  PORT_USI |= (1<<PIN_USI_SCL);            // Release SCL.
+  while( !(PIN_USI & (1<<PIN_USI_SCL)) );  // Wait for SCL to go high.
+  _delay_us( T4_TWI/4 );               
+  PORT_USI |= (1<<PIN_USI_SDA);            // Release SDA.
+  _delay_us( T2_TWI/4 );                
+  
+#ifdef SIGNAL_VERIFY
+  if( !(USISR & (1<<USIPF)) )
+  {
+    USI_TWI_state.errorState = USI_TWI_MISSING_STOP_CON;    
+    return (FALSE);
+  }
+#endif
+
+  return (TRUE);
+}
+
+
+
+unsigned char I2c_WriteByte(unsigned char msg) {
+  unsigned char tempUSISR_8bit = (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Prepare register value to: Clear flags, and
+  (0x0<<USICNT0);                                     // set USI to shift 8 bits i.e. count 16 clock edges.
+  unsigned char tempUSISR_1bit = (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Prepare register value to: Clear flags, and
+  (0xE<<USICNT0);                                     // set USI to shift 1 bit i.e. count 2 clock edges.
+
+	/* Write a byte */
+	PORT_USI &= ~(1<<PIN_USI_SCL);                // Pull SCL LOW.
+	USIDR     = msg;                        // Setup data.
+	USI_TWI_Master_Transfer( tempUSISR_8bit );    // Send 8 bits on bus.
+	/* Clock and verify (N)ACK from slave */
+	DDR_USI  &= ~(1<<PIN_USI_SDA);                // Enable SDA as input.
+	if( USI_TWI_Master_Transfer( tempUSISR_1bit ) & (1<<TWI_NACK_BIT) ){
+		if ( USI_TWI_state.addressMode )
+			USI_TWI_state.errorState = USI_TWI_NO_ACK_ON_ADDRESS;
+		else
+			USI_TWI_state.errorState = USI_TWI_NO_ACK_ON_DATA;
+		return 2;
+	}
+	return 0;
+}
+unsigned char I2c_ReadByte(unsigned char ack_mode) {
+  unsigned char tempUSISR_8bit = (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Prepare register value to: Clear flags, and
+  (0x0<<USICNT0);                                     // set USI to shift 8 bits i.e. count 16 clock edges.
+  unsigned char tempUSISR_1bit = (1<<USISIF)|(1<<USIOIF)|(1<<USIPF)|(1<<USIDC)|      // Prepare register value to: Clear flags, and
+  (0xE<<USICNT0);                                     // set USI to shift 1 bit i.e. count 2 clock edges.
+	
+	/* Read a data byte */
+	DDR_USI   &= ~(1<<PIN_USI_SDA);               // Enable SDA as input.
+    unsigned char msg = USI_TWI_Master_Transfer( tempUSISR_8bit );
+
+    /* Prepare to generate ACK (or NACK in case of End Of Transmission) */
+    if( ack_mode == NO_ACK) {                           // If transmission of last byte was performed.
+		USIDR = 0xFF;                              // Load NACK to confirm End Of Transmission.
+    } else   {
+		USIDR = 0x00;                              // Load ACK. Set data register bit 7 (output for SDA) low.
+    }
+    USI_TWI_Master_Transfer( tempUSISR_1bit );   // Generate ACK/NACK.
+	return msg;
+}
+
+void I2c_StartCondition(void) {
+/* Release SCL to ensure that (repeated) Start can be performed */
+PORT_USI |= (1<<PIN_USI_SCL);                     // Release SCL.
+while( !(PIN_USI & (1<<PIN_USI_SCL)) );          // Verify that SCL becomes high.
+#ifdef TWI_FAST_MODE
+_delay_us( T4_TWI/4 );                         // Delay for T4TWI if TWI_FAST_MODE
+#else
+_delay_us( T2_TWI/4 );                         // Delay for T2TWI if TWI_STANDARD_MODE
+#endif
+
+/* Generate Start Condition */
+PORT_USI &= ~(1<<PIN_USI_SDA);                    // Force SDA LOW.
+_delay_us( T4_TWI/4 );
+PORT_USI &= ~(1<<PIN_USI_SCL);                    // Pull SCL LOW.
+PORT_USI |= (1<<PIN_USI_SDA);                     // Release SDA.
+	
+	
+}
+void I2c_StopCondition(void) {
+	USI_TWI_Master_Stop();
+}
+
+#endif
+
+
+
+
+#if defined(__AVR_ATmega328PB__)| defined(__AVR_ATmega328P__)
+
+
+#include <util/twi.h>
+
+void TWI_Wait_Busy() {
+	_delay_us(100);
+	while (!( TWCR & (1<<TWINT) )); 
+}
+
+
+void TWI_Master_Initialise( void ) {
+	TWBR = TWI_TWBR;                                  // Set bit rate register (Baud rate). Defined in header file.Driver presumes prescaler to be 00.
	TWSR=0;
	TWDR = 0xFF;                                      // Default content = SDA released.
	TWCR = (1<<TWEN)|                                 // Enable TWI-interface and release TWI pins.
		(0<<TWIE)|(0<<TWINT)|                      // Disable Interrupt.
		(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)|           // No Signal requests.
		(0<<TWWC);
+		
+}
+
+unsigned char I2c_WriteByte(unsigned char msg) {
+	uint8_t   twst;
	TWDR = msg;
	TWCR = (1<<TWINT) | (1<<TWEN);
	TWI_Wait_Busy();
	 // check value of TWI Status Register. Mask prescaler bits
	 twst = TW_STATUS & 0xF8;
	 if( twst != TW_MT_DATA_ACK) return 1;
	return 0;
+}
+unsigned char I2c_ReadByte(unsigned char ack_mode) {
+	TWCR = (1<<TWINT) | (1<<TWEN) |ack_mode;
	TWI_Wait_Busy();
    return TWDR;
+
+}
+void I2c_StartCondition(void) {
+	TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
+	TWI_Wait_Busy();
+	uint8_t twst = TW_STATUS & 0xF8;
	if ( (twst != TW_START) && (twst != TW_REP_START)) return ;// return 1;
}
+/*

+// send device address

+TWDR = address;

+TWCR = (1<<TWINT) | (1<<TWEN);

+

+// wail until transmission completed and ACK/NACK has been received

+while(!(TWCR & (1<<TWINT)));

+

+// check value of TWI Status Register. Mask prescaler bits.

+twst = TW_STATUS & 0xF8;

+if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;

+

+return 0;

+
+}
+*/
+void I2c_StopCondition(void) {
+
+   TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);

+   while(TWCR & (1<<TWSTO));
+
+}
+
+#endif
\ No newline at end of file
diff --git a/common/I2C/TWI_Master.h b/common/I2C/TWI_Master.h
new file mode 100644
index 0000000..327b2a5
--- /dev/null
+++ b/common/I2C/TWI_Master.h
@@ -0,0 +1,147 @@
+#ifndef TWI_MASTER_H
+#define TWI_MASTER_H
+#include<avr/io.h> 
+//********** Defines **********//
+
+// Defines controlling timing limits
+#define TWI_FAST_MODE
+#ifdef  __4MHZ__
+#define SYS_CLK  4000.0  // [kHz]
+#else
+#define SYS_CLK   8000.0  // [kHz]
+#endif
+
+
+
+#ifdef TWI_FAST_MODE               // TWI FAST mode timing limits. SCL = 100-400kHz
+  #define T2_TWI    ((SYS_CLK *1300) /1000000) +1 // >1,3us
+  #define T4_TWI    ((SYS_CLK * 600) /1000000) +1 // >0,6us
+  
+#else                              // TWI STANDARD mode timing limits. SCL <= 100kHz
+  #define T2_TWI    ((SYS_CLK *4700) /1000000) +1 // >4,7us
+  #define T4_TWI    ((SYS_CLK *4000) /1000000) +1 // >4,0us
+#endif
+
+// Defines controling code generating
+//#define PARAM_VERIFICATION
+//#define NOISE_TESTING
+//#define SIGNAL_VERIFY
+
+//USI_TWI messages and flags and bit masks
+//#define SUCCESS   7
+//#define MSG       0
+/****************************************************************************
+  Bit and byte definitions
+****************************************************************************/
+#define TWI_READ_BIT  0       // Bit position for R/W bit in "address byte".
+#define TWI_ADR_BITS  1       // Bit position for LSB of the slave address bits in the init byte.
+#define TWI_NACK_BIT  0       // Bit position for (N)ACK bit.
+
+#define USI_TWI_NO_DATA             0x00  // Transmission buffer is empty
+#define USI_TWI_DATA_OUT_OF_BOUND   0x01  // Transmission buffer is outside SRAM space
+#define USI_TWI_UE_START_CON        0x02  // Unexpected Start Condition
+#define USI_TWI_UE_STOP_CON         0x03  // Unexpected Stop Condition
+#define USI_TWI_UE_DATA_COL         0x04  // Unexpected Data Collision (arbitration)
+#define USI_TWI_NO_ACK_ON_DATA      0x05  // The slave did not acknowledge  all data
+#define USI_TWI_NO_ACK_ON_ADDRESS   0x06  // The slave did not acknowledge  the address
+#define USI_TWI_MISSING_START_CON   0x07  // Generated Start Condition not detected on bus
+#define USI_TWI_MISSING_STOP_CON    0x08  // Generated Stop Condition not detected on bus
+
+// Device dependant defines
+
+#if defined(__AVR_AT90Mega169__) | defined(__AVR_ATmega169PA__) | \
+    defined(__AVR_AT90Mega165__) | defined(__AVR_ATmega165__) | \
+    defined(__AVR_ATmega325__) | defined(__AVR_ATmega3250__) | \
+    defined(__AVR_ATmega645__) | defined(__AVR_ATmega6450__) | \
+    defined(__AVR_ATmega329__) | defined(__AVR_ATmega3290__) | \
+    defined(__AVR_ATmega649__) | defined(__AVR_ATmega6490__)
+    #define DDR_USI             DDRE
+    #define PORT_USI            PORTE
+    #define PIN_USI             PINE
+    #define PORT_USI_SDA        PORTE5
+    #define PORT_USI_SCL        PORTE4
+    #define PIN_USI_SDA         PINE5
+    #define PIN_USI_SCL         PINE4
+#endif
+
+#if defined(__AVR_ATtiny25__) | defined(__AVR_ATtiny45__) | defined(__AVR_ATtiny85__) | \
+    defined(__AVR_AT90Tiny26__) | defined(__AVR_ATtiny26__)
+    #define DDR_USI             DDRB
+    #define PORT_USI            PORTB
+    #define PIN_USI             PINB
+    #define PORT_USI_SDA        PORTB0
+    #define PORT_USI_SCL        PORTB2
+    #define PIN_USI_SDA         PINB0
+    #define PIN_USI_SCL         PINB2
+#endif
+
+#if defined(__AVR_AT90Tiny2313__) | defined(__AVR_ATtiny2313__)
+    #define DDR_USI             DDRB
+    #define PORT_USI            PORTB
+    #define PIN_USI             PINB
+    #define PORT_USI_SDA        PORTB5
+    #define PORT_USI_SCL        PORTB7
+    #define PIN_USI_SDA         PINB5
+    #define PIN_USI_SCL         PINB7
+#endif
+
+#if defined(__AVR_ATtiny84__) | defined(__AVR_ATtiny84A__)
+#define DDR_USI             DDRA
+#define PORT_USI            PORTA
+#define PIN_USI             PINA
+#define PORT_USI_SDA        PORTA6
+#define PORT_USI_SCL        PORTA4
+#define PIN_USI_SDA         PINA6
+#define PIN_USI_SCL         PINA4
+#endif
+
+
+//****************** ATMEGA TWI without USI
+#define TWI_BUFFER_SIZE 4   // Set this to the largest message size that will be sent including address byte.
+#define TWI_TWBR         0x4C; //  0x0C         // TWI Bit rate Register setting.
// Se Application note for detailed
// information on setting this value.

+
+
+
+#define ACK (1<<TWI_NACK_BIT )
+#define NO_ACK 0
+
+
+
+#if  defined(__AVR_ATmega328PB__)
+#undef ACK
+#define ACK  (1<<TWEA)
+
+#define TWBR TWBR0
+#define TWSR TWSR0
+#define TWCR TWCR0
+#define TWDR TWDR0
+#define TW_STATUS_MASK		(_BV(TWS7)|_BV(TWS6)|_BV(TWS5)|_BV(TWS4)|_BV(TWS3))
+#define TW_STATUS		(TWSR_R & TW_STATUS_MASK)
+
+#endif
+
+#if defined(__AVR_ATmega328P__)
+#undef ACK
+#define ACK  (1<<TWEA)
+
+#define TW_STATUS_MASK		(_BV(TWS7)|_BV(TWS6)|_BV(TWS5)|_BV(TWS4)|_BV(TWS3))
+#define TW_STATUS		(TWSR_R & TW_STATUS_MASK)
+
+
+#endif
+
+// General defines
+#define TRUE  1
+#define FALSE 0
+
+
+//********** Prototypes **********//
+
+void TWI_Master_Initialise( void );
+
+unsigned char I2c_WriteByte(unsigned char msg);
+unsigned char I2c_ReadByte(unsigned char ack_mode);
+void I2c_StartCondition(void);
+void I2c_StopCondition(void);
+
+#endif
\ No newline at end of file
diff --git a/common/I2C/USI_TWI_Master.c b/common/I2C/USI_TWI_Master.c
index d5f2596..9aaf21d 100644
--- a/common/I2C/USI_TWI_Master.c
+++ b/common/I2C/USI_TWI_Master.c
@@ -26,9 +26,14 @@
 *                     success of the transmission.
 *
 ****************************************************************************/
+
+#ifdef  __4MHZ__
+#define F_CPU 4000000UL
+#else
 #define F_CPU 8000000UL
+#endif
 #include <avr/io.h>
-#include "USI_TWI_Master.h"
+#include "TWI_Master.h"
 #include <util/delay.h>
 
 unsigned char USI_TWI_Master_Transfer( unsigned char );
diff --git a/common/I2C/USI_TWI_Master.h b/common/I2C/USI_TWI_Master.h
index d6b1f85..19f3e88 100644
--- a/common/I2C/USI_TWI_Master.h
+++ b/common/I2C/USI_TWI_Master.h
@@ -121,12 +121,23 @@
 #define PIN_USI_SCL         PINA4
 #endif
 
+
+#if defined(__AVR_ATmega328__) | defined(__AVR_ATmega328P__) | defined(__AVR_ATmega328PB__)
+#define DDR_USI             DDRC
+#define PORT_USI            PORTC
+#define PIN_USI             PINC
+#define PORT_USI_SDA        PORTC4
+#define PORT_USI_SCL        PORTC5
+#define PIN_USI_SDA         PINC4
+#define PIN_USI_SCL         PINC5
+#endif
+
 // General defines
 #define TRUE  1
 #define FALSE 0
 
-#define ACK (1<<TWI_NACK_BIT )
-#define NO_ACK 0
+//#define ACK (1<<TWI_NACK_BIT )
+//#define NO_ACK 0
 
 
 //********** Prototypes **********//
diff --git a/common/OWCRC8_16.s b/common/OWCRC8_16.s
new file mode 100644
index 0000000..0518dfe
--- /dev/null
+++ b/common/OWCRC8_16.s
@@ -0,0 +1,105 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+
+.comm crc16,2
+.comm crc8,2
+#define _CRC8_16_
+
+CRC16_alg:
+	;crc
+	
+	lds r_crc,crc16;lade low byte fuer vergleich mit bit
+	mov r_temp,r_crc
+	andi r_temp,0x01 ;nur bit 0
+	cp r_temp2,r_temp  ;r_temp2 wird in interruptroutine gesetzt
+	brne crc2_16 ;nur schieben
+	;schieben und XOR
+	lds r_temp2,crc16+1
+	lsr	r_temp2
+	ror	r_crc
+	ldi	r_temp, 0x01	
+	eor	r_crc, r_temp
+	ldi	r_temp, 0xA0	;
+	eor	r_temp2, r_temp
+	rjmp crce_16
+crc2_16:
+	lds r_temp2,crc16+1
+	lsr	r_temp2
+	ror	r_crc
+crce_16:
+	sts crc16,r_crc
+	sts crc16+1,r_temp2
+	
+	ret
+
+.macro CRCS ; CRC beim Senden
+	push r_crc
+	push r_temp2
+	rcall CRC16_alg
+	pop r_temp2
+		;crc
+	lds r_crc,crc8
+	mov r_temp,r_crc
+	andi r_temp,0x01
+	cp r_temp2,r_temp
+	brne crc2_8
+	lsr r_crc
+	ldi r_temp,0x8c
+	eor r_crc,r_temp
+	rjmp crce_8
+crc2_8:
+	lsr r_crc
+crce_8:
+	sts crc8,r_crc
+	pop r_crc
+.endm
+
+.macro CRCR; CRC beim Empfangen
+	;clr r_temp2
+	;sbrc r_rwbyte,7
+	;ldi r_temp2,1
+	push r_crc
+	rcall CRC16_alg
+	pop r_crc
+.endm
+
+.macro CRCInit1; CRC initialisierung bei READ_COMMAND
+	ldi r_temp,0
+	sts crc16,r_temp
+	sts crc16+1,r_temp
+.endm
+
+.macro CRCInit2; CRC initialisierung bei READ_DATA
+	ldi r_temp,0
+	sts crc8,r_temp
+.endm
diff --git a/common/OWConfig.s b/common/OWConfig.s
index 8b8928f..41ba41b 100644
--- a/common/OWConfig.s
+++ b/common/OWConfig.s
@@ -90,7 +90,11 @@
 #if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__)||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
 #include "../common/OWSet_ATTINYX4.s"
 #endif
- 
+
+#if  defined(__AVR_ATmega168__)||defined(__AVR_ATmega168A__) ||defined(__AVR_ATmega328__) ||defined(__AVR_ATmega328P__) ||defined(__AVR_ATmega328PB__) 
+#include "../common/OWSet_ATMEGA168.s"
+#endif 
+
 #if  defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)  || defined(__AVR_ATtiny85__)
 #include "../common/OWSet_ATTINYX5.s"
 #endif
diff --git a/common/OWDS18B20_DS18B20.S b/common/OWDS18B20_DS18B20.S
new file mode 100644
index 0000000..e3c7eda
--- /dev/null
+++ b/common/OWDS18B20_DS18B20.S
@@ -0,0 +1,392 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+#define _HANDLE_CC_COMMAND_
+//#define  __4MHZ__
+//#define _DB_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC8.s"
+
+.extern pack1,8
+
+.extern pack2,8
+
+
+
+.comm block,1 ; Block der augegeben, geschrieben wird (Parameter von READ/WRITE Scratchpad)
+.comm cpsp,1 ; Copy Scratchpad marker
+
+
+.macro CHIP_INIT 	;r_temp is pushed other Registers should be saved
+	ldi r_temp,0
+	sts cpsp,r_temp
+Init_EEPROM_read:
+	push r_bytep
+	push r_rwbyte
+	sbic _SFR_IO_ADDR(EECR), EEPE
+	rjmp Init_EEPROM_read
+	ldi r_temp,0
+	out _SFR_IO_ADDR(EEARH), r_temp
+	ldi r_temp,2
+	out _SFR_IO_ADDR(EEARL), r_temp
+	sbi _SFR_IO_ADDR(EECR), EERE
+	in r_temp,_SFR_IO_ADDR(EEDR)
+	sbrs r_temp,7
+	rcall hrc_recall_eeprom_func1
+	pop r_rwbyte
+	pop r_bytep
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readscratchpad1
+		rjmp h_writescratchpad1
+		rjmp h_convert_run1
+		rjmp h_readscratchpad2
+		rjmp h_writescratchpad2
+		rjmp h_convert_run2
+.endm
+
+#include "../common/OWRomFunctionsDual.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_SCRATCHPAD1 OW_FIRST_COMMAND+0
+#define OW_WRITE_SCRATCHPAD1 OW_FIRST_COMMAND+1
+#define OW_CONVERT_RUN1  OW_FIRST_COMMAND+2
+#define OW_READ_SCRATCHPAD2 OW_FIRST_COMMAND+3
+#define OW_WRITE_SCRATCHPAD2 OW_FIRST_COMMAND+4
+#define OW_CONVERT_RUN2  OW_FIRST_COMMAND+5
+
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+#ifdef _HANDLE_CC_COMMAND_
+h_readcommand12:
+	clr r_bytep
+	cjmp 0x44,hrc_set_convertT12
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+#endif
+
+
+h_readcommand1:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cjmp 0xBE,hrc_set_readscratchpad1
+	cjmp 0x4E,hrc_set_writescratchpad1
+	cjmp 0x44,hrc_set_convertT1
+	cjmp 0x48,hrc_copy_scratchpad1
+	cjmp 0xB8,hrc_recall_eeprom1
+	FW_CONFIG_INFO1
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+hrc_set_readscratchpad1:
+	ldi r_mode,OW_READ_SCRATCHPAD1
+	ldi r_sendflag,1
+	CRCInit2
+	rjmp h_readscratchpad1
+
+hrc_set_writescratchpad1:
+	ldi r_mode,OW_WRITE_SCRATCHPAD1
+	ldi r_bytep,2 ;start to write in 2
+	rjmp handle_end
+
+hrc_recall_eeprom1:
+	rcall hrc_recall_eeprom_func1
+	rjmp handle_end
+
+#ifdef _HANDLE_CC_COMMAND_
+hrc_set_convertT12:
+	ldi r_temp,3
+	sts gcontrol,r_temp
+	rjmp hrc_set_convertT12b  //egal ob hrc_set_convertT12b oder hrc_set_convertT22b
+#endif
+
+hrc_set_convertT1:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+hrc_set_convertT12b:
+	ldi r_mode,OW_CONVERT_RUN1
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run1:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+hrc_copy_scratchpad1:
+	ldi r_bytep,2
+	configZ pack1,r_bytep
+	clr r_bytep
+hrc_copy_scratchpad_EEPROM_write1:
+	sbic _SFR_IO_ADDR(EECR), EEPE	
+	rjmp hrc_copy_scratchpad_EEPROM_write1
+	ldi r_temp, (0<<EEPM1)|(0<<EEPM0)
+	out _SFR_IO_ADDR(EECR), r_temp
+	ldi r_temp,0
+	out _SFR_IO_ADDR(EEARH),r_temp
+	out _SFR_IO_ADDR(EEARL), r_bytep
+	ld  r_rwbyte,Z+
+	out _SFR_IO_ADDR(EEDR), r_rwbyte
+	sbi _SFR_IO_ADDR(EECR), EEMPE
+	sbi _SFR_IO_ADDR(EECR), EEPE
+	inc r_bytep
+	cpi r_bytep,3
+	brne hrc_copy_scratchpad_EEPROM_write1
+	rjmp handle_end
+
+
+hrc_recall_eeprom_func1:
+	ldi r_bytep,2
+	configZ pack1,r_bytep
+	clr r_bytep
+	clr r_temp
+hrc_recall_eeprom_EEPROM_read1:
+	sbic _SFR_IO_ADDR(EECR), EEPE
+	rjmp hrc_recall_eeprom_EEPROM_read1
+	out _SFR_IO_ADDR(EEARH), r_temp
+	out _SFR_IO_ADDR(EEARL), r_bytep
+	sbi _SFR_IO_ADDR(EECR), EERE
+	in r_rwbyte,_SFR_IO_ADDR(EEDR)
+	st Z+,r_rwbyte
+	inc r_bytep
+	cpi r_bytep,3
+	brne hrc_recall_eeprom_EEPROM_read1
+	ret
+
+
+
+
+
+
+;---------------------------------------------------
+;   READ SCRATCHPAD
+;---------------------------------------------------
+
+h_readscratchpad1:
+	cpi  r_bytep,8
+	breq h_readscratchpad_crc1
+	cpi  r_bytep,9
+	breq h_readscratchpad_all1
+	configZ pack1,r_bytep
+	ld   r_rwbyte,Z
+	rjmp h_readscratchpad_endc1
+h_readscratchpad_crc1:
+	lds  r_rwbyte,crc
+h_readscratchpad_endc1:
+	inc  r_bytep
+	ldi  r_bcount,1 
+	rjmp handle_end
+h_readscratchpad_all1:
+	rjmp handle_end_sleep
+
+
+
+
+
+;---------------------------------------------------
+;   WRITE SCRATCHPAD
+;---------------------------------------------------
+
+h_writescratchpad1:
+	configZ pack1,r_bytep
+	inc  r_bytep
+	cpi  r_bytep,5
+	breq h_writescratchpad_all1
+	st   Z,r_rwbyte
+	rjmp handle_end
+h_writescratchpad_all1:
+	;ori r_rwbyte,0x1F ; Alle unteren Bits sind immer 1 -->VOC use different
+	st   Z,r_rwbyte
+	rjmp handle_end_sleep
+
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+
+
+
+h_readcommand2:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cjmp 0xBE,hrc_set_readscratchpad2
+	cjmp 0x4E,hrc_set_writescratchpad2
+	cjmp 0x44,hrc_set_convertT2
+	cjmp 0x48,hrc_copy_scratchpad2
+	cjmp 0xB8,hrc_recall_eeprom2
+	FW_CONFIG_INFO2
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+hrc_set_readscratchpad2:
+	ldi r_mode,OW_READ_SCRATCHPAD2
+	ldi r_sendflag,1
+	CRCInit2
+	rjmp h_readscratchpad2
+
+hrc_set_writescratchpad2:
+	ldi r_mode,OW_WRITE_SCRATCHPAD2
+	ldi r_bytep,2 ;start to write in 2
+	rjmp handle_end
+
+hrc_recall_eeprom2:
+	rcall hrc_recall_eeprom_func2
+	rjmp handle_end
+
+hrc_set_convertT2:
+	ldi r_temp,1
+	sts gcontrol,r_temp
+hrc_set_convertT22b:
+	ldi r_mode,OW_CONVERT_RUN2
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run2:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+hrc_copy_scratchpad2:
+	ldi r_bytep,2
+	configZ pack2,r_bytep
+	clr r_bytep
+hrc_copy_scratchpad_EEPROM_write2:
+	sbic _SFR_IO_ADDR(EECR), EEPE	
+	rjmp hrc_copy_scratchpad_EEPROM_write2
+	ldi r_temp, (0<<EEPM1)|(0<<EEPM0)
+	out _SFR_IO_ADDR(EECR), r_temp
+	ldi r_temp,0
+	out _SFR_IO_ADDR(EEARH),r_temp
+	out _SFR_IO_ADDR(EEARL), r_bytep
+	ld  r_rwbyte,Z+
+	out _SFR_IO_ADDR(EEDR), r_rwbyte
+	sbi _SFR_IO_ADDR(EECR), EEMPE
+	sbi _SFR_IO_ADDR(EECR), EEPE
+	inc r_bytep
+	cpi r_bytep,3
+	brne hrc_copy_scratchpad_EEPROM_write2
+	rjmp handle_end
+
+
+hrc_recall_eeprom_func2:
+	ldi r_bytep,2
+	configZ pack2,r_bytep
+	//clr r_bytep
+	ldi r_bytep,8
+	clr r_temp
+hrc_recall_eeprom_EEPROM_read2:
+	sbic _SFR_IO_ADDR(EECR), EEPE
+	rjmp hrc_recall_eeprom_EEPROM_read2
+	out _SFR_IO_ADDR(EEARH), r_temp
+	out _SFR_IO_ADDR(EEARL), r_bytep
+	sbi _SFR_IO_ADDR(EECR), EERE
+	in r_rwbyte,_SFR_IO_ADDR(EEDR)
+	st Z+,r_rwbyte
+	inc r_bytep
+	cpi r_bytep,3
+	brne hrc_recall_eeprom_EEPROM_read2
+	ret
+
+
+
+
+
+
+;---------------------------------------------------
+;   READ SCRATCHPAD
+;---------------------------------------------------
+
+h_readscratchpad2:
+	cpi  r_bytep,8
+	breq h_readscratchpad_crc2
+	cpi  r_bytep,9
+	breq h_readscratchpad_all2
+	configZ pack2,r_bytep
+	ld   r_rwbyte,Z
+	rjmp h_readscratchpad_endc2
+h_readscratchpad_crc2:
+	lds  r_rwbyte,crc
+h_readscratchpad_endc2:
+	inc  r_bytep
+	ldi  r_bcount,1 
+	rjmp handle_end
+h_readscratchpad_all2:
+	rjmp handle_end_sleep
+
+
+
+
+
+;---------------------------------------------------
+;   WRITE SCRATCHPAD
+;---------------------------------------------------
+
+h_writescratchpad2:
+	configZ pack2,r_bytep
+	inc  r_bytep
+	cpi  r_bytep,5
+	breq h_writescratchpad_all2
+	st   Z,r_rwbyte
+	rjmp handle_end
+h_writescratchpad_all2:
+	;ori r_rwbyte,0x1F ; Alle unteren Bits sind immer 1 -->VOC use different
+	st   Z,r_rwbyte
+	rjmp handle_end_sleep
+
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
diff --git a/common/OWDS18B20_DS2408.S b/common/OWDS18B20_DS2408.S
new file mode 100644
index 0000000..3b7802a
--- /dev/null
+++ b/common/OWDS18B20_DS2408.S
@@ -0,0 +1,456 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+#define _HANDLE_CC_COMMAND_
+#include "../common/OWConfig.s"
+#include "../common/OWCRC8_16.s"
+
+.extern pack1,8
+
+.extern pack2,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+.comm stat_to_sample,1
+
+.comm block,1 ; Block der augegeben, geschrieben wird (Parameter von READ/WRITE Scratchpad)
+.comm cpsp,1 ; Copy Scratchpad marker
+
+.macro CHIP_INIT 	;r_temp is pushed other Registers should be saved
+	ldi r_temp,0
+	sts cpsp,r_temp
+Init_EEPROM_read:
+	push r_bytep
+	push r_rwbyte
+	sbic _SFR_IO_ADDR(EECR), EEPE
+	rjmp Init_EEPROM_read
+	ldi r_temp,0
+	out _SFR_IO_ADDR(EEARH), r_temp
+	ldi r_temp,2
+	out _SFR_IO_ADDR(EEARL), r_temp
+	sbi _SFR_IO_ADDR(EECR), EERE
+	in r_temp,_SFR_IO_ADDR(EEDR)
+	sbrs r_temp,7
+	rcall hrc_recall_eeprom_func1
+	pop r_rwbyte
+	pop r_bytep
+.endm
+
+
+.macro COMMAND_TABLE
+		rjmp h_readscratchpad1
+		rjmp h_writescratchpad1
+		rjmp h_convert_run1
+		rjmp h_readpioregaddr2
+		rjmp h_readpioreg2
+		rjmp h_readpioregcrc12
+		rjmp h_readpioregcrc22
+		rjmp h_readchanel2
+		rjmp h_readchanel_crc2
+		rjmp h_writechanel2
+		rjmp h_writecomchanel2
+		rjmp h_writesendaa2
+		rjmp h_writesendchanel2
+		rjmp h_resetactivity2
+		rjmp h_writeregaddr2
+		rjmp h_writereg2
+.endm
+
+#include "../common/OWRomFunctionsDual.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+
+#define OW_READ_SCRATCHPAD1 OW_FIRST_COMMAND+0
+#define OW_WRITE_SCRATCHPAD1 OW_FIRST_COMMAND+1
+#define OW_CONVERT_RUN1  OW_FIRST_COMMAND+2
+
+#define OW_READ_PIO_REG_ADDR2 OW_FIRST_COMMAND+3
+#define OW_READ_PIO_REG2 OW_FIRST_COMMAND+4
+#define OW_READ_PIO_REG_CRC12 OW_FIRST_COMMAND+5
+#define OW_READ_PIO_REG_CRC22 OW_FIRST_COMMAND+6
+#define OW_READ_CHANEL2 OW_FIRST_COMMAND+7
+#define OW_READ_CHANEL_CRC2 OW_FIRST_COMMAND+8
+#define OW_WRITE_CHANEL2 OW_FIRST_COMMAND+9
+#define OW_WRITE_COMCHANEL2 OW_FIRST_COMMAND+10
+#define OW_WRITE_SENDAA2 OW_FIRST_COMMAND+11
+#define OW_WRITE_SEND_CHANEL2 OW_FIRST_COMMAND+12
+#define OW_RESET_ACTIVITY2 OW_FIRST_COMMAND+13
+#define OW_WRITE_REG_ADDR2 OW_FIRST_COMMAND+14
+#define OW_WRITE_REG2 OW_FIRST_COMMAND+15
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+#ifdef _HANDLE_CC_COMMAND_
+h_readcommand12:
+	clr r_bytep
+	cjmp 0x44,hrc_set_convertT12
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+#endif
+
+
+h_readcommand1:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cjmp 0xBE,hrc_set_readscratchpad1
+	cjmp 0x4E,hrc_set_writescratchpad1
+	cjmp 0x44,hrc_set_convertT1
+	cjmp 0x48,hrc_copy_scratchpad1
+	cjmp 0xB8,hrc_recall_eeprom1
+	FW_CONFIG_INFO1
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+hrc_set_readscratchpad1:
+	ldi r_mode,OW_READ_SCRATCHPAD1
+	ldi r_sendflag,1
+	CRCInit2
+	rjmp h_readscratchpad1
+
+hrc_set_writescratchpad1:
+	ldi r_mode,OW_WRITE_SCRATCHPAD1
+	ldi r_bytep,2 ;start to write in 2
+	rjmp handle_end
+
+hrc_recall_eeprom1:
+	rcall hrc_recall_eeprom_func1
+	rjmp handle_end
+
+#ifdef _HANDLE_CC_COMMAND_
+hrc_set_convertT12:
+	rjmp hrc_set_convertT1
+#endif
+
+hrc_set_convertT1:
+	ldi r_temp,16
+	sts gcontrol,r_temp
+hrc_set_convertT12b:
+	ldi r_mode,OW_CONVERT_RUN1
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run1:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount	
+
+
+
+hrc_copy_scratchpad1:
+	ldi r_bytep,2
+	configZ pack1,r_bytep
+	clr r_bytep
+hrc_copy_scratchpad_EEPROM_write1:
+	sbic _SFR_IO_ADDR(EECR), EEPE	
+	rjmp hrc_copy_scratchpad_EEPROM_write1
+	ldi r_temp, (0<<EEPM1)|(0<<EEPM0)
+	out _SFR_IO_ADDR(EECR), r_temp
+	ldi r_temp,0
+	out _SFR_IO_ADDR(EEARH),r_temp
+	out _SFR_IO_ADDR(EEARL), r_bytep
+	ld  r_rwbyte,Z+
+	out _SFR_IO_ADDR(EEDR), r_rwbyte
+	sbi _SFR_IO_ADDR(EECR), EEMPE
+	sbi _SFR_IO_ADDR(EECR), EEPE
+	inc r_bytep
+	cpi r_bytep,3
+	brne hrc_copy_scratchpad_EEPROM_write1
+	rjmp handle_end
+
+
+hrc_recall_eeprom_func1:
+	ldi r_bytep,2
+	configZ pack1,r_bytep
+	clr r_bytep
+	clr r_temp
+hrc_recall_eeprom_EEPROM_read1:
+	sbic _SFR_IO_ADDR(EECR), EEPE
+	rjmp hrc_recall_eeprom_EEPROM_read1
+	out _SFR_IO_ADDR(EEARH), r_temp
+	out _SFR_IO_ADDR(EEARL), r_bytep
+	sbi _SFR_IO_ADDR(EECR), EERE
+	in r_rwbyte,_SFR_IO_ADDR(EEDR)
+	st Z+,r_rwbyte
+	inc r_bytep
+	cpi r_bytep,3
+	brne hrc_recall_eeprom_EEPROM_read1
+	ret
+
+
+
+
+
+
+;---------------------------------------------------
+;   READ SCRATCHPAD
+;---------------------------------------------------
+
+h_readscratchpad1:
+	cpi  r_bytep,8
+	breq h_readscratchpad_crc1
+	cpi  r_bytep,9
+	breq h_readscratchpad_all1
+	configZ pack1,r_bytep
+	ld   r_rwbyte,Z
+	rjmp h_readscratchpad_endc1
+h_readscratchpad_crc1:
+	lds  r_rwbyte,crc8
+h_readscratchpad_endc1:
+	inc  r_bytep
+	ldi  r_bcount,1 
+	rjmp handle_end
+h_readscratchpad_all1:
+	rjmp handle_end_sleep
+
+
+
+
+
+;---------------------------------------------------
+;   WRITE SCRATCHPAD
+;---------------------------------------------------
+
+h_writescratchpad1:
+	configZ pack1,r_bytep
+	inc  r_bytep
+	cpi  r_bytep,5
+	breq h_writescratchpad_all1
+	st   Z,r_rwbyte
+	rjmp handle_end
+h_writescratchpad_all1:
+	;ori r_rwbyte,0x1F ; Alle unteren Bits sind immer 1 -->VOC use different
+	st   Z,r_rwbyte
+	rjmp handle_end_sleep
+
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+h_readcommand2:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xF0,OW_READ_PIO_REG_ADDR2
+	cljmp 0xF5,hrc_readchanel2
+	cset 0x5A,OW_WRITE_CHANEL2
+	cljmp 0xC3,hrc_reset_activity2
+	cset 0xCC,OW_WRITE_REG_ADDR2
+	FW_CONFIG_INFO2
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readpioregaddr2:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readpioreg_addr_byte12 ;nein dann weiter
+	//andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	subi r_rwbyte,0x89  ;beim lesen von 0x88 --> 0xFF inc addr -> 0x00
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readpioreg_addr_byte12:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_PIO_REG2 ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+h_readpioreg2:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	cpi r_bytep,0x08
+	breq h_readpioreg_init_crc2
+	brge h_readpioreg_end2 ; groeser dann nix senden
+	configZ pack2,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readpioreg_init_crc2:; init erstes CRC byte
+	lds r_rwbyte,crc16
+	com r_rwbyte
+	lds r_temp,crc16+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_PIO_REG_CRC12
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readpioreg_end2:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readpioregcrc12:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_PIO_REG_CRC22
+	rjmp handle_end
+h_readpioregcrc22: ; 2. CRC Byte gesendet
+	rjmp h_readpioreg_end2
+
+
+hrc_readchanel2:
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	ldi r_mode,OW_READ_CHANEL2
+	ldi r_temp,8
+	sts gcontrol,r_temp
+	rjmp h_readchanel12
+h_readchanel2:
+	ldi r_temp,4
+	sts gcontrol,r_temp
+h_readchanel12:
+	cpi r_bytep,31
+	brge h_readchanelcrc12
+	lds r_rwbyte,stat_to_sample
+	sts pack2,r_rwbyte //sample 
+	rjmp handle_end_inc
+h_readchanelcrc12:
+	lds r_rwbyte,crc16
+	com r_rwbyte
+	lds r_temp,crc16+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_CHANEL_CRC2
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readchanel_crc2:
+	clr r_bytep
+	ldi r_mode,OW_READ_CHANEL2
+	lds r_rwbyte,crcsave
+	rjmp handle_end
+	
+h_writechanel2:
+	sts crcsave,r_rwbyte
+	ldi r_mode,OW_WRITE_COMCHANEL2
+	rjmp handle_end
+h_writecomchanel2:
+	com r_rwbyte
+	lds r_temp,crcsave
+	cp r_rwbyte,r_temp
+	breq h_writeok2
+	rjmp handle_end_sleep
+h_writeok2:
+	sts pack2+1,r_rwbyte
+	ldi r_temp2,1
+	sts gcontrol,r_temp2
+	clr r_sendflag
+	ldi r_rwbyte,0xAA
+	ldi r_mode,OW_WRITE_SENDAA2
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	rjmp handle_end
+h_writesendaa2:
+	lds r_rwbyte,pack2
+	ldi r_mode,OW_WRITE_SEND_CHANEL2
+	rjmp handle_end
+h_writesendchanel2:
+	rjmp handle_end_sleep
+
+
+
+hrc_reset_activity2:
+	ldi r_temp,2
+	sts gcontrol,r_temp
+	ldi r_rwbyte,0xAA
+	ldi r_mode,OW_RESET_ACTIVITY2
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	rjmp handle_end
+h_resetactivity2:
+	rjmp handle_end_sleep
+
+
+h_writeregaddr2:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writeregddr_byte12 ;nein dann weiter
+	//andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	subi r_rwbyte,0x8B  
+	brmi h_writereg_end2
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_writeregddr_byte12:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_REG2 ;weiter zu write Memory
+	;;ldi r_bcount,1 ;ist unten
+	clr r_bytep
+	rjmp handle_end
+h_writereg2:
+	lds r_temp,addr
+	configZ pack2+3,r_temp
+	st Z,r_rwbyte
+	cpi r_temp,5
+	brge h_writereg_end2
+	inc r_temp
+	sts addr,r_temp
+	rjmp handle_end_sleep
+		
+h_writereg_end2:
+	rjmp handle_end_sleep
+
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/common/OWDS18B20_DS2438.S b/common/OWDS18B20_DS2438.S
index 73fd42e..a95559e 100644
--- a/common/OWDS18B20_DS2438.S
+++ b/common/OWDS18B20_DS2438.S
@@ -34,7 +34,8 @@
 #define _CHANGEABLE_ID_
 #define _ZERO_POLLING_
 #define _HANDLE_CC_COMMAND_
-		
+#define _NO_BOOTLOADER_PIN_	
+//#define  __4MHZ__
 //#define _DB_
 
 #include "../common/OWConfig.s"
@@ -42,15 +43,14 @@
 
 .extern pack1,8
 
-//.extern  am2302_temp,2
-
 #if  defined(__AVR_ATtiny25__)
 .extern pack2,16
 #else
 .extern pack2,64
 #endif
-//.extern  am2302_temp,2
-//.extern  am2302_hum,2
+
+
+
 .comm block,1 ; Block der augegeben, geschrieben wird (Parameter von READ/WRITE Scratchpad)
 .comm cpsp,1 ; Copy Scratchpad marker
 
@@ -110,8 +110,9 @@ Init_EEPROM_read:
 h_readcommand12:
 	clr r_bytep
 	cjmp 0x44,hrc_set_convertT12
-	ldi r_mode,OW_SLEEP
-	rjmp handle_end
+	rjmp h_readcccommand  ;fuehre DS2438 commands aus...
+	//ldi r_mode,OW_SLEEP
+	//rjmp handle_end
 #endif
 
 
@@ -120,9 +121,10 @@ h_readcommand1:
 #ifndef _DIS_FLASH_
 	FLASH_COMMANDS ; muss zu erst sein....
 #endif
+	cjmp 0x44,hrc_set_convertT1
+h_readcccommand:
 	cjmp 0xBE,hrc_set_readscratchpad1
 	cjmp 0x4E,hrc_set_writescratchpad1
-	cjmp 0x44,hrc_set_convertT1
 	cjmp 0x48,hrc_copy_scratchpad1
 	cjmp 0xB8,hrc_recall_eeprom1
 	FW_CONFIG_INFO1
@@ -151,9 +153,9 @@ hrc_recall_eeprom1:
 hrc_set_convertT12:
 	ldi r_temp,3
 	sts gcontrol,r_temp
-	lds r_temp,am2302_temp
+	lds r_temp,DS2438_2_TEMP
 	sts pack2+1,r_temp
-	lds r_temp,am2302_temp+1
+	lds r_temp,DS2438_2_TEMP+1
 	sts pack2+2,r_temp
 	rjmp hrc_set_convertT12b
 #endif
@@ -288,26 +290,28 @@ h_readcommand2:
 hrc_set_convertT2:
 	ldi r_temp,2
 	sts gcontrol,r_temp
-	lds r_temp,am2302_temp
+	lds r_temp,DS2438_2_TEMP
 	sts pack2+1,r_temp
-	lds r_temp,am2302_temp+1
+	lds r_temp,DS2438_2_TEMP+1
 	sts pack2+2,r_temp
 	rjmp handle_end_sleep
 hrc_set_convertV2:
+	ldi r_temp,4
+	sts gcontrol,r_temp
 	lds r_temp,pack2
 	sbrs r_temp,3
 	rjmp hrc_set_convertVV2
-	ldi r_temp,0xF4
+	lds r_temp,DS2438_2_VDD
 	sts pack2+3,r_temp
-	ldi r_temp,0x01
+	lds r_temp,DS2438_2_VDD+1
 	sts pack2+4,r_temp
 	rjmp hrc_set_convertend2
 hrc_set_convertVV2:
-	ldi r_temp,3
+	ldi r_temp,8
 	sts gcontrol,r_temp
-	lds r_temp,am2302_hum
+	lds r_temp,DS2438_2_VAD
 	sts pack2+3,r_temp
-	lds r_temp,am2302_hum+1
+	lds r_temp,DS2438_2_VAD+1
 	sts pack2+4,r_temp
 hrc_set_convertend2:
 	rjmp handle_end_sleep
diff --git a/common/OWDS2408.S b/common/OWDS2408.S
new file mode 100644
index 0000000..1bad722
--- /dev/null
+++ b/common/OWDS2408.S
@@ -0,0 +1,255 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack,8
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+.comm stat_to_sample,1
+
+
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readpioregaddr
+		rjmp h_readpioreg
+		rjmp h_readpioregcrc1
+		rjmp h_readpioregcrc2
+		rjmp h_readchanel
+		rjmp h_readchanel_crc
+		rjmp h_writechanel
+		rjmp h_writecomchanel
+		rjmp h_writesendaa
+		rjmp h_writesendchanel
+		rjmp h_resetactivity
+		rjmp h_writeregaddr
+		rjmp h_writereg
+.endm
+
+#include "../common/OWRomFunctions.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_PIO_REG_ADDR OW_FIRST_COMMAND+0
+#define OW_READ_PIO_REG OW_FIRST_COMMAND+1
+#define OW_READ_PIO_REG_CRC1 OW_FIRST_COMMAND+2
+#define OW_READ_PIO_REG_CRC2 OW_FIRST_COMMAND+3
+#define OW_READ_CHANEL OW_FIRST_COMMAND+4
+#define OW_READ_CHANEL_CRC OW_FIRST_COMMAND+5
+#define OW_WRITE_CHANEL OW_FIRST_COMMAND+6
+#define OW_WRITE_COMCHANEL OW_FIRST_COMMAND+7
+#define OW_WRITE_SENDAA OW_FIRST_COMMAND+8
+#define OW_WRITE_SEND_CHANEL OW_FIRST_COMMAND+9
+#define OW_RESET_ACTIVITY OW_FIRST_COMMAND+10
+#define OW_WRITE_REG_ADDR OW_FIRST_COMMAND+11
+#define OW_WRITE_REG OW_FIRST_COMMAND+12
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xF0,OW_READ_PIO_REG_ADDR
+	cljmp 0xF5,hrc_readchanel
+	cset 0x5A,OW_WRITE_CHANEL
+	cljmp 0xC3,hrc_reset_activity
+	cset 0xCC,OW_WRITE_REG_ADDR
+	FW_CONFIG_INFO
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readpioregaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readpioreg_addr_byte1 ;nein dann weiter
+	//andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	subi r_rwbyte,0x89  ;beim lesen von 0x88 --> 0xFF inc addr -> 0x00
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readpioreg_addr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_PIO_REG ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+h_readpioreg:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	cpi r_bytep,0x08
+	breq h_readpioreg_init_crc
+	brge h_readpioreg_end ; groeser dann nix senden
+	configZ pack,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readpioreg_init_crc:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_PIO_REG_CRC1
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readpioreg_end:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readpioregcrc1:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_PIO_REG_CRC2
+	rjmp handle_end
+h_readpioregcrc2: ; 2. CRC Byte gesendet
+	rjmp h_readpioreg_end
+
+
+hrc_readchanel:
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	ldi r_mode,OW_READ_CHANEL
+	ldi r_temp,8
+	sts gcontrol,r_temp
+	rjmp h_readchanel1
+h_readchanel:
+	ldi r_temp,4
+	sts gcontrol,r_temp
+h_readchanel1:
+	cpi r_bytep,31
+	brge h_readchanelcrc1
+	lds r_rwbyte,stat_to_sample
+	sts pack,r_rwbyte //sample 
+	rjmp handle_end_inc
+h_readchanelcrc1:
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_CHANEL_CRC
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readchanel_crc:
+	clr r_bytep
+	ldi r_mode,OW_READ_CHANEL
+	lds r_rwbyte,crcsave
+	rjmp handle_end
+	
+h_writechanel:
+	sts crcsave,r_rwbyte
+	ldi r_mode,OW_WRITE_COMCHANEL
+	rjmp handle_end
+h_writecomchanel:
+	com r_rwbyte
+	lds r_temp,crcsave
+	cp r_rwbyte,r_temp
+	breq h_writeok
+	rjmp handle_end_sleep
+h_writeok:
+	sts pack+1,r_rwbyte
+	ldi r_temp2,1
+	sts gcontrol,r_temp2
+	clr r_sendflag
+	ldi r_rwbyte,0xAA
+	ldi r_mode,OW_WRITE_SENDAA
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	rjmp handle_end
+h_writesendaa:
+	lds r_rwbyte,pack
+	ldi r_mode,OW_WRITE_SEND_CHANEL
+	rjmp handle_end
+h_writesendchanel:
+	rjmp handle_end_sleep
+
+
+
+hrc_reset_activity:
+	ldi r_temp,2
+	sts gcontrol,r_temp
+	ldi r_rwbyte,0xAA
+	ldi r_mode,OW_RESET_ACTIVITY
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	rjmp handle_end
+h_resetactivity:
+	rjmp handle_end_sleep
+
+
+h_writeregaddr:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writeregddr_byte1 ;nein dann weiter
+	//andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	subi r_rwbyte,0x8B  
+	brmi h_writereg_end
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_writeregddr_byte1:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_REG ;weiter zu write Memory
+	;;ldi r_bcount,1 ;ist unten
+	clr r_bytep
+	rjmp handle_end
+h_writereg:
+	lds r_temp,addr
+	configZ pack+3,r_temp
+	st Z,r_rwbyte
+	cpi r_temp,5
+	brge h_writereg_end	
+	inc r_temp
+	sts addr,r_temp
+	rjmp handle_end_sleep
+		
+h_writereg_end:
+	rjmp handle_end_sleep
+
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/common/OWDS2413_DS2413.S b/common/OWDS2413_DS2413.S
new file mode 100644
index 0000000..df6d04b
--- /dev/null
+++ b/common/OWDS2413_DS2413.S
@@ -0,0 +1,248 @@
+
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+//#define _HANDLE_CC_COMMAND_
+//#define _DB_
+//#define __4MHZ__
+        
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pin_state1,1
+.extern pin_state1,1
+.extern pin_state2,1
+.extern pin_set2,1
+.comm resv1,1
+.comm resv2,1
+.macro CHIP_INIT 	;r_temp is pushed other Registers should be saved
+.endm
+
+.macro COMMAND_TABLE
+
+		rjmp h_accessread1
+		rjmp h_accesswrite1
+		rjmp h_accesswrite_read1
+
+		rjmp h_accessread2
+		rjmp h_accesswrite2
+		rjmp h_accesswrite_read2
+.endm
+
+#include "../common/OWRomFunctionsDual.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_ACCESSREAD1 OW_FIRST_COMMAND+0
+#define OW_ACCESSWRITE1 OW_FIRST_COMMAND+1
+#define OW_ACCESSWRITE_READ1 OW_FIRST_COMMAND+2
+
+
+#define OW_ACCESSREAD2 OW_FIRST_COMMAND+3
+#define OW_ACCESSWRITE2 OW_FIRST_COMMAND+4
+#define OW_ACCESSWRITE_READ2 OW_FIRST_COMMAND+5
+
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+h_readcommand1:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cjmp 0xF5,hrc_accessread1
+	cset 0x5A,OW_ACCESSWRITE1
+/*	cset 0xBE,OW_READ_SCRATCHPAD_ADR2
+	cset 0x4E,OW_WRITE_SCRATCHPAD_ADR2
+	cjmp 0x44,hrc_set_convertT2
+	cjmp 0xB4,hrc_set_convertV2*/
+	FW_CONFIG_INFO1
+	//cljmp 0x85,hrc_fw_configinfo2
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	rjmp handle_end_sleep
+
+
+hrc_accessread1:
+	ldi r_sendflag,1
+	ldi r_mode,OW_ACCESSREAD1
+h_accessread1:
+	lds r_temp,pin_state1
+	andi r_temp,0x0F
+	mov r_rwbyte,r_temp
+	com r_rwbyte
+	swap r_rwbyte
+	andi r_rwbyte,0xF0
+	or r_rwbyte,r_temp
+	rjmp handle_end
+
+
+
+
+h_accesswrite_read1:
+	//lds r_rwbyte,pin_state1
+	rjmp handle_end_sleep
+	
+
+
+h_accesswrite1:
+	cpi  r_bytep,1
+	breq h_accesswrite_compl1
+	sts resv1,r_rwbyte
+	rjmp handle_end_inc
+h_accesswrite_compl1:
+	com r_rwbyte
+	lds r_temp,resv1
+	cp r_temp,r_rwbyte
+	brne h_accesswrite_error1
+	sts  pin_set1,r_rwbyte
+	ldi r_mode,OW_ACCESSWRITE_READ1
+	ldi r_rwbyte,0xAA
+	ldi r_sendflag,1
+	rjmp handle_end_inc
+h_accesswrite_error1:
+	rjmp handle_end_sleep
+
+
+
+
+
+
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+
+
+h_readcommand2:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cjmp 0xF5,hrc_accessread2
+	cset 0x5A,OW_ACCESSWRITE2
+/*	cset 0xBE,OW_READ_SCRATCHPAD_ADR2
+	cset 0x4E,OW_WRITE_SCRATCHPAD_ADR2
+	cjmp 0x44,hrc_set_convertT2
+	cjmp 0xB4,hrc_set_convertV2*/
+	FW_CONFIG_INFO2
+	//cljmp 0x85,hrc_fw_configinfo2
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	rjmp handle_end_sleep
+
+
+hrc_accessread2:
+	ldi r_sendflag,1
+	ldi r_mode,OW_ACCESSREAD2
+h_accessread2:
+	lds r_temp,pin_state2
+	andi r_temp,0x0F
+	mov r_rwbyte,r_temp
+	com r_rwbyte
+	swap r_rwbyte
+	andi r_rwbyte,0xF0
+	or r_rwbyte,r_temp
+	rjmp handle_end
+
+
+
+
+h_accesswrite_read2:
+	//lds r_rwbyte,pin_state2
+	rjmp handle_end_sleep
+	
+
+
+h_accesswrite2:
+	cpi  r_bytep,1
+	breq h_accesswrite_compl2
+	sts resv2,r_rwbyte
+	rjmp handle_end_inc
+h_accesswrite_compl2:
+	com r_rwbyte
+	lds r_temp,resv2
+	cp r_temp,r_rwbyte
+	brne h_accesswrite_error2
+	sts  pin_set2,r_rwbyte
+	ldi r_mode,OW_ACCESSWRITE_READ2
+	ldi r_rwbyte,0xAA
+	ldi r_sendflag,1
+	rjmp handle_end_inc
+h_accesswrite_error2:
+	rjmp handle_end_sleep
+/*
+;---------------------------------------------------
+;   WRITE SCRATCHPAD
+;---------------------------------------------------
+h_writescratchpad_adr2:
+	lsl r_rwbyte
+	lsl r_rwbyte
+	lsl r_rwbyte
+#if  defined(__AVR_ATtiny25__)
+	andi r_rwbyte,0x01 ;nur Page 0 und 1 und das immer wiederholen
+#endif
+	sts block,r_rwbyte
+	ldi r_mode,OW_WRITE_SCRATCHPAD2
+	ldi  r_bcount,1 
+	rjmp handle_end	
+h_writescratchpad2:
+	cpi  r_bytep,8
+	breq h_writescratchpad_all2
+	lds  r_temp,block
+	add  r_temp,r_bytep
+	configZ pack2,r_temp
+	st   Z,r_rwbyte
+	rjmp handle_end_inc
+h_writescratchpad_all2:
+	rjmp handle_end_sleep
+
+
+
+
+
+
+	*/
+
+
+#include "../common/OWPinInterrupt.s"
+.end
diff --git a/common/OWDS2438_DS2438.S b/common/OWDS2438_DS2438.S
index 2d2c891..78b51c1 100644
--- a/common/OWDS2438_DS2438.S
+++ b/common/OWDS2438_DS2438.S
@@ -31,9 +31,14 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+#ifndef _NOCHANGEABLE_ID_
 #define _CHANGEABLE_ID_
+#endif
 #define _ZERO_POLLING_
 #define _HANDLE_CC_COMMAND_
+#define _NO_BOOTLOADER_PIN_	
+//#define __4MHZ__
+
 //#define _DB_
 
 #include "../common/OWConfig.s"
@@ -139,9 +144,9 @@ chrc_set_convertV1:
 	lds r_temp,pack1
 	sbrs r_temp,3
 	rjmp hrc_set_convertVV1
-	ldi r_temp,0xF4  //5V
+	lds r_temp,DS2438_1_VDD  
 	sts pack1+3,r_temp
-	ldi r_temp,0x01
+	lds r_temp,DS2438_1_VDD+1
 	sts pack1+4,r_temp
 	rjmp hrc_set_convertend1
 hrc_set_convertVV1:
@@ -284,9 +289,9 @@ chrc_set_convertV2:
 	lds r_temp,pack2
 	sbrs r_temp,3
 	rjmp hrc_set_convertVV2
-	ldi r_temp,0xF4
+	lds r_temp,DS2438_2_VDD  
 	sts pack2+3,r_temp
-	ldi r_temp,0x01
+	lds r_temp,DS2438_2_VDD+1
 	sts pack2+4,r_temp
 	rjmp hrc_set_convertend2
 hrc_set_convertVV2:
diff --git a/common/OWDS2450_DS2423.S b/common/OWDS2450_DS2423.S
new file mode 100644
index 0000000..f4ca4f5
--- /dev/null
+++ b/common/OWDS2450_DS2423.S
@@ -0,0 +1,548 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack1,20
+.extern pack2,45
+.extern counters2,16
+//Bleiben gleich denn es werden nicht beide gleichzeitig abgefragt
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+.comm gcontrol1,1
+.comm gcontrol2,1
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr1
+		rjmp h_readmemory1
+		rjmp h_readmemorycrc11
+		rjmp h_readmemorycrc21
+		rjmp h_writememoryaddr1
+		rjmp h_writememory1
+		rjmp h_writememorycrc11
+		rjmp h_writememorycrc21
+		rjmp h_writememoryreadback1
+		rjmp h_convert1
+		rjmp h_convertcrc11
+		rjmp h_convertcrc21
+		rjmp h_convert_conv1
+
+		rjmp h_writescratchpad2
+		rjmp h_writescratchpad_crc2
+		rjmp h_readscratchpad2
+		rjmp h_copyscratchpad2
+		rjmp h_readmemory_addr2
+		rjmp h_readmemory2
+		rjmp h_readmemorycounter_addr2
+		rjmp h_readmemorycounter2
+		rjmp h_readmemorycounter_ex2
+.endm
+
+#include "../common/OWRomFunctionsDual.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR1 OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY1 OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC11 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC21 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR1 OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY1 OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC11 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC21 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK1 OW_FIRST_COMMAND+8
+#define OW_CONVERT1 OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC11 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC21 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV1 OW_FIRST_COMMAND+12
+
+#define OW_WRITE_SCRATCHPAD2 OW_FIRST_COMMAND+13
+#define OW_WRITE_SCRATCHPAD_CRC2 OW_FIRST_COMMAND+14
+#define OW_READ_SCRATCHPAD2 OW_FIRST_COMMAND+15
+#define OW_COPY_SCRATCHPAD2 OW_FIRST_COMMAND+16
+#define OW_READ_MEMORY_ADDR2 OW_FIRST_COMMAND+17
+#define OW_READ_MEMORY2 OW_FIRST_COMMAND+18
+#define OW_READ_MEMORYCOUNTER_ADDR2 OW_FIRST_COMMAND+19
+#define OW_READ_MEMORYCOUNTER2 OW_FIRST_COMMAND+20
+#define OW_READ_MEMORYCOUNTER_EX2 OW_FIRST_COMMAND+21
+
+
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand1:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR1
+	cset 0x55,OW_WRITE_MEMORY_ADDR1
+	cset 0x3C,OW_CONVERT1
+	FW_CONFIG_INFO1
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr1:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte11 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte11:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY1 ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory21
+h_readmemory1:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc1
+h_readmemory21:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack1,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc1:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC11
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end1:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc11:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC21
+	rjmp handle_end
+h_readmemorycrc21:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end1; ende des speichers
+	ldi r_mode,OW_READ_MEMORY1
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory21
+
+h_writememoryaddr1:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte11 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte11:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY1 ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory1:
+	lds r_bytep,addr
+	configZ pack1,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC11
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc11:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC21
+	rjmp handle_end
+h_writememorycrc21:
+	lds r_temp,addr
+	configZ pack1,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK1
+	rjmp handle_end
+h_writememoryreadback1:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY1
+	rjmp handle_end
+
+h_convert1:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte11 ;nein dann weiter
+	inc r_bytep
+	sts pack1+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte11: ;zweies byte glesen go crc#
+	sts pack1+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC11
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc11:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC21
+	rjmp handle_end
+h_convertcrc21:
+	ldi r_temp,1
+	sts gcontrol1,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV1
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv1:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount
+
+/////////////////////////////////////////////////////////////////////
+
+
+
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+;*****************************************************************************************************************************************************************************************
+
+
+
+
+h_readcommand2:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0x0F,OW_WRITE_SCRATCHPAD2
+	cjmp 0xAA,hrc_set_readscratchpad2
+	cset 0x5A,OW_COPY_SCRATCHPAD2
+	cset 0xF0,OW_READ_MEMORY_ADDR2
+	cset 0xA5,OW_READ_MEMORYCOUNTER_ADDR2
+	FW_CONFIG_INFO2
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+hrc_set_readscratchpad2:
+	ldi r_mode,OW_READ_SCRATCHPAD2
+	ldi r_sendflag,1
+	rjmp h_readscratchpad2
+
+h_writescratchpad2:
+	configZ pack2,r_bytep
+	inc  r_bytep
+	st   Z,r_rwbyte
+	cpi  r_bytep,2
+	breq h_writescratchpad_block2
+	brsh h_writescratchpad_set_eoffset2 ;;33
+	rjmp handle_end  ;handle_end zu weit entfernt fuer br...
+h_writescratchpad_set_eoffset2:
+	cpi  r_bytep,35
+	breq h_writescratchpad_setcrc2
+	mov r_temp,r_bytep
+	subi r_temp,4
+	sts pack2+2,r_temp ;AA und PF cleared
+	rjmp handle_end
+;Start writeing to 32 Byte Block ; skip status byte	
+h_writescratchpad_block2:
+	lds r_temp,pack2 ; Adresse low byte
+	andi r_temp,0x1F ;32 byte
+	add r_bytep,r_temp ;Zur angegebenen Startadresse springen
+	;ori r_temp,0x20 ; Set PF flag
+	sts pack2+2,r_temp  ;E4:E0 vorher setzen
+	; Byte 3 ueberspringen
+	rjmp handle_end_inc
+
+h_writescratchpad_setcrc2:
+	;copy crc to pack2
+	lds r_temp,crc
+	com r_temp
+	sts pack2+43,r_temp
+	lds r_temp,crc+1
+	com r_temp ; invertieren , komischer name.....
+	sts pack2+44,r_temp
+	ldi  r_mode,OW_WRITE_SCRATCHPAD_CRC2
+	ldi r_sendflag,1
+	ldi r_bytep,43
+h_writescratchpad_crc2:
+	cpi r_bytep,45
+	breq h_writescratchpad_crc_end2
+	configZ pack2,r_bytep
+	ld r_rwbyte,Z
+	rjmp handle_end_inc
+h_writescratchpad_crc_end2:
+	rjmp handle_end_sleep
+	
+	
+h_readscratchpad2:
+	cpi r_bytep,35
+	breq h_readscratchpad_end2
+	cpi r_bytep,3
+	brne h_readscratchpad_read_byte2
+h_readscratchpad_set_offset2:
+	lds r_temp,pack2
+	andi r_temp,0x1F
+	ldi r_temp2,3
+	add r_temp,r_temp2
+	mov r_bytep,r_temp
+h_readscratchpad_read_byte2:
+	configZ pack2,r_bytep
+	ld r_rwbyte,Z
+	rjmp handle_end_inc
+h_readscratchpad_end2:
+	rjmp handle_end_sleep
+
+
+
+h_copyscratchpad2:
+	cpi  r_bytep,3
+	brsh h_copyscratchpad_ok2
+	configZ pack2,r_bytep
+	inc  r_bytep
+	ld   r_temp,Z
+	cp r_temp,r_rwbyte
+	brne h_copyscratchpad_nok2
+	cpi  r_bytep,3
+	breq h_copyscratchpad_ok2
+	ldi  r_bcount,1 
+	rjmp handle_end
+h_copyscratchpad_ok2:
+	ldi r_rwbyte,0xAA
+	ldi r_sendflag,1
+	ldi r_temp,1
+	sts gcontrol2,r_temp
+	rjmp handle_end
+h_copyscratchpad_nok2:
+	lds r_temp,pack2+3
+	andi r_temp,~0x80
+	sts pack2+3,r_temp
+	rjmp handle_end_sleep
+
+
+h_readmemory_addr2:
+	cpi r_bytep,0
+	brne h_readmrmory_addr_byte12
+	sts pack2,r_rwbyte
+	rjmp handle_end_inc
+h_readmrmory_addr_byte12:
+	sts pack2+1,r_rwbyte
+	ldi r_mode,OW_READ_MEMORY2
+	ldi r_sendflag,1
+	clr r_bytep
+	rjmp h_readmemory22
+h_readmemory2:
+	lds r_bytep,pack2
+	lds r_temp2,pack2+1
+	inc r_bytep
+	clr r_temp
+	adc r_temp2,r_temp
+	sbrc r_temp2,1
+	rjmp h_readmemory_end2
+	sts pack2+1,r_temp2
+	sts pack2,r_bytep
+h_readmemory22:
+	ldi  zl,lo8(pack2+45)       
+    ldi  zh,hi8(pack2+45)
+	lds r_bytep,pack2
+	add  zl,r_bytep
+	lds r_bytep,pack2+1
+	adc zh,r_bytep
+	//configZ pack2+3,r_bytep
+	ld   r_rwbyte,Z
+	rjmp handle_end
+h_readmemory_end2:
+	rjmp handle_end_sleep
+
+
+
+
+
+
+
+
+h_readmemorycounter_addr2:
+	cpi r_bytep,0
+	brne h_readmrmorycounter_addr_byte12
+	sts pack2,r_rwbyte
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmrmorycounter_addr_byte12:
+	sts pack2+1,r_rwbyte
+	ldi r_mode,OW_READ_MEMORYCOUNTER2
+	;ldi r_bcount,1 
+	ldi r_sendflag,1
+	clr r_bytep
+	rjmp h_readmemorycounter22
+h_readmemorycounter2:
+	lds r_bytep,pack2
+	lds r_temp2,pack2+1
+	ldi r_temp,1  ;inc leider kein c flag
+	add r_bytep,r_temp
+	clr r_temp
+	adc r_temp2,r_temp
+	mov r_temp,r_bytep
+	andi r_temp,0x1F
+	breq h_readmemorycounter_next2
+	sts pack2+1,r_temp2
+	sts pack2,r_bytep
+h_readmemorycounter22:  ;Lesen von dem worauf die erstenzwei bytes zeigen
+	lds r_bytep,pack2
+	andi r_bytep,0x1F
+	configZ pack2+3,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end
+//h_readmemorycounter_end:
+//	ldi  r_mode,OW_SLEEP
+//	clr r_sendflag
+//	rjmp handle_end
+h_readmemorycounter_next2:  ; rest lesen
+	ldi  r_mode,OW_READ_MEMORYCOUNTER_EX2
+	ldi r_bytep,34
+	lds r_temp2,pack2
+	lds r_temp,pack2+1
+	//lsr r_temp
+	//ror r_temp2
+
+	lsl r_temp2
+	rol r_temp
+	cpi r_temp,3
+	brne h_readmemorycounter_cFF2
+	andi r_temp2,0xC0
+	swap r_temp2
+
+	;cpi r_temp,0xE0
+
+	configZ counters2,r_temp2
+	ld r_temp,Z+
+	sts pack2+35,r_temp	
+	ld r_temp,Z+
+	sts pack2+36,r_temp	
+	ld r_temp,Z+
+	sts pack2+37,r_temp	
+	ld r_temp,Z+
+	sts pack2+38,r_temp	
+	rjmp h_readmemorycounter_ex2
+h_readmemorycounter_cFF2:
+	ldi r_temp,0xFF
+	sts pack2+35,r_temp	
+	sts pack2+36,r_temp	
+	sts pack2+37,r_temp	
+	sts pack2+38,r_temp	
+
+h_readmemorycounter_ex2:
+	inc r_bytep
+	cpi r_bytep,45
+	breq h_readmemorycounter_ex_end2
+	cpi r_bytep,43
+	brne h_readmemorycounter_ex22
+	lds r_temp,crc
+	com r_temp
+	sts pack2+43,r_temp
+	lds r_temp,crc+1
+	com r_temp
+	sts pack2+44,r_temp
+h_readmemorycounter_ex22:
+	;ldi r_bcount,1
+	configZ pack2,r_bytep
+	ld   r_rwbyte,Z
+	rjmp handle_end
+h_readmemorycounter_ex_end2:
+	lds r_bytep,pack2
+	lds r_temp2,pack2+1
+	ldi r_temp,1  ;inc leider kein c flag
+	add r_bytep,r_temp
+	clr r_temp
+	adc r_temp2,r_temp
+	sbrc r_temp2,1 ;am ene von allem 
+	rjmp h_readmemorycounter_ex_sleep2
+	CRCInit1
+	ldi  r_mode,OW_READ_MEMORYCOUNTER2
+	sts pack2+1,r_temp2
+	sts pack2,r_bytep
+	rjmp h_readmemorycounter22
+h_readmemorycounter_ex_sleep2:
+	ldi r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+
+
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/common/OWDS2450_DS2450.S b/common/OWDS2450_DS2450.S
new file mode 100644
index 0000000..bdf354f
--- /dev/null
+++ b/common/OWDS2450_DS2450.S
@@ -0,0 +1,440 @@
+
+// Copyright (c) 2018, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
+
+#include "../common/OWConfig.s"
+#include "../common/OWCRC16.s"
+
+.extern pack1,20
+.extern pack2,20
+
+//Bleiben gleich denn es werden nicht beide gleichzeitig abgefragt
+.comm addr,1 ;zweites Adressbyte ist unnoetig (Warum auch immer fuer 32 Byte 16 Bit Adressen verwendet werden....)
+.comm crcsave,1 ; zwischenspeicherspeicher fuer crc nur zweites byte....
+//.extern  am2302_temp,2
+
+.comm gcontrol1,1
+.comm gcontrol2,1
+
+.macro CHIP_INIT 	
+.endm
+
+.macro COMMAND_TABLE
+		rjmp h_readmemoryaddr1
+		rjmp h_readmemory1
+		rjmp h_readmemorycrc11
+		rjmp h_readmemorycrc21
+		rjmp h_writememoryaddr1
+		rjmp h_writememory1
+		rjmp h_writememorycrc11
+		rjmp h_writememorycrc21
+		rjmp h_writememoryreadback1
+		rjmp h_convert1
+		rjmp h_convertcrc11
+		rjmp h_convertcrc21
+		rjmp h_convert_conv1
+
+		rjmp h_readmemoryaddr2
+		rjmp h_readmemory2
+		rjmp h_readmemorycrc12
+		rjmp h_readmemorycrc22
+		rjmp h_writememoryaddr2
+		rjmp h_writememory2
+		rjmp h_writememorycrc12
+		rjmp h_writememorycrc22
+		rjmp h_writememoryreadback2
+		rjmp h_convert2
+		rjmp h_convertcrc12
+		rjmp h_convertcrc22
+		rjmp h_convert_conv2
+.endm
+
+#include "../common/OWRomFunctionsDual.s"
+#include "../common/OWTimerInterrupt.s"
+
+
+
+; Ab hier Geraeteabhaenging
+#define OW_READ_MEMORY_ADDR1 OW_FIRST_COMMAND+0
+#define OW_READ_MEMORY1 OW_FIRST_COMMAND+1
+#define OW_READ_MEMORY_CRC11 OW_FIRST_COMMAND+2
+#define OW_READ_MEMORY_CRC21 OW_FIRST_COMMAND+3
+#define OW_WRITE_MEMORY_ADDR1 OW_FIRST_COMMAND+4
+#define OW_WRITE_MEMORY1 OW_FIRST_COMMAND+5
+#define OW_WRITE_MEMORY_CRC11 OW_FIRST_COMMAND+6
+#define OW_WRITE_MEMORY_CRC21 OW_FIRST_COMMAND+7
+#define OW_WRITE_MEMORY_READBACK1 OW_FIRST_COMMAND+8
+#define OW_CONVERT1 OW_FIRST_COMMAND+9
+#define OW_CONVERT_CRC11 OW_FIRST_COMMAND+10
+#define OW_CONVERT_CRC21 OW_FIRST_COMMAND+11
+#define OW_CONVERT_CONV1 OW_FIRST_COMMAND+12
+
+#define OW_READ_MEMORY_ADDR2 OW_FIRST_COMMAND+13
+#define OW_READ_MEMORY2 OW_FIRST_COMMAND+14
+#define OW_READ_MEMORY_CRC12 OW_FIRST_COMMAND+15
+#define OW_READ_MEMORY_CRC22 OW_FIRST_COMMAND+16
+#define OW_WRITE_MEMORY_ADDR2 OW_FIRST_COMMAND+17
+#define OW_WRITE_MEMORY2 OW_FIRST_COMMAND+18
+#define OW_WRITE_MEMORY_CRC12 OW_FIRST_COMMAND+19
+#define OW_WRITE_MEMORY_CRC22 OW_FIRST_COMMAND+20
+#define OW_WRITE_MEMORY_READBACK2 OW_FIRST_COMMAND+21
+#define OW_CONVERT2 OW_FIRST_COMMAND+22
+#define OW_CONVERT_CRC12 OW_FIRST_COMMAND+23
+#define OW_CONVERT_CRC22 OW_FIRST_COMMAND+24
+#define OW_CONVERT_CONV2 OW_FIRST_COMMAND+25
+
+
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand1:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR1
+	cset 0x55,OW_WRITE_MEMORY_ADDR1
+	cset 0x3C,OW_CONVERT1
+	FW_CONFIG_INFO1
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr1:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte11 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte11:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY1 ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory21
+h_readmemory1:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc1
+h_readmemory21:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack1,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc1:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC11
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end1:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc11:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC21
+	rjmp handle_end
+h_readmemorycrc21:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end1; ende des speichers
+	ldi r_mode,OW_READ_MEMORY1
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory21
+
+h_writememoryaddr1:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte11 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte11:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY1 ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory1:
+	lds r_bytep,addr
+	configZ pack1,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC11
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc11:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC21
+	rjmp handle_end
+h_writememorycrc21:
+	lds r_temp,addr
+	configZ pack1,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK1
+	rjmp handle_end
+h_writememoryreadback1:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY1
+	rjmp handle_end
+
+h_convert1:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte11 ;nein dann weiter
+	inc r_bytep
+	sts pack1+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte11: ;zweies byte glesen go crc#
+	sts pack1+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC11
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc11:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC21
+	rjmp handle_end
+h_convertcrc21:
+	ldi r_temp,1
+	sts gcontrol1,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV1
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv1:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount
+
+/////////////////////////////////////////////////////////////////////
+
+
+;---------------------------------------------------
+;	READ COMMAND and start operation
+;---------------------------------------------------
+
+
+h_readcommand2:
+	clr r_bytep
+#ifndef _DIS_FLASH_
+	FLASH_COMMANDS ; muss zu erst sein....
+#endif
+	cset 0xAA,OW_READ_MEMORY_ADDR2
+	cset 0x55,OW_WRITE_MEMORY_ADDR2
+	cset 0x3C,OW_CONVERT2
+	FW_CONFIG_INFO2
+#ifdef _CHANGEABLE_ID_
+	CHANGE_ID_COMMANDS
+#endif
+	ldi r_mode,OW_SLEEP
+	rjmp handle_end
+
+
+h_readmemoryaddr2:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_readmemory_addr_byte12 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	rjmp handle_end_inc
+h_readmemory_addr_byte12:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_READ_MEMORY2 ;weiter zu read Memory
+	;;ldi r_bcount,1 ;ist unten
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	clr r_bytep
+	rjmp h_readmemory22
+h_readmemory2:
+	lds r_bytep,addr
+	inc r_bytep
+	sts addr,r_bytep
+	andi r_bytep,0x07
+	breq h_readmemory_init_crc2
+h_readmemory22:
+	lds r_bytep,addr
+	;andi r_bytep,0x1F ist oben
+	configZ pack2,r_bytep
+	ld   r_rwbyte,Z
+	;ldi r_bcount,1
+	rjmp handle_end ;sendet das Byte und geht zu h_readmemory
+h_readmemory_init_crc2:; init erstes CRC byte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_READ_MEMORY_CRC12
+	;ldi r_bcount,1
+	rjmp handle_end
+h_readmemory_end2:
+	ldi  r_mode,OW_SLEEP
+	clr r_sendflag
+	rjmp handle_end
+h_readmemorycrc12:;init zweites CRC Byte
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_READ_MEMORY_CRC22
+	rjmp handle_end
+h_readmemorycrc22:;weiteres senden..... nach zweitem Byte
+	lds r_temp,addr
+	andi r_temp,0xE0
+	brne h_readmemory_end2; ende des speichers
+	ldi r_mode,OW_READ_MEMORY2
+	CRCInit1 ;Start with new CRC
+	rjmp h_readmemory22
+
+h_writememoryaddr2:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_writememory_addr_byte12 ;nein dann weiter
+	andi r_rwbyte,0x1F  ; nur Adressen zwischen 0 und 0x1F zulassen
+	sts addr,r_rwbyte  ;speichern des ersten bytes
+	inc r_bytep
+	;ldi r_bcount,1
+	rjmp handle_end
+h_writememory_addr_byte12:  ;zweiters Addressbyte wird nicht gespeichert!
+	ldi r_mode,OW_WRITE_MEMORY2 ;weiter zu read Memory
+	;ldi r_bcount,1 ;; _________________________________________________in handle_end integrieren.....
+	lds r_bytep,addr
+	rjmp handle_end ;read Memory Byte
+h_writememory2:
+	lds r_bytep,addr
+	configZ pack2,r_bytep
+	st Z,r_rwbyte
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC12
+	ldi r_sendflag,1 ;jetzt sendet der Slave zum Master
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	rjmp handle_end
+h_writememorycrc12:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_CRC22
+	rjmp handle_end
+h_writememorycrc22:
+	lds r_temp,addr
+	configZ pack2,r_temp
+	ld r_rwbyte,Z
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY_READBACK2
+	rjmp handle_end
+h_writememoryreadback2:
+	ldi r_temp,0x00
+	sts crc+1,r_temp
+	lds r_temp,addr
+	inc r_temp
+	sts addr,r_temp
+	sts crc,r_temp
+	ldi r_sendflag,0
+	;ldi r_bcount,1
+	ldi r_mode,OW_WRITE_MEMORY2
+	rjmp handle_end
+
+h_convert2:
+	cpi r_bytep,0  ;erstes Adressbyte ?
+	brne h_convert_byte12 ;nein dann weiter
+	inc r_bytep
+	sts pack2+0x20,r_rwbyte
+	;ldi r_bcount,1
+	rjmp handle_end
+h_convert_byte12: ;zweies byte glesen go crc#
+	sts pack2+0x21,r_rwbyte
+	lds r_rwbyte,crc
+	com r_rwbyte
+	lds r_temp,crc+1
+	com r_temp
+	sts crcsave,r_temp
+	ldi r_mode,OW_CONVERT_CRC12
+	;ldi r_bcount,1
+	ldi r_sendflag,1
+	rjmp handle_end	
+h_convertcrc12:
+	lds r_rwbyte,crcsave
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CRC22
+	rjmp handle_end
+h_convertcrc22:
+	ldi r_temp,1
+	sts gcontrol2,r_temp
+	;ldi r_bcount,1
+	ldi r_mode,OW_CONVERT_CONV2
+	;clr r_sendflag
+	ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv2:
+	ldi r_bcount,0
+	ldi r_rwbyte,0
+	rjmp handle_end_no_bcount
+
+
+
+#include "../common/OWPinInterrupt.s"
+.end
\ No newline at end of file
diff --git a/common/OWPinInterrupt.s b/common/OWPinInterrupt.s
index 69f84f3..7d8a711 100644
--- a/common/OWPinInterrupt.s
+++ b/common/OWPinInterrupt.s
@@ -31,8 +31,8 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
 	
-.global PIN_INTERRIPT  
-PIN_INTERRIPT:
+.global PIN_INTERRUPT  
+PIN_INTERRUPT:
 	;leitung auf Low ziehen
 	TESTZEROMARKER ; ueberspringe wenn zeromarker=0   ;sbic und cbi/sbi andern SREG nicht
 	sbi OW_DDR,OW_PINN  
diff --git a/common/OWRomFunctions.s b/common/OWRomFunctions.s
index fb1d85b..6abeffc 100644
--- a/common/OWRomFunctions.s
+++ b/common/OWRomFunctions.s
@@ -169,11 +169,7 @@ hrc_jmp_flasher:
 	lds r_temp,flashmarker
 	cpi r_temp,2
 	brne hrc_jmp_flasher_inc
-	ldi r_temp,0xC0
-	push r_temp
-	ldi r_temp,0x0E
-	push r_temp
-	ret ; Direkter Sprung zum Bootloader
+	JMP_FLASHER
 hrc_jmp_flasher_inc:
 	inc r_temp
 	sts flashmarker,r_temp
@@ -276,7 +272,7 @@ h_searchroms_next: ; Setup next bit
 
 	configZ owid,r_bcount
 	ld r_rwbyte,Z
-	sts srbyte,r_rwbyte
+	sts srbyte,r_rwbyte ;#################### Doppelung ist schon in h_searchrom_next_bit
 	rjmp h_searchrom_next_bit
 		
 h_searchroms_next_bit: ;next Bit lesen
@@ -316,7 +312,7 @@ h_readrom_all:
 h_fwconfiginfo:
 	cpi  r_bytep,24
 	breq h_fwconfiginfo_crc
-#ifdef _CRC8_
+#if defined(_CRC8_)  || defined( _CRC8_16_) 
 	cpi  r_bytep,25
 	breq h_fwconfiginfo_all
 #elif defined _CRC16_
@@ -446,31 +442,9 @@ spause:
 
 .global OWINIT
 OWINIT:
-#ifndef _DIS_FLASH_
-; check for bootloader jumper
-	;vor allen anderen Registerconfigs
 	push r_temp
-	ldi r_temp,(1<<PUD) ;enable pullup 
-	out _SFR_IO_ADDR(MCUCR) ,r_temp
-	sbi _SFR_IO_ADDR(PORTA),PINA5 ;internal pullup on PINA5
-	sbi _SFR_IO_ADDR(PORTA),PINA4 ;internal pullup on PINA4
-	rcall spause
-	sbis _SFR_IO_ADDR(PINA),PINA5
-	rjmp owinit_botest_end  ;PinA5 nicht auf 1
-  	sbis _SFR_IO_ADDR(PINA),PINA4
-	rjmp owinit_botest_end ;PinA4 nicht auf 1
-	cbi _SFR_IO_ADDR(PORTA),PINA4 
-	sbi _SFR_IO_ADDR(DDRA),PINA4  ;PINA4 AUSGANG und 0
-	rcall spause
-	sbic _SFR_IO_ADDR(PINA),PINA5 
-	rjmp owinit_botest_end ;PINA5 nicht 0.... nicht verbunden
-	cbi _SFR_IO_ADDR(DDRA),PINA4
-	ldi r_temp,0xC0
-	push r_temp
-	ldi r_temp,0x0E
-	push r_temp
-	ret ; Direkter Sprung zum Bootloader*/
-owinit_botest_end:
+#ifndef _DIS_FLASH_
+	CHECK_BOOTLOADER_PIN 
 #endif
 	HW_INIT  //Microcontroller specific
 	CHIP_INIT //1-Wire device specific
diff --git a/common/OWRomFunctionsDual.s b/common/OWRomFunctionsDual.s
index 6f1e709..d4d13d5 100644
--- a/common/OWRomFunctionsDual.s
+++ b/common/OWRomFunctionsDual.s
@@ -105,7 +105,7 @@
 	cljmp 0x85,hrc_fw_configinfo2
 .endm
 
-#ifdef _CHANGEABLE_ID_
+//#ifdef _CHANGEABLE_ID_ //--> ID vom EEPROM lesen auch wenn sie sich nicht ändern laesst
 ; lesen der ID aus dem EEPROM beim Start
 read_EEPROM_ID1:  
 	ldi r_temp2,lo8(E2END)
@@ -139,7 +139,7 @@ read_EEPROM_ID_loop:
 	brne read_EEPROM_ID_loop
 read_EEPROM_ID_end:
 	ret
-#endif
+//#endif
 
 
 
@@ -187,11 +187,7 @@ hrc_jmp_flasher:
 	lds r_temp,flashmarker
 	cpi r_temp,2
 	brne hrc_jmp_flasher_inc
-	ldi r_temp,0xC0
-	push r_temp
-	ldi r_temp,0x0E
-	push r_temp
-	ret ; Direkter Sprung zum Bootloader
+	JMP_FLASHER
 hrc_jmp_flasher_inc:
 	inc r_temp
 	sts flashmarker,r_temp
@@ -426,7 +422,7 @@ h_fwconfiginfo2:
 h_fwconfiginfo_go:
 	cpi  r_bytep,24
 	breq h_fwconfiginfo_crc
-#ifdef _CRC8_
+#if defined(_CRC8_)  || defined( _CRC8_16_) 
 	cpi  r_bytep,25
 	breq h_fwconfiginfo_all
 #elif defined _CRC16_
@@ -587,27 +583,7 @@ OWINIT:
 	;vor allen anderen Registerconfigs
 	push r_temp
 #ifndef _DIS_FLASH_
-	ldi r_temp,(1<<PUD) ;enable pullup 
-	out _SFR_IO_ADDR(MCUCR) ,r_temp
-	sbi _SFR_IO_ADDR(PORTA),PINA5 ;internal pullup on PINA5
-	sbi _SFR_IO_ADDR(PORTA),PINA4 ;internal pullup on PINA4
-	rcall spause
-	sbis _SFR_IO_ADDR(PINA),PINA5
-	rjmp owinit_botest_end  ;PinA5 nicht auf 1
-  	sbis _SFR_IO_ADDR(PINA),PINA4
-	rjmp owinit_botest_end ;PinA4 nicht auf 1
-	cbi _SFR_IO_ADDR(PORTA),PINA4 
-	sbi _SFR_IO_ADDR(DDRA),PINA4  ;PINA4 AUSGANG und 0
-	rcall spause
-	sbic _SFR_IO_ADDR(PINA),PINA5 
-	rjmp owinit_botest_end ;PINA5 nicht 0.... nicht verbunden
-	cbi _SFR_IO_ADDR(DDRA),PINA4
-	ldi r_temp,0xC0
-	push r_temp
-	ldi r_temp,0x0E
-	push r_temp
-	ret ; Direkter Sprung zum Bootloader*/
-owinit_botest_end:
+	CHECK_BOOTLOADER_PIN 
 #endif
 	HW_INIT  //Microcontroller specific
 	CHIP_INIT //1-Wire device specific
@@ -619,10 +595,10 @@ init_idtable:
 	push r_rwbyte
 	push r_idn1
 	push r_idn2
-#ifdef _CHANGEABLE_ID_
+//#ifdef _CHANGEABLE_ID_
 	rcall read_EEPROM_ID1
 	rcall read_EEPROM_ID2
-#endif
+//#endif
 	ldi r_bytep,8
 	ldi r_temp,0
 	ldi  zl,lo8(idtable)
diff --git a/common/OWSet_ATMEGA168.s b/common/OWSet_ATMEGA168.s
new file mode 100644
index 0000000..cae70b5
--- /dev/null
+++ b/common/OWSet_ATMEGA168.s
@@ -0,0 +1,167 @@
+// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de
+// All rights reserved. 
+// 
+// Redistribution and use in source and binary forms, with or without 
+// modification, are permitted provided that the following conditions are 
+// met: 
+// 
+//  * Redistributions of source code must retain the above copyright 
+//    notice, this list of conditions and the following disclaimer. 
+//  * Redistributions in binary form must reproduce the above copyright 
+//    notice, this list of conditions and the following disclaimer in the 
+//    documentation and/or other materials provided with the 
+//    distribution. 
+//  * All advertising materials mentioning features or use of this 
+//    software must display the following acknowledgement: This product 
+//    includes software developed by tm3d.de and its contributors. 
+//  * Neither the name of tm3d.de nor the names of its contributors may 
+//    be used to endorse or promote products derived from this software 
+//    without specific prior written permission. 
+// 
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+
+#define OW_PORT _SFR_IO_ADDR(PORTD) //1 Wire Port
+#define OW_PIN _SFR_IO_ADDR(PIND) //1 Wire Pin as number
+#define OW_PINN PORTD2
+#define OW_DDR _SFR_IO_ADDR(DDRD)  //pin direction register
+
+#define TCNT_REG _SFR_IO_ADDR(TCNT0)
+
+
+#define DB_PORT _SFR_IO_ADDR(PORTB) //DEBUG
+#define DB_PIN _SFR_IO_ADDR(PINB) //DEBUG
+#define DB_DDR _SFR_IO_ADDR(DDRB) //DEBUG
+#define DB_PINN PORTB1
+
+#define SETZEROMARKER sbi _SFR_IO_ADDR(DDRC),6
+#define RESETZEROMARKER cbi _SFR_IO_ADDR(DDRC),6
+#define TESTZEROMARKER sbic _SFR_IO_ADDR(DDRC),6
+
+#ifdef _DB_
+#define sdb sbi _SFR_IO_ADDR(PORTB),DB_PINN
+#define cdb cbi _SFR_IO_ADDR(PORTB),DB_PINN
+#else
+#define sdb
+#define cdb
+#endif
+
+#define TIMER_INTERRUPT TIMER0_OVF_vect
+#define PIN_INTERRUPT INT0_vect
+
+
+//#define OWT_MIN_RESET 160 
+//#define OWT_RESET2 40
+//#define OWT_RESET_PRESENT 15
+//#define OWT_PRESENT 50
+//#define OWT_WRITE 18
+//#define OWT_READ 4
+#ifdef __4MHZ__
+#define OWT_MIN_RESET 80
+#define OWT_RESET2 30
+#define OWT_RESET_PRESENT 15
+#define OWT_PRESENT 60
+#define OWT_WRITE 16
+#define OWT_READ 5
+#define OWT_ZP_WAIT_LOW_TO 36  ; Zeit fuer die Maximale Lowzeit bei der Zerro Polling pruefung. Ist die Leitung laenger low, ist es vieleicht ein Reset 
+#define OWT_ZP_WAIT_HIGH_TO 54 ; Zeit fuer die Maximale Hight zeit bis zu einem Low Impuls vom Master. Nach laengeren Pausen wird nicht mehr gepollt sondern der Interrup vererndet.
+#else
+#define OWT_MIN_RESET 180
+#define OWT_RESET2 80
+#define OWT_RESET_PRESENT 30
+#define OWT_PRESENT 130
+#define OWT_WRITE 35
+#define OWT_READ 12
+#define OWT_ZP_WAIT_LOW_TO 60  ; Zeit fuer die Maximale Lowzeit bei der Zerro Polling pruefung. Ist die Leitung laenger low, ist es vieleicht ein Reset 
+#define OWT_ZP_WAIT_HIGH_TO 90 ; Zeit fuer die Maximale Hight zeit bis zu einem Low Impuls vom Master. Nach laengeren Pausen wird nicht mehr gepollt sondern der Interrup vererndet.
+#endif
+
+.macro CLEAR_TOV_FLAG
+	ldi r_temp,1
+	out _SFR_IO_ADDR(TIFR0),r_temp
+.endm
+
+.macro JMP_NO_TOV
+	in r_temp, _SFR_IO_ADDR(TIFR0)
+	sbrc r_temp,TOV0 ; wenn ueberlauf gleich weiter
+.endm
+
+.macro CLEAR_INTERRUPT_FLAG 
+	ldi r_temp,(1<<INTF0);inerrupt flags durch 1 loeschen..... 0 macht nix
+	out _SFR_IO_ADDR(EIFR),r_temp
+.endm
+
+.macro EN_TIM_INT
+	ldi r_temp,(1<<TOIE0)
+	sts TIMSK0,r_temp
+	ldi r_temp,(1<<TOV0) ;inerrupt flags durch 1 loeschen..... 0 macht nix
+	out _SFR_IO_ADDR(TIFR0),r_temp
+.endm
+
+.macro DIS_TIM_INT
+	ldi r_temp,0
+	sts TIMSK0,r_temp
+.endm
+
+//Wiederherstellen von Idle mode und umschalten von Low-Level interrupt zu Falling edge
+.macro SET_FALLING_RESET_SLEEP
+	lds r_temp,EICRA
+	ori r_temp,(1<<ISC01)
+	sts	EICRA,r_temp
+	lds r_temp,SMCR
+	andi r_temp,~(1<<SM1)
+	sts	SMCR,r_temp
+.endm
+
+.macro HW_INIT  ;r_temp is pushed other Registers should be saved
+	;set clock to 8 MHz
+	ldi r_temp,0x80;
+	sts CLKPR,r_temp
+	//ldi r_temp,(1<<CLKPS0)
+#ifdef __4MHZ__
+	ldi r_temp,0x01;
+#else
+	ldi r_temp,0
+#endif
+	sts CLKPR,r_temp
+	;Disable Timer int
+	ldi r_temp,0
+	sts TIMSK0,r_temp ;; is default
+	;Enable Pin int
+	ldi r_temp,(1<<INT0)
+	out _SFR_IO_ADDR(EIMSK),r_temp
+	;Set Timerclock to Clock / 8 (2us bei 4MHz) bzw 1us bei 8 MHz
+	ldi r_temp,(1<<CS01)
+	out _SFR_IO_ADDR(TCCR0B),r_temp
+	;OWPin as input
+	cbi OW_DDR,OW_PINN ;; is default.... 
+	cbi OW_PORT,OW_PINN ;; vereinfachung im Hauptprogram (PORTB=0xFF) wegen pullup
+	;set falling edge
+	ldi r_temp,(1<<ISC01)
+	sts EICRA,r_temp
+#ifdef _DB_
+	sbi DB_DDR,DB_PINN
+#endif
+.endm
+
+.macro JMP_FLASHER
+	ldi r_temp,0x00
+	push r_temp
+	ldi r_temp,0x3E
+	push r_temp
+	ret ; Direkter Sprung zum Bootloader
+.endm
+
+.macro CHECK_BOOTLOADER_PIN
+.endm
+
diff --git a/common/OWSet_ATTINYX4.s b/common/OWSet_ATTINYX4.s
index b50fde5..c019baf 100644
--- a/common/OWSet_ATTINYX4.s
+++ b/common/OWSet_ATTINYX4.s
@@ -56,7 +56,7 @@
 #endif
 
 #define TIMER_INTERRUPT TIM0_OVF_vect
-#define PIN_INTERRIPT EXT_INT0_vect
+#define PIN_INTERRUPT EXT_INT0_vect
 
 
 //#define OWT_MIN_RESET 160 
@@ -70,7 +70,7 @@
 #define OWT_RESET2 30
 #define OWT_RESET_PRESENT 15
 #define OWT_PRESENT 60
-#define OWT_WRITE 16
+#define OWT_WRITE 15
 #define OWT_READ 5
 #define OWT_ZP_WAIT_LOW_TO 36  ; Zeit fuer die Maximale Lowzeit bei der Zerro Polling pruefung. Ist die Leitung laenger low, ist es vieleicht ein Reset 
 #define OWT_ZP_WAIT_HIGH_TO 54 ; Zeit fuer die Maximale Hight zeit bis zu einem Low Impuls vom Master. Nach laengeren Pausen wird nicht mehr gepollt sondern der Interrup vererndet.
@@ -79,7 +79,7 @@
 #define OWT_RESET2 80
 #define OWT_RESET_PRESENT 30
 #define OWT_PRESENT 130
-#define OWT_WRITE 35
+#define OWT_WRITE 33
 #define OWT_READ 12
 #define OWT_ZP_WAIT_LOW_TO 60  ; Zeit fuer die Maximale Lowzeit bei der Zerro Polling pruefung. Ist die Leitung laenger low, ist es vieleicht ein Reset 
 #define OWT_ZP_WAIT_HIGH_TO 90 ; Zeit fuer die Maximale Hight zeit bis zu einem Low Impuls vom Master. Nach laengeren Pausen wird nicht mehr gepollt sondern der Interrup vererndet.
@@ -151,6 +151,36 @@
 	sbi DB_DDR,DB_PINN
 #endif
 .endm
+.macro JMP_FLASHER
+	ldi r_temp,0xC0
+	push r_temp
+	ldi r_temp,0x0E
+	push r_temp
+	ret ; Direkter Sprung zum Bootloader
+.endm
 
 
+.macro CHECK_BOOTLOADER_PIN  ;r_temp is pushed other Registers should be saved
+; check for bootloader jumper
+	;vor allen anderen Registerconfigs
+#ifndef _NO_BOOTLOADER_PIN_	
+	ldi r_temp,(1<<PUD) ;enable pullup 
+	out _SFR_IO_ADDR(MCUCR) ,r_temp
+	sbi _SFR_IO_ADDR(PORTA),PINA5 ;internal pullup on PINA5
+	sbi _SFR_IO_ADDR(PORTA),PINA4 ;internal pullup on PINA4
+	rcall spause
+	sbis _SFR_IO_ADDR(PINA),PINA5
+	rjmp owinit_botest_end  ;PinA5 nicht auf 1
+  	sbis _SFR_IO_ADDR(PINA),PINA4
+	rjmp owinit_botest_end ;PinA4 nicht auf 1
+	cbi _SFR_IO_ADDR(PORTA),PINA4 
+	sbi _SFR_IO_ADDR(DDRA),PINA4  ;PINA4 AUSGANG und 0
+	rcall spause
+	sbic _SFR_IO_ADDR(PINA),PINA5 
+	rjmp owinit_botest_end ;PINA5 nicht 0.... nicht verbunden
+	cbi _SFR_IO_ADDR(DDRA),PINA4
+	JMP_FLASHER
+owinit_botest_end:
+#endif
+.endm
 
diff --git a/common/calibr.c b/common/calibr.c
index e08d373..c9e5f40 100644
--- a/common/calibr.c
+++ b/common/calibr.c
@@ -20,4 +20,9 @@ double calibr_hum(double temp,double tempdiv,double hum) {
 	 double r=hum*(SDDD(temp,tempdiv)*(tempdiv/(temp+273.15)+1));
 	 if (r>100) return 100.0;
 	return r;
+}
+
+inline double calibr_hum05(double t,double hum) {
+	double y=-0.0006*t*t-0.2455*t-28.5902;
+	return -(hum/y)+hum;
 }
\ No newline at end of file
diff --git a/common/calibr.h b/common/calibr.h
index 2ba627c..bef35d8 100644
--- a/common/calibr.h
+++ b/common/calibr.h
@@ -5,5 +5,4 @@
 
 double calibr_hum(double temp,double tempdiv,double hum);
 
-
 #endif
\ No newline at end of file
diff --git a/common/owSlave_tools.h b/common/owSlave_tools.h
new file mode 100644
index 0000000..3dbba63
--- /dev/null
+++ b/common/owSlave_tools.h
@@ -0,0 +1,187 @@
+#ifndef OWSLAVE_TOOLS_H
+#define OWSLAVE_TOOLS_H
+
+#if  defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+#define OWST_INIT_ALL_OFF \
+	PRR|=(1<<PRUSI)|(1<<PRADC);  /*Switch off usi and adc for save Power*/\
+	ACSR|=(1<<ACD);  /*Disable Comparator*/\
+	ADCSRB|=(1<<ACME); /*Disable Analog multiplexer*/\
+	PORTB|=~(1<<PINB2)|(1<<PORTB0); /*Make PullUp an all Pins but not OW_PIN*/\
+	/*Schalter kann gegen Masse sein und zieht dann immer Strom*/ \
+	DDRB|=(1<<PORTB0); /*Als Ausgang und 0*/\
+	PORTA|=0xFF;
+
+#define OWST_INIT_ADC_ON \
+PRR|=(1<<PRUSI);  /*Switch off usi and adc for save Power*/\
+ACSR|=(1<<ACD);  /*Disable Comparator*/\
+PORTB=~((1<<PINB2)|(1<<PORTB0)); /*Make PullUp an all Pins but not OW_PIN*/\
+/*Schalter kann gegen Masse sein und zieht dann immer Strom*/ \
+DDRB|=(1<<PORTB0); /*Als Ausgang und 0*/\
+PORTA|=0xFF;	
+
+#define OWST_INIT_USI_ON \
+PRR|=(1<<PRADC);  /*Switch off usi and adc for save Power*/\
+ACSR|=(1<<ACD);  /*Disable Comparator*/\
+ADCSRB|=(1<<ACME); /*Disable Analog multiplexer*/\
+PORTB|=~(1<<PINB2)|(1<<PORTB0); /*Make PullUp an all Pins but not OW_PIN*/\
+/*Schalter kann gegen Masse sein und zieht dann immer Strom*/ \
+DDRB|=(1<<PORTB0); /*Als Ausgang und 0*/\
+PORTA|=0xFF;
+
+#define OWST_INIT_ALL_ON \
+PORTB|=~(1<<PINB2)|(1<<PORTB0); /*Make PullUp an all Pins but not OW_PIN*/\
+/*Schalter kann gegen Masse sein und zieht dann immer Strom*/ \
+DDRB|=(1<<PORTB0); /*Als Ausgang und 0*/\
+PORTA|=0xFF;
+
+	
+#define OWST_EN_PULLUP MCUCR &=~(1<<PUD); /*All Pins Pullup...*/
+
+#define OWST_WDT_ISR \
+uint8_t wdcounter=0;\
+ISR(WATCHDOG_vect) {/*	#else ISR(WDT_vect) {		#endif*/\
+		wdcounter++;\
+		if (reset_indicator==1) reset_indicator++;\
+		else if (reset_indicator==2) mode=0;\
+}
+
+#define OWST_WDR_CONFIG8\
+	WDTCSR |= ((1<<WDCE) );   /* Enable the WD Change Bit//| (1<<WDE)*/\
+	WDTCSR |=   (1<<WDIE) |              /* Enable WDT Interrupt*/\
+	(1<<WDP3) | (1<<WDP0);   /*Set Timeout to ~8 seconds*/
+
+#define OWST_WDR_CONFIG4\
+	WDTCSR |= ((1<<WDCE) );   /* Enable the WD Change Bit//| (1<<WDE)*/\
+	WDTCSR |=   (1<<WDIE) |              /* Enable WDT Interrupt*/\
+	(1<<WDP3) ;   /*Set Timeout to ~2 seconds*/
+
+#define OWST_WDR_CONFIG2\
+	WDTCSR |= ((1<<WDCE) );   /* Enable the WD Change Bit//| (1<<WDE)*/\
+	WDTCSR |=   (1<<WDIE) |              /* Enable WDT Interrupt*/\
+	(1<<WDP2) | (1<<WDP1)| (1<<WDP0);   /*Set Timeout to ~1 seconds*/
+
+#define OWST_WDR_CONFIG1\
+	WDTCSR |= ((1<<WDCE) );   /* Enable the WD Change Bit//| (1<<WDE)*/\
+	WDTCSR |=   (1<<WDIE) |              /* Enable WDT Interrupt*/\
+	(1<<WDP2) | (1<<WDP1);   /*Set Timeout to ~1 seconds*/
+
+
+#define OWST_TESTSW \
+	int testSW(void) {\
+		uint8_t r;\
+		DDRB&=~(1<<PORTB0);  /*Eingang*/\
+		__asm__ __volatile__ ("nop");\
+		PORTB|=(1<<PORTB0); /*Pullup*/\
+		__asm__ __volatile__ ("nop");\
+		__asm__ __volatile__ ("nop");\
+		__asm__ __volatile__ ("nop");\
+		__asm__ __volatile__ ("nop");\
+		__asm__ __volatile__ ("nop");\
+		r=PINB&(1<<PORTB0);\
+		__asm__ __volatile__ ("nop");\
+		PORTB&=~(1<<PORTB0);\
+		__asm__ __volatile__ ("nop");\
+		DDRB|=(1<<PORTB0);  /*Eingang*/\
+		return (r==0);\
+	}\
+
+#define OWST_EXTERN_VARS
+extern uint8_t mode;\
+extern uint8_t gcontrol;\
+extern uint8_t reset_indicator;\
+extern uint8_t alarmflag; \
+extern void OWINIT(void);\
+extern void EXTERN_SLEEP(void);\
+
+
+
+#define OWST_MAIN_END \
+	if (((TIMSK0 & (1<<TOIE0))==0)&& (mode==0))	  {\
+		MCUCR|=(1<<SE)|(1<<SM1);\
+		MCUCR&=~(1<<ISC01);\
+	} else {\
+		MCUCR|=(1<<SE);\
+		MCUCR&=~(1<<SM1);\
+	}\
+	asm("SLEEP");
+
+#endif
+
+//********************** AD_WANDLER ********************************
+//******************************************************************
+//clock fuer ADC 50kHz - 200kHz     8M / 128 = 62500   = 4M/64   erste Messng 25 = 0,4ms / zweite Messung 13 rund 0,21ms
+#ifdef __4MHZ__
+#define OWST_INIT_ADC \
+ADCSRA = (1<<ADEN)|(1<<ADPS2)|(1<<ADPS1);
+#else
+#define OWST_INIT_ADC \
+ADCSRA = (1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);
+#endif
+
+#define OWST_ADC_CONF ADCSRA|=(1<<ADSC); while ((ADCSRA&(1<<ADSC)));
+
+#define OWST_ADCREF_VCC 0
+#define OWST_ADCREF_AREF (1<<REFS0)
+#define OWST_ADCREF_INT ((1<<REFS0)|(1<<REFS1))
+
+#define OWST_ADCIN_PA0 0
+#define OWST_ADCIN_PA1 1
+#define OWST_ADCIN_PA2 2
+#define OWST_ADCIN_PA3 3
+#define OWST_ADCIN_PA4 4
+#define OWST_ADCIN_PA5 5
+#define OWST_ADCIN_PA6 6
+#define OWST_ADCIN_PA7 7
+
+
+#if  defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+#define OWST_ADCIN_REFINT 0b0100001
+#endif
+#if  defined(__AVR_ATmega168__)||defined(__AVR_ATmega168A__) ||defined(__AVR_ATmega328__) ||defined(__AVR_ATmega328P__) ||defined(__AVR_ATmega328PB__)
+#define OWST_ADCIN_REFINT 0b00001110
+#endif
+#if  defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__)  || defined(__AVR_ATtiny84__)||defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__)  || defined(__AVR_ATtiny84A__)
+#define AD_PORT PORTA
+#define AD_DDR DDRA
+#endif
+
+#if  defined(__AVR_ATmega168__)||defined(__AVR_ATmega168A__) ||defined(__AVR_ATmega328__) ||defined(__AVR_ATmega328P__) ||defined(__AVR_ATmega328PB__)
+#define AD_PORT PORTC
+#define AD_DDR DDRC
+#endif
+
+#define OWST_ADC_CONF16_FUNC \
+uint16_t owst_ADC_run() {/*14,5ms*/\
+	uint16_t r=0;\
+	for(uint8_t i=0;i<64;i++) {	OWST_ADC_CONF 	r+=ADC;	}\
+	return r;\
+} \
+double owst_ADC_runf() {/*16,5ms*/\
+	double r=0;\
+	for(uint8_t i=0;i<64;i++) {	OWST_ADC_CONF 	r+=ADC;	}\
+	r*=0.9993;\
+	return r;\
+}
+
+#define OWST_ADC_CONF16_OSS_FUNC \
+uint16_t owst_ADC_OSS_run() {/*896ms*/\
+	uint32_t r=0;\
+	for(uint16_t i=0;i<4096;i++) {\
+		OWST_ADC_CONF \
+		r+=ADC;\
+	}\
+	return r>>6;\
+} \
+double owst_ADC_OSS_runf() {/*964ms*/\
+	double r=0;\
+	for(uint16_t i=0;i<4096;i++) {\
+		OWST_ADC_CONF \
+		r+=ADC;\
+	}\
+	r+=5150;\
+	r*=0.9993;\
+	return r/64.0;\
+} 
+
+
+#endif
\ No newline at end of file
diff --git a/programmer/programmer/programmer.asmproj b/programmer/programmer/programmer.asmproj
index 2f55cc1..5a5c1e2 100644
--- a/programmer/programmer/programmer.asmproj
+++ b/programmer/programmer/programmer.asmproj
@@ -25,7 +25,7 @@
     <preserveEEPROM>true</preserveEEPROM>
     <OverrideVtorValue>exception_table</OverrideVtorValue>
     <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>0</eraseonlaunchrule>
+    <eraseonlaunchrule>1</eraseonlaunchrule>
     <AsfFrameworkConfig>
       <framework-data>
         <options />
@@ -38,11 +38,11 @@
         </dependencies>
       </framework-data>
     </AsfFrameworkConfig>
-    <avrtool>com.atmel.avrdbg.tool.avrdragon</avrtool>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
     <com_atmel_avrdbg_tool_atmelice>
       <ToolOptions>
         <InterfaceProperties>
-          <IspClock>100000</IspClock>
+          <IspClock>125000</IspClock>
           <DebugWireClockDiv>0</DebugWireClockDiv>
         </InterfaceProperties>
         <InterfaceName>debugWIRE</InterfaceName>
@@ -51,14 +51,14 @@
       <ToolNumber>J41800000789</ToolNumber>
       <ToolName>Atmel-ICE</ToolName>
     </com_atmel_avrdbg_tool_atmelice>
-    <avrtoolinterface>ISP</avrtoolinterface>
+    <avrtoolinterface>debugWIRE</avrtoolinterface>
     <ExternalProgrammingToolCommand />
-    <avrtoolserialnumber>00A200054127</avrtoolserialnumber>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
     <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
     <com_atmel_avrdbg_tool_avrdragon>
       <ToolOptions>
         <InterfaceProperties>
-          <IspClock>125000</IspClock>
+          <IspClock>0</IspClock>
         </InterfaceProperties>
         <InterfaceName>ISP</InterfaceName>
       </ToolOptions>
diff --git a/programmer/programmer/programmer_8MHz_2017.asm b/programmer/programmer/programmer_8MHz_2017.asm
new file mode 100644
index 0000000..5a51e4e
--- /dev/null
+++ b/programmer/programmer/programmer_8MHz_2017.asm
@@ -0,0 +1,489 @@
+.def srbyte = r12  ;byty for search rom algorithm
+.def writelow = r13;  marker for send low
+.def zero =r14;  always zero 
+.def smode=r15; if 1 then send 
+.def temp = r16 ; 
+.def temp2 = r17; 
+.def mode = r18 ; 
+.def bitp = r19 ; bit counter ... shift...
+.def rwbyte = r21;
+.def param = r22;
+.def bytep = r23  ;byte counter
+#define spmcrval  param
+
+
+.equ OWM_READ_ROM_COMMAND=0 ; 0 wegen schnellen test ist dieser wert 0! Daturch wird die Sprungdabelle nicht verwendet
+.equ OWM_SLEEP=1 ; Warten auf Reset
+.equ OWM_MATCH_ROM=2
+.equ OWM_SEARCH_ROM_S=3  ;send bit
+.equ OWM_SEARCH_ROM_R=4  ;resive master
+.equ OWM_READ_COMMAND=5
+.equ OWM_WRITE_SCRATCHPAD=6
+.equ OWM_READ_SCRATCHPAD=7
+.equ OWM_PROGRAMM_PAGE=8
+.equ OWM_RECALL_FLASH=9
+
+
+.equ OW_DDR = DDRB 
+.equ OW_PIN = PORTB2
+.equ OW_PORT = PORTB 
+.equ OW_PINN = PINB 
+
+;.equ SRAM_START = 0x60
+
+.macro set_clock
+		ldi temp,0x80;
+		out CLKPR,temp
+		ldi temp,@0
+		out CLKPR,temp
+.endmacro 
+
+.macro owwl
+		sbic OW_PINN,OW_PIN
+		rjmp pc-1
+.endmacro 
+
+.macro owwh
+		sbis OW_PINN,OW_PIN
+		rjmp pc-1
+.endmacro 
+
+
+
+
+ ;---------------------------------------------------
+; START of PROG 
+;---------------------------------------------------
+
+
+.CSEG 
+.ORG 0x000
+jreset:
+		rjmp start ; Reset-Vector 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+
+
+.ORG 0x0EC0
+//7552 Byte 
+start: 
+		cli
+		ldi temp,0
+		mov zero,temp
+		set_clock 0x00 ;8mhz
+		ldi mode,OWM_SLEEP
+		ldi temp,(1<<CS01) //1us
+		out TCCR0B,temp
+		ldi temp, HIGH(RAMEND) ; HIGH-Byte der obersten RAM-Adresse 
+		out SPH, temp 
+		ldi temp, LOW(RAMEND) ; LOW-Byte der obersten RAM-Adresse 
+		out SPL, temp 
+		;ldi temp,1
+		;out DDRB,temp
+		clr writelow
+		clr bitp
+	
+		;sbi PORTB,0
+		ldi ZL,low(pro_owid*2) 
+		ldi ZH,high(pro_owid*2) 
+		ldi XL,low(sowid)
+		ldi XH,high(sowid)
+		;ldi temp2,8
+pro_copy_loop: ;copy ID on SRAM for better handling
+		lpm temp,Z+
+		st X+,temp
+		cpi XL,SRAM_START+8
+		brlo pro_copy_loop
+pro_loop:
+		;sbi PORTB,0
+		owwl				;wait for line goes low (polling)
+		sbrs writelow,0		;test of zero send
+		rjmp pro_loop1		;no ? goes next
+		sbi OW_DDR,OW_PIN	;yes pull line to low
+		ldi param,45		;wait for 50 us
+		rcall wait_time
+		clr writelow		;reset write low indecator
+		cbi OW_DDR,OW_PIN   ;release line
+		owwh				;wait for line is high (it can takes some time cause of the capacity of line)
+pro_loop1:
+		tst smode			;smode=1 for slave sends to master
+		breq pro_loop_resv
+pro_loop_send:
+		tst bitp
+		brne pro_loop_send1
+		rcall pro_hb
+		tst smode
+		breq pro_loop_end ; now reading ... do nothing 
+pro_loop_send1:  ;prebare next bit
+		sbrs rwbyte ,0; if bit 0 set in rwbyte then skip next command
+		inc writelow
+		lsl bitp
+		ror rwbyte
+		rjmp pro_loop_end
+
+pro_loop_resv:
+		ldi param,15  ;wait 15us
+		rcall wait_time
+		lsr rwbyte
+		;cbi PORTB,0
+		sbic OW_PINN,OW_PIN  ;test line
+		ori rwbyte,0x80
+		lsl bitp
+		brne pro_loop_end ;no handle need
+		rcall pro_hb
+		tst smode
+		brne pro_loop_send ; Nach dem Gelesen byte koennte gesendet werden muessen....
+pro_loop_end:
+		//owwh
+		out TCNT0,zero
+pro_loop_end_test_reset:
+		sbic OW_PINN,OW_PIN  //leitung wieder high
+		rjmp pro_loop
+		in temp,TCNT0
+		cpi temp,130
+		brlo pro_loop_end_test_reset
+		rcall pro_sleep_s2
+		rjmp pro_loop
+
+
+
+
+pro_sleep:
+		out TCNT0,zero
+pro_sleep_s1:
+		sbic OW_PINN,OW_PIN  //leitung wieder high
+		ret
+		in temp,TCNT0
+		cpi temp,200
+		brlo pro_sleep_s1
+		//leitung wieder high
+pro_sleep_s2:
+		owwh 
+		ldi param,40
+		rcall wait_time
+		//Presents Impuls
+		sbi OW_DDR,OW_PIN
+		ldi param,130
+		rcall wait_time
+		cbi OW_DDR,OW_PIN
+		//init read byte
+		ldi bitp,0x01
+		ldi rwbyte,0
+		clr smode
+		ldi mode,OWM_READ_ROM_COMMAND
+		//Wait for all other devices presents impuls finished
+		ldi param,40
+		rcall wait_time
+		ret
+
+
+
+pro_hb:
+		ldi ZL,low(pro_stable) 
+		ldi ZH,high(pro_stable) 
+		add ZL,mode 
+		adc ZH,zero
+		icall
+		ret
+
+pro_stable: 
+		rjmp pro_read_rom_command
+		rjmp pro_sleep 
+		rjmp pro_match_rom
+		rjmp pro_search_rom_s
+		rjmp pro_search_rom_r
+		rjmp pro_read_command
+		rjmp pro_write_scratchpad
+		rjmp pro_read_scratchpad
+		rjmp pro_programm_page
+		rjmp pro_recall_flash
+
+pro_read_rom_command:
+		ldi mode,OWM_SLEEP
+		cpi rwbyte,0xCC
+		brne pro_rcc_1
+		ldi mode,OWM_READ_COMMAND
+		rjmp pro_out_bitp1
+pro_rcc_1:
+		cpi rwbyte,0xF0 ;Searchrom
+		brne pro_rcc_2
+		ldi XL,low(sowid)  ;init sram pointer
+		ldi XH,high(sowid)
+		ld srbyte,X+
+		ldi bytep,0
+		rjmp pro_serchrom_next_bit
+pro_rcc_2:
+		cpi rwbyte,0x55 ;Matchrom
+		brne pro_rcc_3
+//		rcall pro_owidinit
+		ldi XL,low(sowid)  ;init sram pointer
+		ldi XH,high(sowid)
+		ldi mode,OWM_MATCH_ROM
+		rjmp pro_out_bytep0
+
+pro_rcc_3:
+		ret
+
+pro_match_rom:		
+		ld temp,X+
+		cp temp,rwbyte
+		breq pro_match_rom_next
+		ldi mode,OWM_SLEEP
+		ret
+pro_match_rom_next:					
+		cpi XL,SRAM_START+8
+		breq pro_match_rom_found
+		rjmp pro_out_bitp1
+pro_match_rom_found:
+	    ldi mode,OWM_READ_COMMAND
+		rjmp pro_out_bitp1
+
+pro_read_command:
+		ldi mode,OWM_SLEEP
+		cpi rwbyte,0x0F ;; Write to Scratchpad
+		brne pro_rc_1
+		ldi mode,OWM_WRITE_SCRATCHPAD
+		ldi XL,low(scratchpad)  ;init sram pointer
+		ldi XH,high(scratchpad)
+		rjmp pro_out_bytep0
+pro_rc_1:
+		cpi rwbyte,0xAA
+		brne pro_rc_2
+		ldi mode,OWM_READ_SCRATCHPAD  ;;Read from Scratchpad
+		ldi XL,low(scratchpad)  ;init sram pointer
+		ldi XH,high(scratchpad)
+		inc smode
+		ld rwbyte,X+
+		rjmp pro_out_bytep0
+
+pro_rc_2:
+		cpi rwbyte,0xB8
+		brne pro_rc_3
+		ldi mode,OWM_RECALL_FLASH  ;; copy Flash page in Scratchpad
+		ldi XL,low(scratchpad)  ;init sram pointer
+		ldi XH,high(scratchpad)
+		rjmp pro_out_bytep0
+pro_rc_3:
+		cpi rwbyte,0x55 ; copy Scratchpad to Flash
+		brne pro_rc_4
+		ldi mode,OWM_SLEEP
+		rjmp pro_programm_page
+		
+pro_rc_4:
+		cpi rwbyte,0x89 ; Reset Device /Boot (new) Firmware
+		brne pro_rc_5
+		rjmp jreset		
+pro_rc_5:
+		cpi rwbyte,0x8B ; Clear the OWID saved in EEPROM / one ID1
+		brne pro_rc_6	
+		ldi temp,7
+pro_rc_5a:
+		ldi XL,low(E2END)
+		ldi XH,high(E2END)
+		sub XL,temp
+		out EEARH,XH
+		out EEARL,XL
+		ldi temp, (0<<EEPM1)|(0<<EEPM0)
+		out EECR, temp
+		ldi temp,0xFF
+		out EEDR, temp
+		sbi EECR, EEMPE
+		sbi EECR, EEPE
+		ret
+
+
+pro_rc_6:
+		cpi rwbyte,0x8C ; Clear the OWID saved in EEPROM / one ID2
+		brne pro_rc_7
+		ldi temp,7+8
+		rjmp pro_rc_5a
+
+pro_rc_7:
+		ret
+
+pro_write_scratchpad:
+		st X+,rwbyte
+		cpi XL,SRAM_START+8+66
+		brlo pro_write_scratchpad_next
+		ldi mode,OWM_SLEEP
+		ret		
+pro_write_scratchpad_next:
+		ldi bitp,1
+		ret
+
+pro_read_scratchpad:
+		cpi XL,SRAM_START+8+66
+		brlo pro_read_scratchpad_next
+		ldi mode,OWM_SLEEP
+		clr smode
+		ret
+pro_read_scratchpad_next:
+		ld rwbyte,X+
+		rjmp pro_out_bitp1
+
+
+pro_programm_page:
+.equ PAGESIZEB = PAGESIZE*2;PAGESIZEB is page size in BYTES, not words
+// .org SMALLBOOTSTART
+write_page:
+		;transfer data from RAM to Flash page buffer
+		ldi bytep, PAGESIZEB ;init loop variable
+		ldi YL,low(scratchpad)  ;init sram pointer
+		ldi YH,high(scratchpad)
+		ld ZL,Y+
+		ld ZH,Y+
+		;page erase
+		ldi spmcrval, (1<<PGERS) + (1<<SPMEN)
+		rcall do_spm
+wrloop:
+		ld r0, Y+
+		ld r1, Y+
+		ldi spmcrval, (1<<SPMEN)
+		rcall do_spm
+		adiw ZH:ZL, 2
+		subi bytep, 2;use subi for PAGESIZEB<=256
+		brne wrloop
+		;execute page write
+		subi ZL, low(PAGESIZEB) ;restore pointer
+		sbci ZH, high(PAGESIZEB) ;not required for PAGESIZEB<=256
+		ldi spmcrval, (1<<PGWRT) + (1<<SPMEN)
+		rcall do_spm
+		;read back and check, optional
+		ldi bytep, PAGESIZEB
+		subi YL, low(PAGESIZEB) ;restore pointer
+		sbci YH, high(PAGESIZEB)
+rdloop:
+		lpm r0, Z+
+		ld r1, Y+
+		cpse r0, r1
+		rjmp error
+		subi bytep, 2;use subi for PAGESIZEB<=256
+		brne rdloop
+		;return
+		ret
+do_spm:
+		 ;input: spmcrval determines SPM action
+		;disable interrupts if enabled, store status
+		in temp2, SREG
+		cli
+		;check for previous SPM complete
+wait:
+		in temp, SPMCSR
+		sbrc temp, SPMEN
+		rjmp wait
+		;SPM timed sequence
+		out SPMCSR, spmcrval
+		spm
+		;restore SREG (to enable interrupts if originally enabled)
+		out SREG, temp2
+		ret
+
+error:
+
+
+		ret
+
+pro_recall_flash:
+		st X+,rwbyte
+		;inc bytep
+		cpi XL,SRAM_START+8+2
+		brlo pro_out_bitp1;pro_recall_flash_next
+		lds ZL,scratchpad
+		lds ZH,scratchpad+1
+pro_recall_flash_cl:
+		lpm temp,Z+
+		st X+,temp
+		cpi XL,SRAM_START+8+66
+		brne pro_recall_flash_cl
+		ldi mode,OWM_SLEEP
+		ret
+
+pro_out_read_command:
+		ldi mode,OWM_READ_COMMAND
+pro_out_bytep0:
+		ldi bytep,0
+pro_out_bitp1:
+		ldi bitp,1
+		ret		
+
+
+
+pro_serchrom_next_bit:
+		mov rwbyte,srbyte
+		mov temp2,rwbyte
+		com rwbyte
+		ror temp2  ;first bit in C
+		rol rwbyte ;C in first bit 
+		inc smode
+		ldi bitp,0x40
+		ldi mode,OWM_SEARCH_ROM_R  ;next mod Resive
+		ret
+
+
+pro_search_rom_s:
+		clr temp2
+		lsr srbyte ;shift in C lowest bit
+		ror temp2  ; shift in temp2 as highest bit
+		andi rwbyte,0x80  ;  clear other bits
+		eor temp2,rwbyte
+		breq pro_search_rom_s_goon
+		ldi mode,OWM_SLEEP
+		ret
+pro_search_rom_s_goon:
+		inc bytep
+		mov temp2,bytep
+		andi temp2,0x07
+		brne pro_serchrom_next_bit ;prepare next bit
+		mov temp2,bytep
+		andi temp2,0x40 ;;end
+		brne pro_search_rom_found
+		;read next byte
+		ld srbyte,X+
+		rjmp pro_serchrom_next_bit
+
+pro_search_rom_found:
+		ldi mode,OWM_READ_COMMAND
+		rjmp pro_out_bytep0
+
+pro_search_rom_r:
+		clr smode
+		ldi mode,OWM_SEARCH_ROM_S
+		ldi bitp,0  ;go to searchrom_s after bit get
+		ret
+
+pro_owid: .DB  0xA3, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xFA
+
+
+
+
+
+wait_time:
+		out TCNT0,zero
+wait_time1:
+		in temp,TCNT0
+		cp temp,param
+		brlo wait_time1
+		ret
+
+
+.DSEG
+sowid: .BYTE 8
+scratchpad: .BYTE 66
\ No newline at end of file
diff --git a/programmer_atmega328/programmer_atmega328/programmer_atmega328.asm b/programmer_atmega328/programmer_atmega328/programmer_atmega328.asm
new file mode 100644
index 0000000..816731c
--- /dev/null
+++ b/programmer_atmega328/programmer_atmega328/programmer_atmega328.asm
@@ -0,0 +1,497 @@
+
+.def srbyte = r12  ;byty for search rom algorithm
+.def writelow = r13;  marker for send low
+.def zero =r14;  always zero 
+.def smode=r15; if 1 then send 
+.def temp = r16 ; 
+.def temp2 = r17; 
+.def mode = r18 ; 
+.def bitp = r19 ; bit counter ... shift...
+.def rwbyte = r21;
+.def param = r22;
+.def bytep = r23  ;byte counter
+#define spmcrval  param
+
+
+.equ OWM_READ_ROM_COMMAND=0 ; 0 wegen schnellen test ist dieser wert 0! Daturch wird die Sprungdabelle nicht verwendet
+.equ OWM_SLEEP=1 ; Warten auf Reset
+.equ OWM_MATCH_ROM=2
+.equ OWM_SEARCH_ROM_S=3  ;send bit
+.equ OWM_SEARCH_ROM_R=4  ;resive master
+.equ OWM_READ_COMMAND=5
+.equ OWM_WRITE_SCRATCHPAD=6
+.equ OWM_READ_SCRATCHPAD=7
+.equ OWM_PROGRAMM_PAGE=8
+.equ OWM_RECALL_FLASH=9
+
+
+
+.equ OW_DDR = DDRD 
+.equ OW_PIN = PORTD2
+.equ OW_PORT = PORTD 
+.equ OW_PINN = PIND
+
+//.equ SPMEN = 0
+
+;.equ SRAM_START = 0x60
+
+.macro set_clock
+		ldi temp,0x80;
+		sts CLKPR,temp
+		ldi temp,@0
+		sts CLKPR,temp
+.endmacro 
+
+.macro owwl
+		sbic OW_PINN,OW_PIN
+		rjmp pc-1
+.endmacro 
+
+.macro owwh
+		sbis OW_PINN,OW_PIN
+		rjmp pc-1
+.endmacro 
+
+
+
+
+ ;---------------------------------------------------
+; START of PROG 
+;---------------------------------------------------
+
+
+.CSEG 
+.ORG 0x000
+jreset:
+		jmp start ; Reset-Vector 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+		reti ; 
+
+
+.ORG 0x3E00
+start: 
+		cli
+		ldi temp,0
+		mov zero,temp
+		set_clock 0x01 ;4mhz
+		ldi mode,OWM_SLEEP
+		ldi temp,(1<<CS01) //2us
+		out TCCR0B,temp
+		ldi temp, HIGH(RAMEND) ; HIGH-Byte der obersten RAM-Adresse 
+		out SPH, temp 
+		ldi temp, LOW(RAMEND) ; LOW-Byte der obersten RAM-Adresse 
+		out SPL, temp 
+		;ldi temp,1
+		;out DDRB,temp
+		clr writelow
+		clr bitp
+	
+		;sbi PORTB,0
+		ldi ZL,low(pro_owid*2) 
+		ldi ZH,high(pro_owid*2) 
+		ldi XL,low(sowid)
+		ldi XH,high(sowid)
+		;ldi temp2,8
+pro_copy_loop: ;copy ID on SRAM for better handling
+		lpm temp,Z+
+		st X+,temp
+		cpi XL,low(SRAM_START+8) ;#################################
+		brlo pro_copy_loop
+pro_loop:
+		;sbi PORTB,0
+		owwl				;wait for line goes low (polling)
+		sbrc writelow,0		;test of zero send
+		sbi OW_DDR,OW_PIN	;yes pull line to low 2us faster
+		sbrs writelow,0     ;test egain 2us faster.....
+		rjmp pro_loop1		;no ? goes next
+		ldi param,20		;wait for 50 us
+		rcall wait_time
+		clr writelow		;reset write low indecator
+		cbi OW_DDR,OW_PIN   ;release line
+		owwh				;wait for line is high (it can takes some time cause of the capacity of line)
+pro_loop1:
+		tst smode			;smode=1 for slave sends to master
+		breq pro_loop_resv
+pro_loop_send:
+		tst bitp
+		brne pro_loop_send1
+		rcall pro_hb
+		tst smode
+		breq pro_loop_end ; now reading ... do nothing 
+pro_loop_send1:  ;prebare next bit
+		sbrs rwbyte ,0; if bit 0 set in rwbyte then skip next command
+		inc writelow
+		lsl bitp
+		ror rwbyte
+		rjmp pro_loop_end
+
+pro_loop_resv:
+		ldi param,7  ;wait 15us
+		rcall wait_time
+		lsr rwbyte
+		;cbi PORTB,0
+		sbic OW_PINN,OW_PIN  ;test line
+		ori rwbyte,0x80
+		lsl bitp
+		brne pro_loop_end ;no handle need
+		rcall pro_hb
+		tst smode
+		brne pro_loop_send ; Nach dem Gelesen byte koennte gesendet werden muessen....
+pro_loop_end:
+		//owwh
+		out TCNT0,zero
+pro_loop_end_test_reset:
+		sbic OW_PINN,OW_PIN  //leitung wieder high
+		rjmp pro_loop
+		in temp,TCNT0
+		cpi temp,63
+		brlo pro_loop_end_test_reset
+		rcall pro_sleep_s2
+		rjmp pro_loop
+
+
+
+
+pro_sleep:
+		out TCNT0,zero
+pro_sleep_s1:
+		sbic OW_PINN,OW_PIN  //leitung wieder high
+		ret
+		in temp,TCNT0
+		cpi temp,100
+		brlo pro_sleep_s1
+		//leitung wieder high
+pro_sleep_s2:
+		owwh 
+		ldi param,20
+		rcall wait_time
+		//Presents Impuls
+		sbi OW_DDR,OW_PIN
+		ldi param,75
+		rcall wait_time
+		cbi OW_DDR,OW_PIN
+		//init read byte
+		ldi bitp,0x01
+		ldi rwbyte,0
+		clr smode
+		ldi mode,OWM_READ_ROM_COMMAND
+		//Wait for all other devices presents impuls finished
+		ldi param,20
+		rcall wait_time
+		ret
+
+
+
+pro_hb:
+		ldi ZL,low(pro_stable) 
+		ldi ZH,high(pro_stable) 
+		add ZL,mode 
+		adc ZH,zero
+		icall
+		ret
+
+pro_stable: 
+		rjmp pro_read_rom_command
+		rjmp pro_sleep 
+		rjmp pro_match_rom
+		rjmp pro_search_rom_s
+		rjmp pro_search_rom_r
+		rjmp pro_read_command
+		rjmp pro_write_scratchpad
+		rjmp pro_read_scratchpad
+		rjmp pro_programm_page
+		rjmp pro_recall_flash
+
+pro_read_rom_command:
+		ldi mode,OWM_SLEEP
+		cpi rwbyte,0xCC
+		brne pro_rcc_1
+		ldi mode,OWM_READ_COMMAND
+		rjmp pro_out_bitp1
+pro_rcc_1:
+		cpi rwbyte,0xF0 ;Searchrom
+		brne pro_rcc_2
+		ldi XL,low(sowid)  ;init sram pointer
+		ldi XH,high(sowid)
+		ld srbyte,X+
+		ldi bytep,0
+		rjmp pro_serchrom_next_bit
+pro_rcc_2:
+		cpi rwbyte,0x55 ;Matchrom
+		brne pro_rcc_3
+//		rcall pro_owidinit
+		ldi XL,low(sowid)  ;init sram pointer
+		ldi XH,high(sowid)
+		ldi mode,OWM_MATCH_ROM
+		rjmp pro_out_bytep0
+
+pro_rcc_3:
+		ret
+
+pro_match_rom:		
+		ld temp,X+
+		cp temp,rwbyte
+		breq pro_match_rom_next
+		ldi mode,OWM_SLEEP
+		ret
+pro_match_rom_next:					
+		cpi XL,LOW(SRAM_START+8);####################
+		breq pro_match_rom_found
+		rjmp pro_out_bitp1
+pro_match_rom_found:
+	    ldi mode,OWM_READ_COMMAND
+		rjmp pro_out_bitp1
+
+pro_read_command:
+		ldi mode,OWM_SLEEP
+		cpi rwbyte,0x0F ;; Write to Scratchpad
+		brne pro_rc_1
+		ldi mode,OWM_WRITE_SCRATCHPAD
+		ldi XL,low(scratchpad)  ;init sram pointer
+		ldi XH,high(scratchpad)
+		rjmp pro_out_bytep0
+pro_rc_1:
+		cpi rwbyte,0xAA
+		brne pro_rc_2
+		ldi mode,OWM_READ_SCRATCHPAD  ;;Read from Scratchpad
+		ldi XL,low(scratchpad)  ;init sram pointer
+		ldi XH,high(scratchpad)
+		inc smode
+		ld rwbyte,X+
+		rjmp pro_out_bytep0
+
+pro_rc_2:
+		cpi rwbyte,0xB8
+		brne pro_rc_3
+		ldi mode,OWM_RECALL_FLASH  ;; copy Flash page in Scratchpad
+		ldi XL,low(scratchpad)  ;init sram pointer
+		ldi XH,high(scratchpad)
+		rjmp pro_out_bytep0
+pro_rc_3:
+		cpi rwbyte,0x55 ; copy Scratchpad to Flash
+		brne pro_rc_4
+		ldi mode,OWM_SLEEP
+		rjmp pro_programm_page
+		
+pro_rc_4:
+		cpi rwbyte,0x89 ; Reset Device /Boot (new) Firmware
+		brne pro_rc_5
+		jmp jreset		
+pro_rc_5:
+		cpi rwbyte,0x8B ; Clear the OWID saved in EEPROM / one ID1
+		brne pro_rc_6	
+		ldi temp,7
+pro_rc_5a:
+		ldi XL,low(E2END)
+		ldi XH,high(E2END)
+		sub XL,temp
+		out EEARH,XH
+		out EEARL,XL
+		ldi temp, (0<<EEPM1)|(0<<EEPM0)
+		out EECR, temp
+		ldi temp,0xFF
+		out EEDR, temp
+		sbi EECR, EEMPE
+		sbi EECR, EEPE
+		ret
+
+
+pro_rc_6:
+		cpi rwbyte,0x8C ; Clear the OWID saved in EEPROM / one ID2
+		brne pro_rc_7
+		ldi temp,7+8
+		rjmp pro_rc_5a
+
+pro_rc_7:
+		ret
+
+pro_write_scratchpad:
+		st X+,rwbyte
+		cpi XL,138 ;#####################################
+		brlo pro_write_scratchpad_next
+		ldi mode,OWM_SLEEP
+		ret		
+pro_write_scratchpad_next:
+		ldi bitp,1
+		ret
+
+pro_read_scratchpad:
+		cpi XL,8+130 ;###################################
+		brlo pro_read_scratchpad_next
+		ldi mode,OWM_SLEEP
+		clr smode
+		ret
+pro_read_scratchpad_next:
+		ld rwbyte,X+
+		rjmp pro_out_bitp1
+
+
+pro_programm_page:
+.equ PAGESIZEB = 128 ; Not correct deglaration in inc file of ATMEGA328PB  PAGESIZE*2;PAGESIZEB is page size in BYTES, not words
+// .org SMALLBOOTSTART
+write_page:
+		;transfer data from RAM to Flash page buffer
+		ldi bytep, PAGESIZEB ;init loop variable
+		ldi YL,low(scratchpad)  ;init sram pointer
+		ldi YH,high(scratchpad)
+		ld ZL,Y+
+		ld ZH,Y+
+		;page erase
+		ldi spmcrval,(1<<PGERS) | (1<<SPMEN)
+		rcall do_spm
+		ldi spmcrval, (1<<RWWSRE) | (1<<SPMEN)
+		rcall do_spm
+wrloop:
+		ld r0, Y+
+		ld r1, Y+
+		ldi spmcrval, (1<<SPMEN)
+		rcall do_spm
+		adiw ZH:ZL, 2
+		subi bytep, 2;use subi for PAGESIZEB<=256
+		brne wrloop
+		;execute page write
+		subi ZL, low(PAGESIZEB) ;restore pointer
+		sbci ZH, high(PAGESIZEB) ;not required for PAGESIZEB<=256
+		ldi spmcrval, (1<<PGWRT) + (1<<SPMEN)
+		rcall do_spm
+		ldi spmcrval, (1<<RWWSRE) | (1<<SPMEN)
+		rcall do_spm
+		;read back and check, optional
+		ldi bytep, PAGESIZEB
+		subi YL, low(PAGESIZEB) ;restore pointer
+		sbci YH, high(PAGESIZEB)
+rdloop:
+		lpm r0, Z+
+		ld r1, Y+
+		cpse r0, r1
+		rjmp error
+		subi bytep, 2;use subi for PAGESIZEB<=256
+		brne rdloop
+		;return
+		ret
+do_spm:
+		 ;input: spmcrval determines SPM action
+		;disable interrupts if enabled, store status
+		in temp2, SREG
+		cli
+		;check for previous SPM complete
+wait:
+		in temp, SPMCSR
+		sbrc temp, SPMEN
+		rjmp wait
+		;SPM timed sequence
+		out SPMCSR, spmcrval
+		spm
+		;restore SREG (to enable interrupts if originally enabled)
+		out SREG, temp2
+		ret
+
+error:
+
+
+		ret
+
+pro_recall_flash:
+		st X+,rwbyte
+		;inc bytep
+		cpi XL,low(SRAM_START+8+2) ;##############################################
+		brlo pro_out_bitp1;pro_recall_flash_next
+		lds ZL,scratchpad
+		lds ZH,scratchpad+1
+pro_recall_flash_cl:
+		lpm temp,Z+
+		st X+,temp
+		cpi XL,low(SRAM_START+8+66) ;############################################
+		brne pro_recall_flash_cl
+		ldi mode,OWM_SLEEP
+		ret
+
+pro_out_read_command:
+		ldi mode,OWM_READ_COMMAND
+pro_out_bytep0:
+		ldi bytep,0
+pro_out_bitp1:
+		ldi bitp,1
+		ret		
+
+
+
+pro_serchrom_next_bit:
+		mov rwbyte,srbyte
+		mov temp2,rwbyte
+		com rwbyte
+		ror temp2  ;first bit in C
+		rol rwbyte ;C in first bit 
+		inc smode
+		ldi bitp,0x40
+		ldi mode,OWM_SEARCH_ROM_R  ;next mod Resive
+		ret
+
+
+pro_search_rom_s:
+		clr temp2
+		lsr srbyte ;shift in C lowest bit
+		ror temp2  ; shift in temp2 as highest bit
+		andi rwbyte,0x80  ;  clear other bits
+		eor temp2,rwbyte
+		breq pro_search_rom_s_goon
+		ldi mode,OWM_SLEEP
+		ret
+pro_search_rom_s_goon:
+		inc bytep
+		mov temp2,bytep
+		andi temp2,0x07
+		brne pro_serchrom_next_bit ;prepare next bit
+		mov temp2,bytep
+		andi temp2,0x40 ;;end
+		brne pro_search_rom_found
+		;read next byte
+		ld srbyte,X+
+		rjmp pro_serchrom_next_bit
+
+pro_search_rom_found:
+		ldi mode,OWM_READ_COMMAND
+		rjmp pro_out_bytep0
+
+pro_search_rom_r:
+		clr smode
+		ldi mode,OWM_SEARCH_ROM_S
+		ldi bitp,0  ;go to searchrom_s after bit get
+		ret
+
+pro_owid: .DB 0xA3, 0xAA, 0x57, 0xAA, 0x57, 0xAA, 0x57, 0x8A
+
+
+
+
+
+wait_time:
+		out TCNT0,zero
+wait_time1:
+		in temp,TCNT0
+		cp temp,param
+		brlo wait_time1
+		ret
+
+
+.DSEG
+sowid: .BYTE 8
+scratchpad: .BYTE 130
\ No newline at end of file
diff --git a/programmer_atmega328/programmer_atmega328/programmer_atmega328.asmproj b/programmer_atmega328/programmer_atmega328/programmer_atmega328.asmproj
new file mode 100644
index 0000000..694b3ae
--- /dev/null
+++ b/programmer_atmega328/programmer_atmega328/programmer_atmega328.asmproj
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.AVRAssembler</ToolchainName>
+    <ProjectGuid>59B1D629-9DCC-43ed-A0FD-8AB0E4D622AB</ProjectGuid>
+    <avrdeviceseries>none</avrdeviceseries>
+    <avrdevice>ATmega328PB</avrdevice>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.obj</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <Language>ASSEMBLY</Language>
+    <AssemblyName>programmer_atmega328</AssemblyName>
+    <Name>programmer_atmega328</Name>
+    <RootNamespace>programmer_atmega328</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <EntryFile>$(MSBuildProjectDirectory)\programmer_atmega328.asm</EntryFile>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>0</eraseonlaunchrule>
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.31.0" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+    <avrtoolserialnumber>J41800000789</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x1E9516</avrdeviceexpectedsignature>
+    <com_atmel_avrdbg_tool_atmelice>
+      <ToolOptions>
+        <InterfaceProperties>
+          <IspClock>125000</IspClock>
+        </InterfaceProperties>
+        <InterfaceName>ISP</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
+      <ToolNumber>J41800000789</ToolNumber>
+      <ToolName>Atmel-ICE</ToolName>
+    </com_atmel_avrdbg_tool_atmelice>
+    <avrtoolinterface>ISP</avrtoolinterface>
+    <avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <AvrAssembler>
+  <avrasm.assembler.general.AdditionalIncludeDirectories>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\avrasm\inc</Value>
+    </ListValues>
+  </avrasm.assembler.general.AdditionalIncludeDirectories>
+  <avrasm.assembler.general.IncludeFile>m328PBdef.inc</avrasm.assembler.general.IncludeFile>
+</AvrAssembler>
+    </ToolchainSettings>
+    <OutputType>Executable</OutputType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <AvrAssembler>
+  <avrasm.assembler.general.AdditionalIncludeDirectories>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.1.130\avrasm\inc</Value>
+    </ListValues>
+  </avrasm.assembler.general.AdditionalIncludeDirectories>
+  <avrasm.assembler.general.IncludeFile>m328PBdef.inc</avrasm.assembler.general.IncludeFile>
+</AvrAssembler>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="programmer_atmega328.asm">
+      <SubType>Code</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Assembler.targets" />
+</Project>
\ No newline at end of file
diff --git a/programmer_atmega328/programmer_atmega328/programmer_atmega328.atsln b/programmer_atmega328/programmer_atmega328/programmer_atmega328.atsln
new file mode 100644
index 0000000..ac4179e
--- /dev/null
+++ b/programmer_atmega328/programmer_atmega328/programmer_atmega328.atsln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{18226A42-8477-4023-8AD2-40C49DA407C9}") = "programmer_atmega328", "programmer_atmega328.asmproj", "{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|AVR = Debug|AVR
+		Release|AVR = Release|AVR
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Debug|AVR.ActiveCfg = Debug|AVR
+		{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Debug|AVR.Build.0 = Debug|AVR
+		{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Release|AVR.ActiveCfg = Release|AVR
+		{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Release|AVR.Build.0 = Release|AVR
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
-- 
2.34.1