From: Tobias Date: Thu, 24 Sep 2015 16:34:43 +0000 (+0200) Subject: Rename Files of different Devices X-Git-Url: https://git.smho.de/?a=commitdiff_plain;h=a8381e5cea363746ce596f2b57e3dbe13d0a15a6;p=owSlave2.git Rename Files of different Devices Include Config Bytes with ow command 0x85 to get more information of an device (not finished, part 1) --- diff --git a/DS18B20_BMP280/DS18B20_BMP280.atsln b/DS18B20_BMP280/DS18B20_BMP280.atsln new file mode 100644 index 0000000..764eb5c --- /dev/null +++ b/DS18B20_BMP280/DS18B20_BMP280.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}") = "DS18B20_BMP280", "DS18B20_BMP280.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DS18B20_BMP280/DS18B20_BMP280.c b/DS18B20_BMP280/DS18B20_BMP280.c new file mode 100644 index 0000000..ca6333b --- /dev/null +++ b/DS18B20_BMP280/DS18B20_BMP280.c @@ -0,0 +1,149 @@ + +// 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 +#include +#include +#include +#include +#include +#include "../common/I2C/USI_TWI_Master.h" +#include "../common/I2C/BMP280.h" + + +extern void OWINIT(); + + + + +uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ +uint8_t config_info[16]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x10,0x11,0x12,0x13,0x14,0x15,0x16}; + +#if (owid>128) +#error "Variable not correct" +#endif + +extern uint8_t mode; +extern uint8_t gcontrol; +extern uint8_t reset_indicator; +extern uint8_t alarmflag; + + + + +typedef union { + volatile uint8_t bytes[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<>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(); + gcontrol=0; + } + + +#if defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) + if (((TIMSK & (1< + + + 2.0 + 6.2 + com.Atmel.AVRGCC8.C + {7a5672fe-8226-4158-b931-e1f36b9a8858} + ATtiny84A + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + DS18B20_BMP280 + DS18B20_BMP280 + DS18B20_BMP280 + Native + true + false + true + true + 0x20000000 + + true + exception_table + 2 + 1 + + + + + + + + + + + + + com.atmel.avrdbg.tool.atmelice + + + + + debugWIRE + + com.atmel.avrdbg.tool.atmelice + J41800000779 + Atmel-ICE + + debugWIRE + + + + + + + + com.atmel.avrdbg.tool.simulator + + + Simulator + + + + + + True + True + True + True + False + True + True + + + NDEBUG + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + + + + + True + True + True + True + False + True + True + + + DEBUG + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + + + + + + compile + BMP280.c + + + compile + USI_TWI_Master.c + + + compile + + + compile + + + + \ No newline at end of file diff --git a/DS18B20_BMP280/OWDS18B20.S b/DS18B20_BMP280/OWDS18B20.S new file mode 100644 index 0000000..0ad51b6 --- /dev/null +++ b/DS18B20_BMP280/OWDS18B20.S @@ -0,0 +1,236 @@ + +// Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the +// distribution. +// * All advertising materials mentioning features or use of this +// software must display the following acknowledgement: This product +// includes software developed by tm3d.de and its contributors. +// * Neither the name of tm3d.de nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#define _CHANGEABLE_ID_ +#define _ZERO_POLLING_ + +#include "../common/OWConfig.s" +#include "../common/OWCRC8.s" + +.extern pack,8 + +//.extern am2302_temp,2 + + + +.macro CHIP_INIT +Init_EEPROM_read: + sbic _SFR_IO_ADDR(EECR), EEPE + rjmp Init_EEPROM_read + ldi r_temp,0 + out _SFR_IO_ADDR(EEARH), r_temp + ldi r_temp,2 + out _SFR_IO_ADDR(EEARL), r_temp + sbi _SFR_IO_ADDR(EECR), EERE + in r_temp,_SFR_IO_ADDR(EEDR) + sbrs r_temp,7 + rcall hrc_recall_eeprom_func +.endm + +.macro COMMAND_TABLE + rjmp h_readscratchpad + rjmp h_writescratchpad +.endm + +#include "../common/OWRomFunctions.s" +#include "../common/OWTimerInterrupt.s" + + + +; Ab hier Geraeteabhaenging +#define OW_READ_SCRATCHPAD OW_FIRST_COMMAND+0 +#define OW_WRITE_SCRATCHPAD OW_FIRST_COMMAND+1 + + +;--------------------------------------------------- +; READ COMMAND and start operation +;--------------------------------------------------- + + +h_readcommand: + clr r_bytep +#ifndef _DIS_FLASH_ + FLASH_COMMANDS ; muss zu erst sein.... +#endif + cjmp 0xBE,hrc_set_readscratchpad + cjmp 0x4E,hrc_set_writescratchpad + cjmp 0x44,hrc_set_convertT + cjmp 0x48,hrc_copy_scratchpad + cjmp 0xB8,hrc_recall_eeprom + FW_CONFIG_INFO +#ifdef _CHANGEABLE_ID_ + CHANGE_ID_COMMANDS +#endif + //ldi r_mode,OW_SLEEP + rjmp handle_end_sleep + +hrc_set_readscratchpad: + ldi r_mode,OW_READ_SCRATCHPAD + ldi r_sendflag,1 + CRCInit2 + rjmp h_readscratchpad + +hrc_set_writescratchpad: + ldi r_mode,OW_WRITE_SCRATCHPAD + ldi r_bytep,2 ;start to write in 2 + rjmp handle_end + +hrc_recall_eeprom: + rcall hrc_recall_eeprom_func + rjmp handle_end + + + +hrc_set_convertT: + ldi r_temp,1 + sts gcontrol,r_temp + ;lds temp,am2302_temp + //sts pack+1,temp + ;lds temp,am2302_temp+1 + //sts pack+2,temp +; ldi r_rwbyte,0 +; lds r_temp,pack +; swap r_temp +; andi r_temp,0x0F +; lds r_temp2,pack+1 +; swap r_temp2 +; andi r_temp2,0xF0 +; or r_temp,r_temp2 +; lds r_temp2,pack+2 +; cp r_temp,r_temp2 ;higher than or equal to TH +; brge hrc_set_convertT_set_arlarm +; lds r_temp2,pack+3 +; cp r_temp,r_temp2 ;lower than or equal to TL +; brlt hrc_set_convertT_set_arlarm +; breq hrc_set_convertT_set_arlarm +; rjmp hrc_set_convertT_end +;hrc_set_convertT_set_arlarm: +; ldi r_rwbyte,1 +;hrc_set_convertT_end: +; sts alarmflag,r_rwbyte + rjmp handle_end_sleep + + +hrc_copy_scratchpad: + ldi r_bytep,2 + configZ pack,r_bytep + clr r_bytep +hrc_copy_scratchpad_EEPROM_write: + sbic _SFR_IO_ADDR(EECR), EEPE + rjmp hrc_copy_scratchpad_EEPROM_write + ldi r_temp, (0<128) #error "Variable not correct" diff --git a/DS18B20_DS2438/OWDS18B20_DS2438.S b/DS18B20_DS2438/OWDS18B20_DS2438.S index d0503b7..bf7146e 100644 --- a/DS18B20_DS2438/OWDS18B20_DS2438.S +++ b/DS18B20_DS2438/OWDS18B20_DS2438.S @@ -104,6 +104,7 @@ h_readcommand1: cjmp 0x44,hrc_set_convertT1 cjmp 0x48,hrc_copy_scratchpad1 cjmp 0xB8,hrc_recall_eeprom1 + FW_CONFIG_INFO1 #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif @@ -239,6 +240,7 @@ h_readcommand2: cset 0x4E,OW_WRITE_SCRATCHPAD_ADR2 cjmp 0x44,hrc_set_convertT2 cjmp 0xB4,hrc_set_convertV2 + FW_CONFIG_INFO2 #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif diff --git a/DS18B20_MAX44009/DS18B20.atsln b/DS18B20_MAX44009/DS18B20.atsln deleted file mode 100644 index 558a11d..0000000 --- a/DS18B20_MAX44009/DS18B20.atsln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Atmel Studio Solution File, Format Version 11.00 -Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20", "DS18B20.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_MAX44009/DS18B20.c b/DS18B20_MAX44009/DS18B20.c deleted file mode 100644 index 12e682b..0000000 --- a/DS18B20_MAX44009/DS18B20.c +++ /dev/null @@ -1,147 +0,0 @@ - -// 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 -#include -#include -#include -#include -#include -#include "../common/I2C/USI_TWI_Master.h" -#include "../common/I2C/MAX44009.h" - - -extern void OWINIT(); - - - - -uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ - -#if (owid>128) -#error "Variable not correct" -#endif - -extern uint8_t mode; -extern uint8_t gcontrol; -extern uint8_t reset_indicator; -extern uint8_t alarmflag; - - - - -typedef union { - volatile uint8_t bytes[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<>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(); - gcontrol=0; - } - - -#if defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) - if (((TIMSK & (1< - - - 2.0 - 6.2 - com.Atmel.AVRGCC8.C - {7a5672fe-8226-4158-b931-e1f36b9a8858} - ATtiny84A - none - Executable - C - $(MSBuildProjectName) - .elf - $(MSBuildProjectDirectory)\$(Configuration) - DS18B20 - DS18B20 - DS18B20 - Native - true - false - true - true - 0x20000000 - - true - exception_table - 2 - 1 - - - - - - - - - - - - - com.atmel.avrdbg.tool.atmelice - - - - - debugWIRE - - com.atmel.avrdbg.tool.atmelice - J41800000779 - Atmel-ICE - - debugWIRE - - - - - - - - com.atmel.avrdbg.tool.simulator - - - Simulator - - - - - - True - True - True - True - False - True - True - - - NDEBUG - - - Optimize for size (-Os) - True - True - True - - - libm - - - - - - - - - True - True - True - True - False - True - True - - - DEBUG - - - Optimize (-O1) - True - True - Default (-g2) - True - - - libm - - - Default (-Wa,-g) - - - - - - compile - MAX44009.c - - - compile - USI_TWI_Master.c - - - compile - - - compile - - - - \ No newline at end of file diff --git a/DS18B20_MAX44009/DS18B20_MAX44009.atsln b/DS18B20_MAX44009/DS18B20_MAX44009.atsln new file mode 100644 index 0000000..bce8cd3 --- /dev/null +++ b/DS18B20_MAX44009/DS18B20_MAX44009.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}") = "DS18B20_MAX44009", "DS18B20_MAX44009.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DS18B20_MAX44009/DS18B20_MAX44009.c b/DS18B20_MAX44009/DS18B20_MAX44009.c new file mode 100644 index 0000000..359d95e --- /dev/null +++ b/DS18B20_MAX44009/DS18B20_MAX44009.c @@ -0,0 +1,148 @@ + +// 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 +#include +#include +#include +#include +#include +#include "../common/I2C/USI_TWI_Master.h" +#include "../common/I2C/MAX44009.h" + + +extern void OWINIT(); + + + + +uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ +uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + +#if (owid>128) +#error "Variable not correct" +#endif + +extern uint8_t mode; +extern uint8_t gcontrol; +extern uint8_t reset_indicator; +extern uint8_t alarmflag; + + + + +typedef union { + volatile uint8_t bytes[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<>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(); + gcontrol=0; + } + + +#if defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) + if (((TIMSK & (1< + + + 2.0 + 6.2 + com.Atmel.AVRGCC8.C + {7a5672fe-8226-4158-b931-e1f36b9a8858} + ATtiny84A + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + DS18B20_MAX44009 + DS18B20_MAX44009 + DS18B20_MAX44009 + Native + true + false + true + true + 0x20000000 + + true + exception_table + 2 + 1 + + + + + + + + + + + + + com.atmel.avrdbg.tool.atmelice + + + + + debugWIRE + + com.atmel.avrdbg.tool.atmelice + J41800000779 + Atmel-ICE + + debugWIRE + + + + + + + + com.atmel.avrdbg.tool.simulator + + + Simulator + + + + + + True + True + True + True + False + True + True + + + NDEBUG + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + + + + + True + True + True + True + False + True + True + + + DEBUG + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + + + + + + compile + MAX44009.c + + + compile + USI_TWI_Master.c + + + compile + + + compile + + + + \ No newline at end of file diff --git a/DS18B20_MAX44009/OWDS18B20.S b/DS18B20_MAX44009/OWDS18B20.S index 27d7b8f..0ad51b6 100644 --- a/DS18B20_MAX44009/OWDS18B20.S +++ b/DS18B20_MAX44009/OWDS18B20.S @@ -87,6 +87,7 @@ h_readcommand: cjmp 0x44,hrc_set_convertT cjmp 0x48,hrc_copy_scratchpad cjmp 0xB8,hrc_recall_eeprom + FW_CONFIG_INFO #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif diff --git a/DS18B20_Thermocouble/DS18B20.atsln b/DS18B20_Thermocouble/DS18B20.atsln deleted file mode 100644 index 558a11d..0000000 --- a/DS18B20_Thermocouble/DS18B20.atsln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Atmel Studio Solution File, Format Version 11.00 -Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS18B20", "DS18B20.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|AVR = Debug|AVR - Release|AVR = Release|AVR - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR - {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR - {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR - {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/DS18B20_Thermocouble/DS18B20.c b/DS18B20_Thermocouble/DS18B20.c deleted file mode 100644 index 2ac3b11..0000000 --- a/DS18B20_Thermocouble/DS18B20.c +++ /dev/null @@ -1,314 +0,0 @@ - -// 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 -#include -#include -#include -#include -#include - -extern void OWINIT(); - -//const float k_rs[54] PROGMEM ={0.000000,24.125000,48.585366,72.731707,96.829268,121.097561,145.700000,170.600000,195.650000,220.625000,245.365854,269.853659,294.119048,318.195122,342.166667,366.000000,389.761905,413.428571,437.023810,460.558140,484.047619,507.511628,530.976190,554.418605,577.883721,601.395349,624.952381,648.571429,672.285714,696.073171,719.976190,744.000000,768.146341,792.439024,816.853659,841.414634,866.125000,890.975000,916.000000,941.179487,966.525000,992.025641,1017.717949,1043.589744,1069.657895,1095.945946,1122.432432,1149.184211,1176.189189,1203.472222,1231.083333,1259.000000,1287.285714,1315.941176}; -const float j_rs[70] PROGMEM ={0, 18.302913, 34.830476, 50.783019, 70.653704, 90.505455, 110.341818, 130.165455, 149.163636, 160.791071, 180.596364, 200.398214, 220.200000, 240.000000, 250.882883, 270.603636, 290.409091, 310.216364, 330.025455, 342.472727, 360.649091, 380.461818, 400.275000, 420.087273, 435.275676, 450.703636, 470.503636, 490.298214, 510.082456, 523.486726, 540.621053, 560.370175, 580.105172, 591.979487, 610.527119, 630.213559, 644.601653, 660.534426, 680.168852, 690.787097, 710.391935, 729.123810, 740.559375, 760.126562, 770.684615, 790.235385, 800.782812, 820.331250, 834.681250, 850.446032, 870.017460, 880.600000, 900.196774, 911.099187, 930.432787, 950.073333, 960.728333, 980.396667, 1000.078333, 1010.772881, 1030.475862, 1050.187931, 1065.717241, 1080.631034, 1100.358621, 1120.089655, 1131.840000,1150.556897, 1170.294737, 1190.035088}; - double gettemp_rs(double V) { - uint8_t iv=(uint8_t)(V); - float t0=pgm_read_float(&(j_rs[iv])); - float t1=pgm_read_float(&(j_rs[iv+1])); - return t0+(t1-t0)/1*(V-iv); - } - - -uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0xAC};/**/ - -#if (owid>128) -#error "Variable not correct" -#endif - -extern uint8_t mode; -extern uint8_t gcontrol; -extern uint8_t reset_indicator; -extern uint8_t alarmflag; - - -volatile uint8_t wdcounter; - - -typedef union { - volatile uint8_t bytes[8]; - struct { - uint16_t temp; //0 - uint8_t TH; //2 - uint8_t TL; //3 - uint8_t config; //4 - uint8_t rrFF; //5 - uint8_t rr00; //6 - uint8_t rr10; //7 - }; -} pack_t; -volatile pack_t pack; - - - - -#if defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__) || defined(__AVR_ATtiny84A__) -ISR(WATCHDOG_vect) { -#else -ISR(WDT_vect) { -#endif - //sleep_disable(); // Disable Sleep on Wakeup - wdcounter++; - if (reset_indicator==1) reset_indicator++; - else if (reset_indicator==2) mode=0; -/* if (timeout==2) { - DIS_TIMER; - EN_OWINT; - mode=OWM_SLEEP; - } - timeout++;*/ - //sleep_enable(); // Enable Sleep Mode - -} - - -#define OWM_PORT PORTA -#define OWM_PIN PINA -#define OWM_PINN PINA0 -#define OWM_DD DDRA - -#define OWM_SET_LOW OWM_PORT&=~(1<0) { - ares[par]=ADmess(); - par++; - if (par>15) par=0; - wdcounter=0; - } - if (gcontrol) { - PORTB|=(1<>4; - uint8_t af=0; - if (t8>pack.TH) af=1; - if (t8<=pack.TL) af=1; - cli(); - pack.temp=htemp; - alarmflag=af; - sei(); - gcontrol=0; - PORTB&=~(1< - - - 2.0 - 6.2 - com.Atmel.AVRGCC8.C - {7a5672fe-8226-4158-b931-e1f36b9a8858} - ATtiny84A - none - Executable - C - $(MSBuildProjectName) - .elf - $(MSBuildProjectDirectory)\$(Configuration) - DS18B20 - DS18B20 - DS18B20 - Native - true - false - true - true - 0x20000000 - - true - exception_table - 2 - 1 - - - - - - - - - - - - - com.atmel.avrdbg.tool.atmelice - - - - - debugWIRE - - com.atmel.avrdbg.tool.atmelice - J41800000779 - Atmel-ICE - - debugWIRE - - - - - True - True - True - True - False - True - True - - - NDEBUG - - - Optimize for size (-Os) - True - True - True - - - libm - - - - - - - - - True - True - True - True - False - True - True - - - DEBUG - - - Optimize (-O1) - True - True - Default (-g2) - True - - - libm - - - Default (-Wa,-g) - - - - - - compile - - - compile - - - - \ No newline at end of file diff --git a/DS18B20_Thermocouble/DS18B20_TC.atsln b/DS18B20_Thermocouble/DS18B20_TC.atsln new file mode 100644 index 0000000..6bb479f --- /dev/null +++ b/DS18B20_Thermocouble/DS18B20_TC.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}") = "DS18B20_TC", "DS18B20_TC.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR + {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DS18B20_Thermocouble/DS18B20_TC.c b/DS18B20_Thermocouble/DS18B20_TC.c new file mode 100644 index 0000000..bd618b4 --- /dev/null +++ b/DS18B20_Thermocouble/DS18B20_TC.c @@ -0,0 +1,315 @@ + +// 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 +#include +#include +#include +#include +#include + +extern void OWINIT(); + +//const float k_rs[54] PROGMEM ={0.000000,24.125000,48.585366,72.731707,96.829268,121.097561,145.700000,170.600000,195.650000,220.625000,245.365854,269.853659,294.119048,318.195122,342.166667,366.000000,389.761905,413.428571,437.023810,460.558140,484.047619,507.511628,530.976190,554.418605,577.883721,601.395349,624.952381,648.571429,672.285714,696.073171,719.976190,744.000000,768.146341,792.439024,816.853659,841.414634,866.125000,890.975000,916.000000,941.179487,966.525000,992.025641,1017.717949,1043.589744,1069.657895,1095.945946,1122.432432,1149.184211,1176.189189,1203.472222,1231.083333,1259.000000,1287.285714,1315.941176}; +const float j_rs[70] PROGMEM ={0, 18.302913, 34.830476, 50.783019, 70.653704, 90.505455, 110.341818, 130.165455, 149.163636, 160.791071, 180.596364, 200.398214, 220.200000, 240.000000, 250.882883, 270.603636, 290.409091, 310.216364, 330.025455, 342.472727, 360.649091, 380.461818, 400.275000, 420.087273, 435.275676, 450.703636, 470.503636, 490.298214, 510.082456, 523.486726, 540.621053, 560.370175, 580.105172, 591.979487, 610.527119, 630.213559, 644.601653, 660.534426, 680.168852, 690.787097, 710.391935, 729.123810, 740.559375, 760.126562, 770.684615, 790.235385, 800.782812, 820.331250, 834.681250, 850.446032, 870.017460, 880.600000, 900.196774, 911.099187, 930.432787, 950.073333, 960.728333, 980.396667, 1000.078333, 1010.772881, 1030.475862, 1050.187931, 1065.717241, 1080.631034, 1100.358621, 1120.089655, 1131.840000,1150.556897, 1170.294737, 1190.035088}; + double gettemp_rs(double V) { + uint8_t iv=(uint8_t)(V); + float t0=pgm_read_float(&(j_rs[iv])); + float t1=pgm_read_float(&(j_rs[iv+1])); + return t0+(t1-t0)/1*(V-iv); + } + + +uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0xAC};/**/ +uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + +#if (owid>128) +#error "Variable not correct" +#endif + +extern uint8_t mode; +extern uint8_t gcontrol; +extern uint8_t reset_indicator; +extern uint8_t alarmflag; + + +volatile uint8_t wdcounter; + + +typedef union { + volatile uint8_t bytes[8]; + struct { + uint16_t temp; //0 + uint8_t TH; //2 + uint8_t TL; //3 + uint8_t config; //4 + uint8_t rrFF; //5 + uint8_t rr00; //6 + uint8_t rr10; //7 + }; +} pack_t; +volatile pack_t pack; + + + + +#if defined(__AVR_ATtiny24__)||defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny24A__)||defined(__AVR_ATtiny44A__) || defined(__AVR_ATtiny84A__) +ISR(WATCHDOG_vect) { +#else +ISR(WDT_vect) { +#endif + //sleep_disable(); // Disable Sleep on Wakeup + wdcounter++; + if (reset_indicator==1) reset_indicator++; + else if (reset_indicator==2) mode=0; +/* if (timeout==2) { + DIS_TIMER; + EN_OWINT; + mode=OWM_SLEEP; + } + timeout++;*/ + //sleep_enable(); // Enable Sleep Mode + +} + + +#define OWM_PORT PORTA +#define OWM_PIN PINA +#define OWM_PINN PINA0 +#define OWM_DD DDRA + +#define OWM_SET_LOW OWM_PORT&=~(1<0) { + ares[par]=ADmess(); + par++; + if (par>15) par=0; + wdcounter=0; + } + if (gcontrol) { + PORTB|=(1<>4; + uint8_t af=0; + if (t8>pack.TH) af=1; + if (t8<=pack.TL) af=1; + cli(); + pack.temp=htemp; + alarmflag=af; + sei(); + gcontrol=0; + PORTB&=~(1< + + + 2.0 + 6.2 + com.Atmel.AVRGCC8.C + {7a5672fe-8226-4158-b931-e1f36b9a8858} + ATtiny84A + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + DS18B20_TC + DS18B20_TC + DS18B20_TC + Native + true + false + true + true + 0x20000000 + + true + exception_table + 2 + 1 + + + + + + + + + + + + + com.atmel.avrdbg.tool.atmelice + + + + + debugWIRE + + com.atmel.avrdbg.tool.atmelice + J41800000779 + Atmel-ICE + + debugWIRE + + + + + True + True + True + True + False + True + True + + + NDEBUG + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + + + + + True + True + True + True + False + True + True + + + DEBUG + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + + + + + + compile + + + compile + + + + \ No newline at end of file diff --git a/DS18B20_Thermocouble/OWDS18B20.S b/DS18B20_Thermocouble/OWDS18B20.S index 322f70f..351b949 100644 --- a/DS18B20_Thermocouble/OWDS18B20.S +++ b/DS18B20_Thermocouble/OWDS18B20.S @@ -86,6 +86,7 @@ h_readcommand: cjmp 0x44,hrc_set_convertT cjmp 0x48,hrc_copy_scratchpad cjmp 0xB8,hrc_recall_eeprom + FW_CONFIG_INFO #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif diff --git a/DS2423/DS2423.c b/DS2423/DS2423.c index d4d376c..73cb3b6 100644 --- a/DS2423/DS2423.c +++ b/DS2423/DS2423.c @@ -54,6 +54,7 @@ extern void OWINIT(); uint8_t owid[8]={0x1D, 0xA2, 0xD9, 0x84, 0x00, 0x26, 0x02, 0x5C};/**/ +uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; diff --git a/DS2423/OWDS2423.S b/DS2423/OWDS2423.S index e0a97fd..47737ca 100644 --- a/DS2423/OWDS2423.S +++ b/DS2423/OWDS2423.S @@ -84,6 +84,7 @@ h_readcommand: cset 0x5A,OW_COPY_SCRATCHPAD cset 0xF0,OW_READ_MEMORY_ADDR cset 0xA5,OW_READ_MEMORYCOUNTER_ADDR + FW_CONFIG_INFO #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif diff --git a/DS2438_DHT22/DS2438_DHT22.atsln b/DS2438_DHT22/DS2438_DHT22.atsln index cde51c4..77e7763 100644 --- a/DS2438_DHT22/DS2438_DHT22.atsln +++ b/DS2438_DHT22/DS2438_DHT22.atsln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Atmel Studio Solution File, Format Version 11.00 -Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_DHT22", "DS2438_DHT22.cproj", "{D8C974E2-4579-49ED-A4E2-6C54B37778FA}" +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2438_DHT22", "DS2438_DHT22.cproj", "{91468D4F-8AE2-4C59-8A35-549C49E00934}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -9,10 +9,10 @@ Global Release|AVR = Release|AVR EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D8C974E2-4579-49ED-A4E2-6C54B37778FA}.Debug|AVR.ActiveCfg = Debug|AVR - {D8C974E2-4579-49ED-A4E2-6C54B37778FA}.Debug|AVR.Build.0 = Debug|AVR - {D8C974E2-4579-49ED-A4E2-6C54B37778FA}.Release|AVR.ActiveCfg = Release|AVR - {D8C974E2-4579-49ED-A4E2-6C54B37778FA}.Release|AVR.Build.0 = Release|AVR + {91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.ActiveCfg = Debug|AVR + {91468D4F-8AE2-4C59-8A35-549C49E00934}.Debug|AVR.Build.0 = Debug|AVR + {91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.ActiveCfg = Release|AVR + {91468D4F-8AE2-4C59-8A35-549C49E00934}.Release|AVR.Build.0 = Release|AVR EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DS2438_DHT22/DS2438_DHT22.c b/DS2438_DHT22/DS2438_DHT22.c index ed96a55..c5981c0 100644 --- a/DS2438_DHT22/DS2438_DHT22.c +++ b/DS2438_DHT22/DS2438_DHT22.c @@ -32,7 +32,7 @@ #define F_CPU 8000000UL -#define FP_CALC +//#define FP_CALC #include #include #include @@ -43,6 +43,7 @@ extern void OWINIT(); uint8_t owid[8]={0x26, 0xA2, 0xD9, 0x84, 0x00, 0x00, 0x05, 0x16};/**/ +uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; extern uint8_t mode; @@ -347,9 +348,9 @@ int main(void){ #define SENSOFF PORTA&=~(1<2.0 6.2 com.Atmel.AVRGCC8.C - {d8c974e2-4579-49ed-a4e2-6c54b37778fa} + {91468d4f-8ae2-4c59-8a35-549c49e00934} ATtiny84A none Executable @@ -34,7 +34,7 @@ - + @@ -46,7 +46,7 @@ debugWIRE com.atmel.avrdbg.tool.atmelice - J41800000789 + J41800000779 Atmel-ICE debugWIRE diff --git a/DS2438_DHT22/OWDS2438.S b/DS2438_DHT22/OWDS2438.S index f545bed..35bc463 100644 --- a/DS2438_DHT22/OWDS2438.S +++ b/DS2438_DHT22/OWDS2438.S @@ -32,6 +32,8 @@ #define _CHANGEABLE_ID_ //#define _DIS_FLASH_ +#define _ZERO_POLLING_ +//#define _DB_ #include "../common/OWConfig.s" #include "../common/OWCRC8.s" @@ -82,6 +84,7 @@ h_readcommand: cset 0x4E,OW_WRITE_SCRATCHPAD_ADR cjmp 0x44,hrc_set_convertT cjmp 0xB4,hrc_set_convertV + FW_CONFIG_INFO #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif diff --git a/DS2450/DS2450.c b/DS2450/DS2450.c index abf083c..74d24dd 100644 --- a/DS2450/DS2450.c +++ b/DS2450/DS2450.c @@ -42,7 +42,8 @@ extern void OWINIT(); uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/ - +uint8_t config_info[16]={0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + #if (owid>128) #error "Variable not correct" #endif diff --git a/DS2450/OWDS2450.S b/DS2450/OWDS2450.S index 2614786..4fba4bc 100644 --- a/DS2450/OWDS2450.S +++ b/DS2450/OWDS2450.S @@ -94,6 +94,7 @@ h_readcommand: cset 0xAA,OW_READ_MEMORY_ADDR cset 0x55,OW_WRITE_MEMORY_ADDR cset 0x3C,OW_CONVERT + FW_CONFIG_INFO #ifdef _CHANGEABLE_ID_ CHANGE_ID_COMMANDS #endif diff --git a/common/OWCRC16.s b/common/OWCRC16.s index 4d6920e..a26690a 100644 --- a/common/OWCRC16.s +++ b/common/OWCRC16.s @@ -32,7 +32,7 @@ .comm crc,2 - +#define _CRC16_ CRC16_alg: ;crc diff --git a/common/OWCRC8.s b/common/OWCRC8.s index 90d2cd7..dad7480 100644 --- a/common/OWCRC8.s +++ b/common/OWCRC8.s @@ -33,7 +33,7 @@ .comm crc,1 - +#define _CRC8_ .macro CRCS ; CRC beim Senden ;crc diff --git a/common/OWConfig.s b/common/OWConfig.s index 21a5351..8d82561 100644 --- a/common/OWConfig.s +++ b/common/OWConfig.s @@ -57,7 +57,7 @@ #define zh 31 .extern owid,8 - +.extern config_info,16 .comm mode,1 ; Aktueller Zustand nach dem die Unterprogramme aufgerufen werden .comm srbyte,1 ; aktuelles Byte fuer Searchrom diff --git a/common/OWPinInterrupt.s b/common/OWPinInterrupt.s index 5cf444b..00feec0 100644 --- a/common/OWPinInterrupt.s +++ b/common/OWPinInterrupt.s @@ -126,8 +126,10 @@ zeropolling_wait: rjmp zeropolling_low_imp ;Leitung ist low raus aus schleufe in r_temp,TCNT_REG cpi r_temp,(~OWT_MIN_RESET)+OWT_ZP_WAIT_HIGH_TO ;aller zwei us zaehlt der timer - brsh zeropolling_timeout ;Timeout - rjmp zeropolling_wait + sbis OW_PIN,OW_PINN ;noch eine Abfrage, da sonst schleife zu lang (sbis aendert keine flags) + rjmp zeropolling_low_imp ;Leitung ist low raus aus schleufe + brlo zeropolling_wait + rjmp zeropolling_timeout zeropolling_low_imp: sbi OW_DDR,OW_PINN RESETZEROMARKER diff --git a/common/OWRomFunctions.s b/common/OWRomFunctions.s index fdcc919..41a952f 100644 --- a/common/OWRomFunctions.s +++ b/common/OWRomFunctions.s @@ -61,13 +61,14 @@ #define OW_SEARCHROMR 4 ; next resive master answer #define OW_READROM 5 #define OW_READ_COMMAND 6 +#define OW_FWCONFIGINFO 7 #ifdef _CHANGEABLE_ID_ -#define OW_WRITE_NEWID 7 -#define OW_READ_NEWID 8 -#define OW_SET_NEWID 9 -#define OW_FIRST_COMMAND 10 +#define OW_WRITE_NEWID 8 +#define OW_READ_NEWID 9 +#define OW_SET_NEWID 10 +#define OW_FIRST_COMMAND 11 .comm newid,8 @@ -79,7 +80,7 @@ #else -#define OW_FIRST_COMMAND 7 +#define OW_FIRST_COMMAND 8 #endif #ifndef _DIS_FLASH_ @@ -93,6 +94,9 @@ .endm #endif +.macro FW_CONFIG_INFO + cljmp 0x85,hrc_fw_configinfo +.endm #ifdef _CHANGEABLE_ID_ @@ -135,6 +139,7 @@ handle_stable: rjmp h_searchromr rjmp h_readrom rjmp h_readcommand + rjmp h_fwconfiginfo #ifdef _CHANGEABLE_ID_ rjmp h_writeid rjmp h_readid @@ -193,6 +198,13 @@ hrc_set_alarm_search: ; sonst tue nichts rjmp handle_end_sleep + +hrc_fw_configinfo: + ldi r_mode,OW_FWCONFIGINFO + ldi r_sendflag,1 + rjmp h_fwconfiginfo + + ;--------------------------------------------------- ; MATCH ROM ;--------------------------------------------------- @@ -290,6 +302,39 @@ h_readrom_all: rjmp handle_end_sleep +;--------------------------------------------------- +; FW_CONFIG_INFO +;--------------------------------------------------- + +h_fwconfiginfo: + cpi r_bytep,16 + breq h_fwconfiginfo_crc +#ifdef _CRC8_ + cpi r_bytep,17 + breq h_fwconfiginfo_all +#elif defined _CRC16_ + cpi r_bytep,17 + breq h_fwconfiginfo_crc2 + cpi r_bytep,18 + breq h_fwconfiginfo_all +#else + cpi r_bytep,16 + breq h_fwconfiginfo_all +#warning No CRC known code implemented +#endif + configZ config_info,r_bytep + ld r_rwbyte,Z + rjmp handle_end_inc +h_fwconfiginfo_crc: + lds r_rwbyte,crc + rjmp handle_end_inc +h_fwconfiginfo_crc2: + lds r_rwbyte,crc+1 + rjmp handle_end_inc +h_fwconfiginfo_all: + rjmp handle_end_sleep + + ;--------------------------------------------------- ; CHANGE ROM FUNCTIONS ;--------------------------------------------------- diff --git a/common/OWRomFunctionsDual.s b/common/OWRomFunctionsDual.s index c28d855..f9ffb2f 100644 --- a/common/OWRomFunctionsDual.s +++ b/common/OWRomFunctionsDual.s @@ -61,13 +61,15 @@ #define OW_SEARCHROMR 4 ; next resive master answer #define OW_READ_COMMAND1 5 #define OW_READ_COMMAND2 6 +#define OW_FWCONFIGINFO1 7 +#define OW_FWCONFIGINFO2 8 #ifdef _CHANGEABLE_ID_ -#define OW_WRITE_NEWID 7 -#define OW_READ_NEWID 8 -#define OW_SET_NEWID 9 -#define OW_FIRST_COMMAND 10 +#define OW_WRITE_NEWID 9 +#define OW_READ_NEWID 10 +#define OW_SET_NEWID 11 +#define OW_FIRST_COMMAND 12 .comm newid,8 .comm idtable,64 @@ -79,7 +81,7 @@ #else -#define OW_FIRST_COMMAND 7 +#define OW_FIRST_COMMAND 9 #endif #ifndef _DIS_FLASH_ @@ -94,6 +96,12 @@ #endif +.macro FW_CONFIG_INFO1 + cljmp 0x85,hrc_fw_configinfo1 +.endm +.macro FW_CONFIG_INFO2 + cljmp 0x85,hrc_fw_configinfo2 +.endm #ifdef _CHANGEABLE_ID_ ; lesen der ID aus dem EEPROM beim Start @@ -145,6 +153,8 @@ handle_stable: rjmp h_searchromr rjmp h_readcommand1 rjmp h_readcommand2 + rjmp h_fwconfiginfo1 + rjmp h_fwconfiginfo2 #ifdef _CHANGEABLE_ID_ rjmp h_writeid rjmp h_readid @@ -216,6 +226,17 @@ hrc_set_alarm_search: ; sonst tue nichts rjmp handle_end_sleep +hrc_fw_configinfo1: + ldi r_mode,OW_FWCONFIGINFO1 + ldi r_sendflag,1 + rjmp h_fwconfiginfo1 + +hrc_fw_configinfo2: + ldi r_mode,OW_FWCONFIGINFO2 + ldi r_sendflag,1 + rjmp h_fwconfiginfo2 + + ;--------------------------------------------------- ; MATCH ROM ;--------------------------------------------------- @@ -353,6 +374,43 @@ h_searchromr: ; stelle um auf empfangen rjmp handle_end_no_bcount +;--------------------------------------------------- +; FW_CONFIG_INFO +;--------------------------------------------------- + +h_fwconfiginfo1: + configZ config_info1,r_bytep + rjmp h_fwconfiginfo_go +h_fwconfiginfo2: + configZ config_info2,r_bytep + +h_fwconfiginfo_go: + cpi r_bytep,16 + breq h_fwconfiginfo_crc +#ifdef _CRC8_ + cpi r_bytep,17 + breq h_fwconfiginfo_all +#elif defined _CRC16_ + cpi r_bytep,17 + breq h_fwconfiginfo_crc2 + cpi r_bytep,18 + breq h_fwconfiginfo_all +#else + cpi r_bytep,16 + breq h_fwconfiginfo_all +#warning No CRC known code implemented +#endif + ld r_rwbyte,Z + rjmp handle_end_inc +h_fwconfiginfo_crc: + lds r_rwbyte,crc + rjmp handle_end +h_fwconfiginfo_crc2: + lds r_rwbyte,crc+1 + rjmp handle_end +h_fwconfiginfo_all: + rjmp handle_end_sleep + ;--------------------------------------------------- ; CHANGE ROM FUNCTIONS diff --git a/common/OWSet_ATTINYX5.s b/common/OWSet_ATTINYX5.s index 4c4528f..159d151 100644 --- a/common/OWSet_ATTINYX5.s +++ b/common/OWSet_ATTINYX5.s @@ -64,18 +64,25 @@ #else -#define OWT_MIN_RESET 120 -#define OWT_RESET2 60 +#define OWT_MIN_RESET 140 +#define OWT_RESET2 80 #define OWT_RESET_PRESENT 30 #define OWT_PRESENT 130 -//#define OWT_WRITE 35 -//#define OWT_READ 12 #define OWT_WRITE 35 #define OWT_READ 12 #endif +.macro CLEAR_TOV_FLAG + ldi r_temp,(1<