From 22b81b6c288ca56f58d064627c310e437f9453a4 Mon Sep 17 00:00:00 2001 From: Tobias <tm@tm3d.de> Date: Fri, 17 Feb 2017 08:59:11 +0100 Subject: [PATCH] Change from 16 to 24 Byte Config Code Add REAL Working DS2423 with EEPROM Save Non blocking on 1-Wire Bus always low (Changes in timer interrupt) New CO2 Sensor --- DS18B20_BMP280/DS18B20_BMP280.c | 5 +- DS18B20_BMP280/DS18B20_BMP280.cproj | 24 +- .../DS18B20_BMP280_DS2438_SHT.cproj | 47 +- DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c | 8 +- DS18B20_CDM7160/DS18B20_CDM7160.atsln | 22 + DS18B20_CDM7160/DS18B20_CDM7160.c | 185 ++++++++ DS18B20_CDM7160/DS18B20_CDM7160.cproj | 167 +++++++ DS18B20_MAX44009/DS18B20_MAX44009.c | 4 +- DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c | 8 +- .../DS18B20_MAX44009_DS2438_SHT.cproj | 30 +- DS18B20_Thermocouble/DS18B20_TC.c | 4 +- .../DS18B20_DS2438.c | 6 +- .../DS18B20_Thermocouble_DS2438_SHT.cproj | 308 ++++++------ DS18B20_VOC/DS18B20_VOC.c | 4 +- DS18B20_VOC/DS18B20_VOC.cproj | 20 +- .../DS18B20_DS2438.c | 448 ++++++++++++++++++ DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c | 7 +- DS2406/DS2406.cproj | 116 +++-- DS2423 - Autosave/DS2423.atsln | 20 + DS2423 - Autosave/DS2423.c | 250 ++++++++++ DS2423 - Autosave/DS2423.cproj | 147 ++++++ DS2423/DS2423.c | 4 +- DS2423_BMP280/DS2423_BMP280.c | 4 +- DS2423_komische platine/DS2423.c | 4 +- DS2423_komische platine/DS2423.cproj | 296 ++++++------ DS2438_DHT22/DS2438_DHT22.c | 4 +- DS2438_HDC1080/DS2438_HDC1080.c | 7 +- DS2438_HDC1080/DS2438_HDC1080.cproj | 296 ++++++------ DS2438_HIH9121/DS2438_HIH9121.c | 5 +- DS2438_SHT2X/DS2438_SHT2X.c | 5 +- DS2450/DS2450.c | 4 +- DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.c | 6 +- DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.cproj | 290 ++++++------ .../DS2450_SHT2X_BMP280_MAX44009.c | 4 +- DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c | 4 +- .../DS2450_SHT2X_MAX44009.cproj | 298 ++++++------ DS2450_VOC_SHT_BMP/DS2450.cproj | 304 ++++++------ DS2450_VOC_SHT_BMP/DS2450_VOC_SHT_BMP.c | 4 +- common/I2C/CDM7160.c | 137 ++++++ common/I2C/CDM7160.h | 42 ++ common/OWCRC16.s | 2 +- common/OWConfig.s | 2 +- common/OWDS18B20_DS2438.S | 2 +- common/OWDS2423.S | 3 +- common/OWRomFunctions.s | 14 +- common/OWRomFunctionsDual.s | 35 +- common/OWSet_ATTINYX4.s | 2 +- common/OWTimerInterrupt.s | 19 +- programmer/programmer/programmer.asm | 2 +- 49 files changed, 2550 insertions(+), 1079 deletions(-) create mode 100644 DS18B20_CDM7160/DS18B20_CDM7160.atsln create mode 100644 DS18B20_CDM7160/DS18B20_CDM7160.c create mode 100644 DS18B20_CDM7160/DS18B20_CDM7160.cproj create mode 100644 DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c create mode 100644 DS2423 - Autosave/DS2423.atsln create mode 100644 DS2423 - Autosave/DS2423.c create mode 100644 DS2423 - Autosave/DS2423.cproj create mode 100644 common/I2C/CDM7160.c create mode 100644 common/I2C/CDM7160.h diff --git a/DS18B20_BMP280/DS18B20_BMP280.c b/DS18B20_BMP280/DS18B20_BMP280.c index 261c78d..78bb7d6 100644 --- a/DS18B20_BMP280/DS18B20_BMP280.c +++ b/DS18B20_BMP280/DS18B20_BMP280.c @@ -1,5 +1,4 @@ - -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -49,7 +48,7 @@ extern void EXTERN_SLEEP(); uint8_t owid[8]={0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40};/**/ -uint8_t config_info[16]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if (owid>128) #error "Variable not correct" diff --git a/DS18B20_BMP280/DS18B20_BMP280.cproj b/DS18B20_BMP280/DS18B20_BMP280.cproj index b41de76..25b04ce 100644 --- a/DS18B20_BMP280/DS18B20_BMP280.cproj +++ b/DS18B20_BMP280/DS18B20_BMP280.cproj @@ -27,16 +27,16 @@ <BootSegment>2</BootSegment> <eraseonlaunchrule>1</eraseonlaunchrule> <AsfFrameworkConfig> - <framework-data xmlns=""> - <options /> - <configurations /> - <files /> - <documentation help="" /> - <offline-documentation help="" /> - <dependencies> - <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.19.0" /> - </dependencies> - </framework-data> + <framework-data> + <options /> + <configurations /> + <files /> + <documentation help="" /> + <offline-documentation help="" /> + <dependencies> + <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" /> + </dependencies> +</framework-data> </AsfFrameworkConfig> <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool> <com_atmel_avrdbg_tool_atmelice> @@ -143,7 +143,7 @@ <SubType>compile</SubType> <Link>OWDS18B20.S</Link> </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> + <Compile Include="..\common\I2C\USI_TWI_Master.c"> <SubType>compile</SubType> <Link>USI_TWI_Master.c</Link> </Compile> @@ -152,4 +152,4 @@ </Compile> </ItemGroup> <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" /> -</Project> \ No newline at end of file +</Project> diff --git a/DS18B20_BMP280_DS2438_SHT/DS18B20_BMP280_DS2438_SHT.cproj b/DS18B20_BMP280_DS2438_SHT/DS18B20_BMP280_DS2438_SHT.cproj index 8fccb76..2594168 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.22.0" /> - </dependencies> -</framework-data> + <options /> + <configurations /> + <files /> + <documentation help="" /> + <offline-documentation help="" /> + <dependencies> + <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" /> + </dependencies> + </framework-data> </AsfFrameworkConfig> - <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool> + <avrtool>custom</avrtool> <com_atmel_avrdbg_tool_atmelice> <ToolOptions> <InterfaceProperties> @@ -54,8 +54,7 @@ <ToolOptions> <InterfaceProperties> </InterfaceProperties> - <InterfaceName> - </InterfaceName> + <InterfaceName>debugWIRE</InterfaceName> </ToolOptions> <ToolType>com.atmel.avrdbg.tool.simulator</ToolType> <ToolNumber> @@ -63,8 +62,20 @@ <ToolName>Simulator</ToolName> </com_atmel_avrdbg_tool_simulator> <ExternalProgrammingToolCommand /> - <avrtoolserialnumber>J41800000789</avrtoolserialnumber> + <avrtoolserialnumber> + </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> @@ -141,19 +152,19 @@ <SubType>compile</SubType> <Link>SHT2x.c</Link> </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\calibr.c"> + <Compile Include="..\common\calibr.c"> <SubType>compile</SubType> <Link>calibr.c</Link> </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\BMP280.c"> + <Compile Include="..\common\I2C\BMP280.c"> <SubType>compile</SubType> <Link>BMP280.c</Link> </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> + <Compile Include="..\common\I2C\USI_TWI_Master.c"> <SubType>compile</SubType> <Link>USI_TWI_Master.c</Link> </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\OWDS18B20_DS2438.S"> + <Compile Include="..\common\OWDS18B20_DS2438.S"> <SubType>compile</SubType> <Link>OWDS18B20_DS2438.S</Link> </Compile> @@ -162,4 +173,4 @@ </Compile> </ItemGroup> <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" /> -</Project> \ No newline at end of file +</Project> diff --git a/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c index d4dbcc0..191de8f 100644 --- a/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c +++ b/DS18B20_BMP280_DS2438_SHT/DS18B20_DS2438.c @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -48,8 +48,10 @@ extern void EXTERN_SLEEP(); 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[16]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -uint8_t config_info2[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + +uint8_t config_info1[26]={0x02,0x03, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,14,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" diff --git a/DS18B20_CDM7160/DS18B20_CDM7160.atsln b/DS18B20_CDM7160/DS18B20_CDM7160.atsln new file mode 100644 index 0000000..bb4e41c --- /dev/null +++ b/DS18B20_CDM7160/DS18B20_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}") = "DS18B20_CDM7160", "DS18B20_CDM7160.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_CDM7160.c b/DS18B20_CDM7160/DS18B20_CDM7160.c new file mode 100644 index 0000000..b46797c --- /dev/null +++ b/DS18B20_CDM7160/DS18B20_CDM7160.c @@ -0,0 +1,185 @@ +// 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]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ +uint8_t config_info[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}; + +#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; + +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; + + + + + + + + +int main(void){ + PRR|=(1<<PRADC); // 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; + PORTB=0xFF; + OWINIT(); + DDRB|=(1<<PINB1); + PORTB&=~(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 + + MCUSR=0; + USI_TWI_Master_Initialise(); + //CDM7160softReset(); + //_delay_ms(100); + + CDM7160setMode(0); //Power Down Mode + CDM7160setAvCount(0x3F); + CDM7160setFMode(1); + pack.temp=CDM7160getCO2(); + CDM7160setMode(1); + gcontrol=1; + //DDRB|=(1<<PINB1); + //while (1) {volatile double l=CDM7160getCO2();} + + sei(); + #define PBR 1 + while(1) { + + if (gcontrol) { + if (wdcounter<PBR) wdcounter=PBR; + gcontrol=0; + } + if ( wdcounter==PBR) { + //CDM7160setMode(1); + } + if (wdcounter>(PBR+1)) { + wdcounter=0; + //PORTB|=(1<<PINB1); //Dauer 2.3ms + volatile uint16_t l=CDM7160getCO2(); + uint16_t w=l; + uint8_t t8=w>>4; + uint8_t af=0; + if (t8>pack.TH) af=1; + if (t8<=pack.TL) af=1; + cli(); + pack.temp=w; + //pack.temp++; + alarmflag=af; + sei(); + //CDM7160setMode(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"); + } + + +} \ No newline at end of file diff --git a/DS18B20_CDM7160/DS18B20_CDM7160.cproj b/DS18B20_CDM7160/DS18B20_CDM7160.cproj new file mode 100644 index 0000000..4e4abf0 --- /dev/null +++ b/DS18B20_CDM7160/DS18B20_CDM7160.cproj @@ -0,0 +1,167 @@ +<?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</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.22.0" /> + </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\I2C\CDM7160.c"> + <SubType>compile</SubType> + <Link>CDM7160.c</Link> + </Compile> + <Compile Include="..\common\OWDS18B20.S"> + <SubType>compile</SubType> + <Link>OWDS18B20.S</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> + <SubType>compile</SubType> + <Link>USI_TWI_Master.c</Link> + </Compile> + <Compile Include="DS18B20_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/DS18B20_MAX44009/DS18B20_MAX44009.c b/DS18B20_MAX44009/DS18B20_MAX44009.c index edf1be3..4aeb0e8 100644 --- a/DS18B20_MAX44009/DS18B20_MAX44009.c +++ b/DS18B20_MAX44009/DS18B20_MAX44009.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ extern void EXTERN_SLEEP(); uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ -uint8_t config_info[16]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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" diff --git a/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c index e823003..c7ff34c 100644 --- a/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c +++ b/DS18B20_MAX44009_DS2438_SHT/DS18B20_DS2438.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -49,8 +49,10 @@ extern void EXTERN_SLEEP(); 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[16]={0x03,0x04, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -uint8_t config_info2[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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" diff --git a/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj b/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj index 03def20..7acbedc 100644 --- a/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj +++ b/DS18B20_MAX44009_DS2438_SHT/DS18B20_MAX44009_DS2438_SHT.cproj @@ -22,34 +22,35 @@ <ProgFlashFromRam>true</ProgFlashFromRam> <RamSnippetAddress>0x20000000</RamSnippetAddress> <UncachedRange /> - <preserveEEPROM>true</preserveEEPROM> + <preserveEEPROM>false</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.22.0" /> - </dependencies> -</framework-data> + <options /> + <configurations /> + <files /> + <documentation help="" /> + <offline-documentation help="" /> + <dependencies> + <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" /> + </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> + <InterfaceName>ISP</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> + <avrtoolinterface>ISP</avrtoolinterface> <com_atmel_avrdbg_tool_simulator> <ToolOptions> <InterfaceProperties> @@ -63,6 +64,9 @@ <ToolName>Simulator</ToolName> </com_atmel_avrdbg_tool_simulator> <ExternalProgrammingToolCommand /> + <avrtoolserialnumber>J41800000789</avrtoolserialnumber> + <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature> + <avrtoolinterfaceclock>125000</avrtoolinterfaceclock> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <ToolchainSettings> diff --git a/DS18B20_Thermocouble/DS18B20_TC.c b/DS18B20_Thermocouble/DS18B20_TC.c index 447e694..d450db4 100644 --- a/DS18B20_Thermocouble/DS18B20_TC.c +++ b/DS18B20_Thermocouble/DS18B20_TC.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -53,7 +53,7 @@ const float k_rs[54] PROGMEM ={0.000000,24.125000,48.585366,72.731707,96.829268, uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0xAC};/**/ -uint8_t config_info[16]={0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[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}; #if (owid>128) #error "Variable not correct" diff --git a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c index d3e41f1..3cf6053 100644 --- a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c +++ b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_DS2438.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -60,8 +60,8 @@ double gettemp_rs(double V) { uint8_t owid1[8]={0x28, 0xA6, 0xD9, 0x84, 0x00, 0x00, 0x03, 0x68};/**/ uint8_t owid2[8]={0x26, 0xA7, 0xD9, 0x84, 0x00, 0x00, 0x03, 0x20};/**/ -uint8_t config_info1[16]={0x01,0x02 ,0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -uint8_t config_info2[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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" diff --git a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj index adb53ac..396866d 100644 --- a/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj +++ b/DS18B20_Thermocouble_DS2438_SHT/DS18B20_Thermocouble_DS2438_SHT.cproj @@ -1,155 +1,155 @@ -<?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_Thermocouble_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.22.0" /> - </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>J41800000779</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 /> - </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\SHT2x.c"> - <SubType>compile</SubType> - <Link>SHT2x.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> - <SubType>compile</SubType> - <Link>USI_TWI_Master.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\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" /> +<?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_Thermocouble_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.22.0" /> + </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>J41800000779</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 /> + </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\SHT2x.c"> + <SubType>compile</SubType> + <Link>SHT2x.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> + <SubType>compile</SubType> + <Link>USI_TWI_Master.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\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/DS18B20_VOC.c b/DS18B20_VOC/DS18B20_VOC.c index 043f104..4840d25 100644 --- a/DS18B20_VOC/DS18B20_VOC.c +++ b/DS18B20_VOC/DS18B20_VOC.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ extern void EXTERN_SLEEP(); uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ -uint8_t config_info[16]={0x01,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x08,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if (owid>128) #error "Variable not correct" diff --git a/DS18B20_VOC/DS18B20_VOC.cproj b/DS18B20_VOC/DS18B20_VOC.cproj index fca0860..b69eb8c 100644 --- a/DS18B20_VOC/DS18B20_VOC.cproj +++ b/DS18B20_VOC/DS18B20_VOC.cproj @@ -27,16 +27,16 @@ <BootSegment>2</BootSegment> <eraseonlaunchrule>1</eraseonlaunchrule> <AsfFrameworkConfig> - <framework-data xmlns=""> - <options /> - <configurations /> - <files /> - <documentation help="" /> - <offline-documentation help="" /> - <dependencies> - <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.19.0" /> - </dependencies> - </framework-data> + <framework-data> + <options /> + <configurations /> + <files /> + <documentation help="" /> + <offline-documentation help="" /> + <dependencies> + <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" /> + </dependencies> +</framework-data> </AsfFrameworkConfig> <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool> <com_atmel_avrdbg_tool_atmelice> diff --git a/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c b/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c new file mode 100644 index 0000000..d490f73 --- /dev/null +++ b/DS18B20_VOC_DS2438_SHT direct/DS18B20_DS2438.c @@ -0,0 +1,448 @@ +// 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/SHT2x.h" +#include "../common/calibr.h" + +extern void OWINIT(void); +extern void EXTERN_SLEEP(void); + + + +volatile uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/ +volatile uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/ +volatile uint8_t config_info1[26]={0x08,0x01, 0x00,0x00, 0x00,0x00, 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 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[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 + 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 { + uint16_t R0; + uint16_t VS; + uint8_t cmode; + int16_t ip; + uint8_t free; + }; + }; + 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; + }; + }; + uint8_t page5[8]; //41 + uint8_t page6[8]; //49 + uint8_t page7[8]; //57 + + #endif + }; +} 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,hhum; +double l; + + +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); +} + +int main(void){ + 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; + + ADMUX=0b00001110 //ADC1 + ADC3 - + ADCSRA = (1<<ADEN)| + + pack1.temp=0x0550; + pack1.config=0x7F; + pack1.TH=75; + pack1.TL=70; + pack1.rrFF=0xFF; + pack1.rr00=0; + pack1.rr10=0x10; + + 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 + for(uint8_t i=0;i<7;i++) { + weekmaxarr[i]=pack2.r_week_max; + } + + if (testSW()) { + config_info2[5]=8; + }else{ + config_info2[5]=7; + } + + USI_TWI_Master_Initialise(); + + SHT2x_SoftReset(); + SHT2x_ReadUserRegister(userRegister); + SHT2x_WriteUserRegister(userRegister); //write changed user reg + gcontrol=1; + sei(); + //DDRB|=(1<<PINB1); + while(1) { + if (pack1.config==0x1F) { + pack1.config=0x7F; + R0=1; + pack2.R0=0; + writeEEPROM(EEPROM_R0,0); + } + if (pack1.config==0x05) { + 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 (wdcounter>0) { + 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[7]=pack2.r_day_max; + for(uint8_t i=0;i<7;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--; + 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); + ip=interp(temperatureC,humidityRH); + pack2.ip=ip*1000; + humidityRH=calibr_hum(temperatureC,-0.2,humidityRH)*10.0; + //humidityRH=humidityRH*10.0; + temperatureC =temperatureC *10.0-2; + + + if (testSW()) { + am2302_hum= humidityRH*10.0; + am2302_temp=temperatureC*25.6; + //am2302_temp=am2302_temp-45; + config_info2[5]=8; + }else{ + 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; + config_info2[5]=7; + } + //PORTB&=~(1<<PINB1); + mr=0; +//Kritische Sektion !___Ein Breakpoint in dieser Section kann den TGS8100 zerstoeren!___________________________ + PORTB&=~(1<<PINB1); //Auf 0 Ziehen + _delay_us(150); + _delay_us(150); + PORTB|=(1<<PINB1); +//ENDE Kritische Sektion !______________________________ + //l=mr/2.0*2.048/4096; + // l maximal 2 mr max 4096 //mr 2V=8000 + + if (pack2.cmode) { //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 (pack2.cmode==0) { +// MAX1164x_config(MAX1164x_S_SEL2|MAX1164x_S_SEL0,CH0_CH1); + pack2.cmode=1; + } + } + //if (l<1.6) { + if (mr<6400) { + if (pack2.cmode==1) { + // MAX1164x_config(MAX1164x_S_SEL2|MAX1164x_S_SEL0,CH0_M); + pack2.cmode=0; + } + + + } + pack2.VS=mr*5/2; + l=mr/4000.0; + l=( 3/l- 1) *30; + 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=R0/l; + l=log(l); + l=l*160*4; //fuer DS18B20 + wdcounter=0; + + } + + if (gcontrol==1) { + 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(); + EXTERN_SLEEP(); + } + if ((gcontrol==2)||(gcontrol==3)) { + 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"); + } + + +} diff --git a/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c b/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c index 8e04299..f097198 100644 --- a/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c +++ b/DS18B20_VOC_DS2438_SHT/DS18B20_DS2438.c @@ -1,5 +1,4 @@ - -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -52,8 +51,8 @@ extern void EXTERN_SLEEP(void); volatile uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/ volatile uint8_t owid2[8]={0x26, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x67};/**/ -volatile uint8_t config_info1[16]={0x08,0x01, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -volatile uint8_t config_info2[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x07,0x08, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +volatile uint8_t config_info1[26]={0x08,0x01, 0x00,0x00, 0x00,0x00, 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" diff --git a/DS2406/DS2406.cproj b/DS2406/DS2406.cproj index fb51cbe..d81cd7a 100644 --- a/DS2406/DS2406.cproj +++ b/DS2406/DS2406.cproj @@ -2,7 +2,7 @@ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <SchemaVersion>2.0</SchemaVersion> - <ProjectVersion>6.2</ProjectVersion> + <ProjectVersion>7.0</ProjectVersion> <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName> <ProjectGuid>{26106a5a-6618-4774-943f-65c46ddb610b}</ProjectGuid> <avrdevice>ATtiny84A</avrdevice> @@ -54,57 +54,79 @@ <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <ToolchainSettings> <AvrGcc> - <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.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> + <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.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.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.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/DS2423 - Autosave/DS2423.atsln b/DS2423 - Autosave/DS2423.atsln new file mode 100644 index 0000000..55ec947 --- /dev/null +++ b/DS2423 - Autosave/DS2423.atsln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Atmel Studio Solution File, Format Version 11.00 +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2423", "DS2423.cproj", "{26106A5A-6618-4774-943F-65C46DDB610B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {26106A5A-6618-4774-943F-65C46DDB610B}.Debug|AVR.ActiveCfg = Debug|AVR + {26106A5A-6618-4774-943F-65C46DDB610B}.Debug|AVR.Build.0 = Debug|AVR + {26106A5A-6618-4774-943F-65C46DDB610B}.Release|AVR.ActiveCfg = Release|AVR + {26106A5A-6618-4774-943F-65C46DDB610B}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DS2423 - Autosave/DS2423.c b/DS2423 - Autosave/DS2423.c new file mode 100644 index 0000000..067b602 --- /dev/null +++ b/DS2423 - Autosave/DS2423.c @@ -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 _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> + + + +extern void OWINIT(); + +uint8_t owid[8]={0x1D, 0xA2, 0xD9, 0x84, 0x00, 0x26, 0x02, 0x5C};/**/ +uint8_t config_info[26]={9,13,9,13,9,13,9,13,0x02,19,19,19,19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //+2 for CRC + + + +extern uint8_t mode; +extern uint8_t gcontrol; +extern uint8_t reset_indicator; + + + + + + +typedef union { + volatile uint8_t bytes[45]; + struct { + uint16_t addr; + uint8_t status; + uint8_t scratch[32];//3 + uint32_t counter; //35 + uint32_t zero; //39 + uint16_t crc; //43 + }; +} counterpack_t; +counterpack_t pack; + +volatile uint8_t lastcps; +typedef union { + uint32_t c32[4]; + uint8_t c8[16]; +} counters_t; + +volatile counters_t counters; + +volatile uint8_t istat; +volatile uint8_t changefromeeprom; + + + +#if defined(__AVR_ATtiny24__)||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 +#define PIN_CH2 (1<<PINA4) +#define PIN_CH3 (1<<PINA5) +#define PIN_CH0 (1<<PINA6) +#define PIN_CH1 (1<<PINA7) +#define PORT_EE PINA //WARNING have to be the same PORT like PINREG because of istat +#define PIN_EE (1<<PINA0) +#define TEST_TIMER ((TIMSK0 & (1<<TOIE0))==0) + +#endif + + +ISR(PCINT0_vect) { + if (((PIN_REG&PIN_CH2)==0)&&((istat&PIN_CH2)==PIN_CH2)) { counters.c32[2]++; } + if (((PIN_REG&PIN_CH3)==0)&&((istat&PIN_CH3)==PIN_CH3)) { counters.c32[3]++; } + if (((PIN_REG&PIN_CH0)==0)&&((istat&PIN_CH0)==PIN_CH0)) { counters.c32[0]++; } + if (((PIN_REG&PIN_CH1)==0)&&((istat&PIN_CH1)==PIN_CH1)) { counters.c32[1]++; } + istat=PIN_REG; + changefromeeprom=1; +} + + +ISR(ANA_COMP_vect) { + if (changefromeeprom==0) return; + if ((ACSR&(1<<ACO))!=0) { + _delay_ms(5); + if ((ACSR&(1<<ACO))!=0) { + CLKPR=0x80;//Switch to 4 MHz + CLKPR=01; + + PORTB|=(1<<PINB1); + EEARH=0; + for(uint8_t i=0;i<16;i++) { + uint8_t addr=i^0x0C; + while(EECR & (1<<EEPE)); + EECR = (0<<EEPM1)|(0<<EEPM0); + EEARL = i; + EEDR = counters.c8[addr]; + EECR |= (1<<EEMPE); + EECR |= (1<<EEPE); + } + changefromeeprom=0; + PORTB&=~(1<<PINB1); + CLKPR=0x80; + CLKPR=0; + GIFR|=(1<<INTF0); + } + } + +} + +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)|(1<<PRADC); //Switch off usi and adc for save Power + OWINIT(); + + pack.zero=0; + counters.c32[0]=0; + counters.c32[2]=0; + counters.c32[1]=0; + counters.c32[3]=0; + changefromeeprom=1; + ACSR|=(1<<ACD); //Disable Comparator + ADCSRB|=(1<<ACME); //Disable Analog multiplexer + MCUCR &=~(1<<PUD); //All Pins Pullup... + +#if defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__) || defined(__AVR_ATtiny84A__) + + PORTB|=0xFF-(1<<PINB2); //Make PullUp an all Pins but not OW_PIN + PORTA|=0xFF; + PORTA&=~(1<<PINA2); //AIN1 +#ifndef _CPULLUP_ + PORTA&=~((1<<PINA4)|(1<<PINA5)); + PORTA&=~((1<<PINA6)|(1<<PINA7)); + #endif + + GIMSK|=(1<<PCIE0); + PCMSK0=(1<<PCINT4)|(1<<PCINT5) + |(1<<PCINT6)|(1<<PCINT7); + + + istat=PINB; +#endif + + EEARH=0; + + uint8_t addr; + + if (testSW()) { //Jumper gesetzt ->Ruecksetzen + for(uint8_t i=0;i<16;i++) { + while(EECR & (1<<EEPE)); + EECR = (0<<EEPM1)|(0<<EEPM0); + EEARL = i; + EEDR = 0; + EECR |= (1<<EEMPE); + EECR |= (1<<EEPE); + } + } + + + for(uint8_t i=0;i<16;i++) { + addr=i^0x0C; + while(EECR & (1<<EEPE)); + EEARL=i; + EECR |= (1<<EERE); + counters.c8[addr]=EEDR; + } + changefromeeprom=0; //Daten neu eingelesen + for (uint8_t i=0;i<4;i++) { + if (counters.c32[i]==0xFFFFFFFF) { + counters.c32[i]=0; + changefromeeprom=1; //Daten geaendert + } + //counters.c32[i]=0; + } + + + /*for(uint8_t i=0;i<16;i++) { + while(EECR & (1<<EEPE)); + EECR = (1<<EEPM0); + EEARL = i; + EECR |= (1<<EEMPE); + EECR |= (1<<EEPE); + }*/ + + + + + DIDR0|=(1<<ADC2D)|(1<<ADC1D); // Disable Digital input on Analog AIN0/AIN1 (PINA1 / PINA2) + ACSR&=~(1<<ACD); + ACSR|=(1<<ACIE)|(1<<ACIS1)|(1<<ACIS0)|(1<<ACBG); //Enabble comperator interrupt Rising edge....(1<<ACIS0) + + sei(); + DDRB|=(1<<PINB1); + PORTB&=~(1<<PINB1); + while(1) { + + MCUCR|=(1<<SE); + MCUCR&=~(1<<SM1); + asm("SLEEP"); + } +} \ No newline at end of file diff --git a/DS2423 - Autosave/DS2423.cproj b/DS2423 - Autosave/DS2423.cproj new file mode 100644 index 0000000..be31af6 --- /dev/null +++ b/DS2423 - Autosave/DS2423.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>{26106a5a-6618-4774-943f-65c46ddb610b}</ProjectGuid> + <avrdevice>ATtiny84A</avrdevice> + <avrdeviceseries>none</avrdeviceseries> + <OutputType>Executable</OutputType> + <Language>C</Language> + <OutputFileName>$(MSBuildProjectName)</OutputFileName> + <OutputFileExtension>.elf</OutputFileExtension> + <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory> + <AssemblyName>DS2423</AssemblyName> + <Name>DS2423</Name> + <RootNamespace>DS2423</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\OWDS2423.S"> + <SubType>compile</SubType> + <Link>OWDS2423.S</Link> + </Compile> + <Compile Include="DS2423.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/DS2423.c b/DS2423/DS2423.c index cdca3e4..ccc2d30 100644 --- a/DS2423/DS2423.c +++ b/DS2423/DS2423.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -54,7 +54,7 @@ extern void OWINIT(); uint8_t owid[8]={0x1D, 0xA2, 0xD9, 0x84, 0x00, 0x26, 0x02, 0x5C};/**/ -uint8_t config_info[18]={9,13,9,13,9,13,9,13,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //+2 for CRC +uint8_t config_info[26]={9,13,9,13,9,13,9,13,0x02,19,19,19,19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; //+2 for CRC diff --git a/DS2423_BMP280/DS2423_BMP280.c b/DS2423_BMP280/DS2423_BMP280.c index d3aa7b4..13dccc2 100644 --- a/DS2423_BMP280/DS2423_BMP280.c +++ b/DS2423_BMP280/DS2423_BMP280.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x1D, 0xA2, 0xD9, 0x84, 0x00, 0x26, 0x02, 0x5C};/**/ -uint8_t config_info[18]={0x09,0x0D,0x09,0x0D,0x01,0x08,0x02,0x08,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x00,0x00,0x00,0x00,0x01,0x08,0x02,0x08,0x02,0x00,0x00,14,14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/DS2423_komische platine/DS2423.c b/DS2423_komische platine/DS2423.c index b1c6332..13b33dc 100644 --- a/DS2423_komische platine/DS2423.c +++ b/DS2423_komische platine/DS2423.c @@ -1,5 +1,5 @@ -// Copyright (c) 2016, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -45,7 +45,7 @@ extern void OWINIT(); uint8_t owid[8]={0x1D, 0xA2, 0xD9, 0x84, 0x00, 0x26, 0x02, 0x5C};/**/ -uint8_t config_info[18]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={9,13,9,13,9,13,9,13,0x02,19,19,19,19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/DS2423_komische platine/DS2423.cproj b/DS2423_komische platine/DS2423.cproj index 8958294..7adde5a 100644 --- a/DS2423_komische platine/DS2423.cproj +++ b/DS2423_komische platine/DS2423.cproj @@ -1,149 +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>{26106a5a-6618-4774-943f-65c46ddb610b}</ProjectGuid> - <avrdevice>ATtiny84A</avrdevice> - <avrdeviceseries>none</avrdeviceseries> - <OutputType>Executable</OutputType> - <Language>C</Language> - <OutputFileName>$(MSBuildProjectName)</OutputFileName> - <OutputFileExtension>.elf</OutputFileExtension> - <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory> - <AssemblyName>DS2423</AssemblyName> - <Name>DS2423</Name> - <RootNamespace>DS2423</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 xmlns=""> - <options /> - <configurations /> - <files /> - <documentation help="" /> - <offline-documentation help="" /> - <dependencies> - <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" /> - </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> - <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.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\OWDS2423.S"> - <SubType>compile</SubType> - <Link>OWDS2423.S</Link> - </Compile> - <Compile Include="DS2423.c"> - <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"> + <PropertyGroup> + <SchemaVersion>2.0</SchemaVersion> + <ProjectVersion>7.0</ProjectVersion> + <ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName> + <ProjectGuid>{26106a5a-6618-4774-943f-65c46ddb610b}</ProjectGuid> + <avrdevice>ATtiny84A</avrdevice> + <avrdeviceseries>none</avrdeviceseries> + <OutputType>Executable</OutputType> + <Language>C</Language> + <OutputFileName>$(MSBuildProjectName)</OutputFileName> + <OutputFileExtension>.elf</OutputFileExtension> + <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory> + <AssemblyName>DS2423</AssemblyName> + <Name>DS2423</Name> + <RootNamespace>DS2423</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 xmlns=""> + <options /> + <configurations /> + <files /> + <documentation help="" /> + <offline-documentation help="" /> + <dependencies> + <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.22.0" /> + </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> + <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.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\OWDS2423.S"> + <SubType>compile</SubType> + <Link>OWDS2423.S</Link> + </Compile> + <Compile Include="DS2423.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.c b/DS2438_DHT22/DS2438_DHT22.c index d2fbef2..d928313 100644 --- a/DS2438_DHT22/DS2438_DHT22.c +++ b/DS2438_DHT22/DS2438_DHT22.c @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -44,7 +44,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0xDD, 0xDD, 0x05, 0xCE};/**/ -uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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}; diff --git a/DS2438_HDC1080/DS2438_HDC1080.c b/DS2438_HDC1080/DS2438_HDC1080.c index a41484a..63466f6 100644 --- a/DS2438_HDC1080/DS2438_HDC1080.c +++ b/DS2438_HDC1080/DS2438_HDC1080.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -46,8 +46,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x00, 0x05, 0x16};/**/ -uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -//uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x08, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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; @@ -87,7 +86,7 @@ volatile uint16_t am2302_hum; uint8_t userRegister[1]; int16_t sRH,sT; -volatile double temperatureC,humidityRH; +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__) diff --git a/DS2438_HDC1080/DS2438_HDC1080.cproj b/DS2438_HDC1080/DS2438_HDC1080.cproj index cfd65db..9bf4659 100644 --- a/DS2438_HDC1080/DS2438_HDC1080.cproj +++ b/DS2438_HDC1080/DS2438_HDC1080.cproj @@ -1,149 +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_HDC1080</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 xmlns=""> - <options /> - <configurations /> - <files /> - <documentation help="" /> - <offline-documentation help="" /> - <dependencies> - <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.26.0" /> - </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\HDC1080.c"> - <SubType>compile</SubType> - <Link>HDC1080.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> - <SubType>compile</SubType> - <Link>USI_TWI_Master.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\OWDS2438.S"> - <SubType>compile</SubType> - <Link>OWDS2438.S</Link> - </Compile> - <Compile Include="DS2438_HDC1080.c"> - <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"> + <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_HDC1080</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 xmlns=""> + <options /> + <configurations /> + <files /> + <documentation help="" /> + <offline-documentation help="" /> + <dependencies> + <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.26.0" /> + </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\HDC1080.c"> + <SubType>compile</SubType> + <Link>HDC1080.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> + <SubType>compile</SubType> + <Link>USI_TWI_Master.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\OWDS2438.S"> + <SubType>compile</SubType> + <Link>OWDS2438.S</Link> + </Compile> + <Compile Include="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/DS2438_HIH9121/DS2438_HIH9121.c b/DS2438_HIH9121/DS2438_HIH9121.c index 6c59d8c..3887e4c 100644 --- a/DS2438_HIH9121/DS2438_HIH9121.c +++ b/DS2438_HIH9121/DS2438_HIH9121.c @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -46,8 +46,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x00, 0x05, 0x16};/**/ -uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -//uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x08, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,0x10,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; extern uint8_t mode; diff --git a/DS2438_SHT2X/DS2438_SHT2X.c b/DS2438_SHT2X/DS2438_SHT2X.c index eef88e3..eb182ef 100644 --- a/DS2438_SHT2X/DS2438_SHT2X.c +++ b/DS2438_SHT2X/DS2438_SHT2X.c @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -47,8 +47,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x00, 0x05, 0x16};/**/ -uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -//uint8_t config_info[16]={0x01,0x06, 0x05,0x08, 0x04,0x08, 0x00,0x00, 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x01,0x06, 0x05,0x08, 0x04,0x07, 0x00,0x00, 0x02,0x07,0x00,0x07,0x00,0x00,0x00,0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; extern uint8_t mode; diff --git a/DS2450/DS2450.c b/DS2450/DS2450.c index 6a89067..945ebeb 100644 --- a/DS2450/DS2450.c +++ b/DS2450/DS2450.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/ -uint8_t config_info[18]={0x06,0x09,0x06,0x09,0x06,0x09,0x06,0x09,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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" diff --git a/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.c b/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.c index 8b3678b..78ab3b0 100644 --- a/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.c +++ b/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.c @@ -1,5 +1,4 @@ - -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -45,8 +44,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/ -uint8_t config_info[18]={0x01,14,0x04,0x08, 0x06,0x09, 0x02,16,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - +uint8_t config_info[26]={0x01,14,0x04,0x08, 0,0, 0x02,16,0x02,0x07,0x07,0x00,14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if (owid>128) #error "Variable not correct" #endif diff --git a/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.cproj b/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.cproj index 101ac51..54ca3e6 100644 --- a/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.cproj +++ b/DS2450_SHT2X_BMP280/DS2450_SHT2X_BMP280.cproj @@ -1,146 +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_SHT2X_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 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> - </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="D:\oc\dev\owSlave2\common\I2C\BMP280.c"> - <SubType>compile</SubType> - <Link>BMP280.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\SHT2x.c"> - <SubType>compile</SubType> - <Link>SHT2x.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> - <SubType>compile</SubType> - <Link>USI_TWI_Master.c</Link> - </Compile> - <Compile Include="DS2450_SHT2X_BMP280.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_SHT2X_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 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> + </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\SHT2x.c"> + <SubType>compile</SubType> + <Link>SHT2x.c</Link> + </Compile> + <Compile Include="..\common\I2C\USI_TWI_Master.c"> + <SubType>compile</SubType> + <Link>USI_TWI_Master.c</Link> + </Compile> + <Compile Include="DS2450_SHT2X_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_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c b/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c index 842c9ea..683b765 100644 --- a/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c +++ b/DS2450_SHT2X_BMP280_MAX44009/DS2450_SHT2X_BMP280_MAX44009.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/ -uint8_t config_info[18]={0x01,14,0x04,0x08, 0x03,15, 0x02,16,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +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}; #if (owid>128) #error "Variable not correct" diff --git a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c index e6f570a..8f5d4f9 100644 --- a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c +++ b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -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[18]={0x01,14,0x04,0x08, 0x03,15, 0x06,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x01,14,0x04,0x08, 0x03,15,0,0,2,7,7,15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if (owid>128) #error "Variable not correct" diff --git a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj index 7924bc2..59f8dce 100644 --- a/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj +++ b/DS2450_SHT2X_MAX44009/DS2450_SHT2X_MAX44009.cproj @@ -1,150 +1,150 @@ -<?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_SHT2X_MAX44009</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 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> - </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="D:\oc\dev\owSlave2\common\I2C\MAX44009.c"> - <SubType>compile</SubType> - <Link>MAX44009.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\SHT2x.c"> - <SubType>compile</SubType> - <Link>SHT2x.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\TSL256x.c"> - <SubType>compile</SubType> - <Link>TSL256x.c</Link> - </Compile> - <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> - <SubType>compile</SubType> - <Link>USI_TWI_Master.c</Link> - </Compile> - <Compile Include="DS2450_SHT2X_MAX44009.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_SHT2X_MAX44009</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 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> + </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="D:\oc\dev\owSlave2\common\I2C\MAX44009.c"> + <SubType>compile</SubType> + <Link>MAX44009.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\I2C\SHT2x.c"> + <SubType>compile</SubType> + <Link>SHT2x.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\I2C\TSL256x.c"> + <SubType>compile</SubType> + <Link>TSL256x.c</Link> + </Compile> + <Compile Include="D:\oc\dev\owSlave2\common\I2C\USI_TWI_Master.c"> + <SubType>compile</SubType> + <Link>USI_TWI_Master.c</Link> + </Compile> + <Compile Include="DS2450_SHT2X_MAX44009.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_BMP/DS2450.cproj b/DS2450_VOC_SHT_BMP/DS2450.cproj index 491b6b0..a57e18a 100644 --- a/DS2450_VOC_SHT_BMP/DS2450.cproj +++ b/DS2450_VOC_SHT_BMP/DS2450.cproj @@ -1,153 +1,153 @@ -<?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</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 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> - </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.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\MAX1164x.c"> - <SubType>compile</SubType> - <Link>MAX1164x.c</Link> - </Compile> - <Compile Include="..\common\I2C\SHT2x.c"> - <SubType>compile</SubType> - <Link>SHT2x.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_VOC_SHT_BMP.c"> - <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</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 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> + </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.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\MAX1164x.c"> + <SubType>compile</SubType> + <Link>MAX1164x.c</Link> + </Compile> + <Compile Include="..\common\I2C\SHT2x.c"> + <SubType>compile</SubType> + <Link>SHT2x.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_VOC_SHT_BMP.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_VOC_SHT_BMP/DS2450_VOC_SHT_BMP.c b/DS2450_VOC_SHT_BMP/DS2450_VOC_SHT_BMP.c index 660dd28..ef34dfb 100644 --- a/DS2450_VOC_SHT_BMP/DS2450_VOC_SHT_BMP.c +++ b/DS2450_VOC_SHT_BMP/DS2450_VOC_SHT_BMP.c @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ extern void OWINIT(); extern void EXTERN_SLEEP(); uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/ -uint8_t config_info[18]={0x01,14, 0x04,0x08, 0x08,1, 0x02,16,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={0x01,14, 0x04,0x08, 0x08,1, 0x02,16,0x02,7,7,17,14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if (owid>128) #error "Variable not correct" diff --git a/common/I2C/CDM7160.c b/common/I2C/CDM7160.c new file mode 100644 index 0000000..65fc393 --- /dev/null +++ b/common/I2C/CDM7160.c @@ -0,0 +1,137 @@ +// 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 F_CPU 8000000UL +#include <avr/io.h> + +#include <util/delay.h> + + +#include "USI_TWI_Master.h" +#include "CDM7160.h" + + + + +uint16_t CDM7160getCO2_() { + volatile uint8_t b1,b2; + while((PINA&(1<<PINA0))!=0); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x03); + I2c_StartCondition(); + I2c_WriteByte (0b11010011); + b1 =I2c_ReadByte(ACK); + b2 =I2c_ReadByte(NO_ACK); + I2c_StopCondition(); + + return b1|(b2<<8); + + + +} +uint16_t CDM7160getCO2() { + volatile uint8_t b[16],i; + while((PINA&(1<<PINA0))!=0); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x00); + I2c_StartCondition(); + I2c_WriteByte (0b11010011); + for(i=0;i<15;i++) { + b[i] =I2c_ReadByte(ACK); + } + b[15] =I2c_ReadByte(NO_ACK); + I2c_StopCondition(); + + return b[3]|(b[4]<<8); + + + +} + +void CDM7160setMode(uint8_t mode) { + while((PINA&(1<<PINA0))!=0); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x01); + I2c_StartCondition(); + I2c_WriteByte (0b11010011); + uint8_t b =I2c_ReadByte(NO_ACK); + I2c_StopCondition(); + _delay_ms(2); + b&=0xFC; + b|=(mode<<1)&0x3; + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x01); + I2c_WriteByte(b); + I2c_StopCondition(); +} + +void CDM7160softReset() { + while((PINA&(1<<PINA0))!=0); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x00); + I2c_WriteByte(0x01); + I2c_StopCondition(); +} + + +void CDM7160setFMode(uint8_t fmode) //Set Filtermode 0 average, 1 IIR +{ + while((PINA&(1<<PINA0))!=0); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x01); + I2c_StartCondition(); + I2c_WriteByte (0b11010011); + volatile uint8_t b =I2c_ReadByte(NO_ACK); + I2c_StopCondition(); + _delay_ms(2); + b&=0xFB; + b|=((fmode&1)<<2); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x01); + I2c_WriteByte(b); + I2c_StopCondition(); +} +void CDM7160setAvCount(uint8_t count) {//Set the Averaging count + while((PINA&( 1<<PINA0))!=0); + I2c_StartCondition(); + I2c_WriteByte(0b11010010); + I2c_WriteByte(0x07); + I2c_WriteByte(count&0x3F); + I2c_StopCondition(); + +}; diff --git a/common/I2C/CDM7160.h b/common/I2C/CDM7160.h new file mode 100644 index 0000000..a3bf902 --- /dev/null +++ b/common/I2C/CDM7160.h @@ -0,0 +1,42 @@ +#ifndef MAX44009_H +#define MAX44009_H +// 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. + +uint16_t CDM7160getCO2(); +void CDM7160setMode(uint8_t mode); //0 Power Down 1 Continuous +void CDM7160softReset(); +void CDM7160setFMode(uint8_t fmode); //Set Filtermode 0 average, 1 IIR +void CDM7160setAvCount(uint8_t count); //Set the Averaging count + + +#endif \ No newline at end of file diff --git a/common/OWCRC16.s b/common/OWCRC16.s index c3cff91..16da4f4 100644 --- a/common/OWCRC16.s +++ b/common/OWCRC16.s @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/common/OWConfig.s b/common/OWConfig.s index c41ce6c..9fd65c7 100644 --- a/common/OWConfig.s +++ b/common/OWConfig.s @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/common/OWDS18B20_DS2438.S b/common/OWDS18B20_DS2438.S index 3694b11..109891d 100644 --- a/common/OWDS18B20_DS2438.S +++ b/common/OWDS18B20_DS2438.S @@ -1,5 +1,5 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/common/OWDS2423.S b/common/OWDS2423.S index 0fb23d8..1abee6a 100644 --- a/common/OWDS2423.S +++ b/common/OWDS2423.S @@ -1,5 +1,4 @@ - -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/common/OWRomFunctions.s b/common/OWRomFunctions.s index 30731e7..fb1d85b 100644 --- a/common/OWRomFunctions.s +++ b/common/OWRomFunctions.s @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -314,16 +314,16 @@ h_readrom_all: ;--------------------------------------------------- h_fwconfiginfo: - cpi r_bytep,16 + cpi r_bytep,24 breq h_fwconfiginfo_crc #ifdef _CRC8_ - cpi r_bytep,17 + cpi r_bytep,25 breq h_fwconfiginfo_all #elif defined _CRC16_ - cpi r_bytep,18 + cpi r_bytep,26 breq h_fwconfiginfo_all #else - cpi r_bytep,16 + cpi r_bytep,25 breq h_fwconfiginfo_all #warning No CRC known code implemented #endif @@ -338,10 +338,10 @@ h_fwconfiginfo_crc: #elif defined _CRC16_ lds r_temp,crc com r_temp - sts config_info+16,r_temp + sts config_info+24,r_temp lds r_temp,crc+1 com r_temp - sts config_info+17,r_temp + sts config_info+25,r_temp rjmp h_fwconfiginfo_end #endif h_fwconfiginfo_all: diff --git a/common/OWRomFunctionsDual.s b/common/OWRomFunctionsDual.s index cb4ac7f..3c2d152 100644 --- a/common/OWRomFunctionsDual.s +++ b/common/OWRomFunctionsDual.s @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -401,29 +401,36 @@ h_fwconfiginfo2: configZ config_info2,r_bytep h_fwconfiginfo_go: - cpi r_bytep,16 + cpi r_bytep,24 breq h_fwconfiginfo_crc #ifdef _CRC8_ - cpi r_bytep,17 + cpi r_bytep,25 breq h_fwconfiginfo_all #elif defined _CRC16_ - cpi r_bytep,17 - breq h_fwconfiginfo_crc2 - cpi r_bytep,18 + cpi r_bytep,26 breq h_fwconfiginfo_all #else - cpi r_bytep,16 + cpi r_bytep,25 breq h_fwconfiginfo_all #warning No CRC known code implemented #endif +h_fwconfiginfo_end: + //configZ config_info1,r_bytep //crc16 wird in config_info1 gespeichert, auch bei config_info2 ld r_rwbyte,Z rjmp handle_end_inc h_fwconfiginfo_crc: +#ifdef _CRC8_ lds r_rwbyte,crc rjmp handle_end_inc -h_fwconfiginfo_crc2: - lds r_rwbyte,crc+1 - rjmp handle_end_inc +#elif defined _CRC16_ + lds r_temp,crc + com r_temp + sts config_info1+24,r_temp + lds r_temp,crc+1 + com r_temp + sts config_info1+25,r_temp + rjmp h_fwconfiginfo_end +#endif h_fwconfiginfo_all: rjmp handle_end_sleep @@ -630,8 +637,8 @@ owinit_odgen2: ;copy ids in config bytes ldi xl,lo8(owid1) ldi xh,hi8(owid1) - ldi yl,lo8(config_info2+9) - ldi yh,hi8(config_info2+9) + ldi yl,lo8(config_info2+17) + ldi yh,hi8(config_info2+17) ldi r_temp,7 owinit_cpconfig1: ld r_rwbyte,X+ @@ -640,8 +647,8 @@ owinit_cpconfig1: brne owinit_cpconfig1 ldi xl,lo8(owid2) ldi xh,hi8(owid2) - ldi yl,lo8(config_info1+9) - ldi yh,hi8(config_info1+9) + ldi yl,lo8(config_info1+17) + ldi yh,hi8(config_info1+17) ldi r_temp,7 owinit_cpconfig2: ld r_rwbyte,X+ diff --git a/common/OWSet_ATTINYX4.s b/common/OWSet_ATTINYX4.s index 4ddead1..6440eae 100644 --- a/common/OWSet_ATTINYX4.s +++ b/common/OWSet_ATTINYX4.s @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/common/OWTimerInterrupt.s b/common/OWTimerInterrupt.s index 1ad0afc..349be8a 100644 --- a/common/OWTimerInterrupt.s +++ b/common/OWTimerInterrupt.s @@ -1,4 +1,4 @@ -// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// Copyright (c) 2017, Tobias Mueller tm(at)tm3d.de // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -37,17 +37,23 @@ TIMER_INTERRUPT: push r_temp in r_temp,_SFR_IO_ADDR(SREG) push r_temp + push r_temp2 cdb sbic OW_PIN,OW_PINN ; abkuerzung wenn Leitung schon h rjmp tint_end ; Leitung 1 kein Reset ldi r_temp,0 out TCNT_REG,r_temp CLEAR_TOV_FLAG + ldi r_temp2,3 ;3x overrun for timeout tint_loop_rend: + JMP_NO_TOV ;ueberspringe wenn kein ueberlauf + rjmp tint_handle_timeout sbis OW_PIN,OW_PINN ;warten bis leitung wieder h rjmp tint_loop_rend - JMP_NO_TOV ;ueberspringe wenn kein ueberlauf - rjmp tint_overrun + ;JMP_NO_TOV ;ueberspringe wenn kein ueberlauf + cpi r_temp2,3 + ;rjmp tint_overrun + brne tint_overrun in r_temp,TCNT_REG ;schauen ob es lange genug gedauert hat fuer reset cpi r_temp,OWT_RESET2 brlo tint_end @@ -79,8 +85,15 @@ tint_loop_pres: tint_end: ;CLEAR_INTERRUPT_FLAG DIS_TIM_INT + pop r_temp2 pop r_temp out _SFR_IO_ADDR(SREG),r_temp pop r_temp reti ;;; + +tint_handle_timeout: + dec r_temp2 + breq tint_end + CLEAR_TOV_FLAG + rjmp tint_loop_rend \ No newline at end of file diff --git a/programmer/programmer/programmer.asm b/programmer/programmer/programmer.asm index cccdd18..5a51e4e 100644 --- a/programmer/programmer/programmer.asm +++ b/programmer/programmer/programmer.asm @@ -83,7 +83,7 @@ jreset: .ORG 0x0EC0 - +//7552 Byte start: cli ldi temp,0 -- 2.34.1