extern void OWINIT();
+extern void EXTERN_SLEEP();
MCUSR=0;
USI_TWI_Master_Initialise();
bmp280Init();
-
+ //DDRB|=(1<<PINB1);
gcontrol=1;
sei();
while(1) {
if (gcontrol) {
+ //PORTB|=(1<<PINB1); //Dauer 5.4ms
uint32_t P;
int32_t t;
bmp280ConvertInt(&t,&P,1);
//pack.temp++;
alarmflag=af;
sei();
- gcontrol=0;
+ EXTERN_SLEEP();
+ //PORTB&=~(1<<PINB1);
}
#define _CHANGEABLE_ID_
#define _ZERO_POLLING_
-//#define _DB_
#include "../common/OWConfig.s"
#include "../common/OWCRC8.s"
.macro COMMAND_TABLE
rjmp h_readscratchpad
rjmp h_writescratchpad
+ rjmp h_convert_run
.endm
#include "../common/OWRomFunctions.s"
; Ab hier Geraeteabhaenging
#define OW_READ_SCRATCHPAD OW_FIRST_COMMAND+0
#define OW_WRITE_SCRATCHPAD OW_FIRST_COMMAND+1
+#define OW_CONVERT_RUN OW_FIRST_COMMAND+2
;---------------------------------------------------
; ldi r_rwbyte,1
;hrc_set_convertT_end:
; sts alarmflag,r_rwbyte
- rjmp handle_end_sleep
-
+ ldi r_mode,OW_CONVERT_RUN
+ ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run:
+ ldi r_bcount,0
+ ldi r_rwbyte,0
+ rjmp handle_end_no_bcount
hrc_copy_scratchpad:
ldi r_bytep,2
-
#include "../common/OWPinInterrupt.s"
.end
\ No newline at end of file
--- /dev/null
+
+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_BMP280_DS2438_SHT", "DS18B20_BMP280_DS2438_SHT.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|AVR = Debug|AVR
+ Release|AVR = Release|AVR
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.ActiveCfg = Debug|AVR
+ {7A5672FE-8226-4158-B931-E1F36B9A8858}.Debug|AVR.Build.0 = Debug|AVR
+ {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.ActiveCfg = Release|AVR
+ {7A5672FE-8226-4158-B931-E1F36B9A8858}.Release|AVR.Build.0 = Release|AVR
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<?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_BMP280_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 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>
+ </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\BMP280.c">
+ <SubType>compile</SubType>
+ <Link>BMP280.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="DS18B20_DS2438.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="OWDS18B20_DS2438.S">
+ <SubType>compile</SubType>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
\ No newline at end of file
extern void OWINIT();
-
+extern void EXTERN_SLEEP();
uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
//pack.temp++;
alarmflag=af;
sei();
- gcontrol=0;
+ EXTERN_SLEEP();
}
if ((gcontrol==2)||(gcontrol==3)) {
gcontrol=0;
.macro COMMAND_TABLE
rjmp h_readscratchpad1
rjmp h_writescratchpad1
+ rjmp h_convert_run1
rjmp h_readscratchpad_adr2
rjmp h_readscratchpad2
rjmp h_writescratchpad_adr2
; Ab hier Geraeteabhaenging
#define OW_READ_SCRATCHPAD1 OW_FIRST_COMMAND+0
#define OW_WRITE_SCRATCHPAD1 OW_FIRST_COMMAND+1
-#define OW_READ_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+2
-#define OW_READ_SCRATCHPAD2 OW_FIRST_COMMAND+3
-#define OW_WRITE_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+4
-#define OW_WRITE_SCRATCHPAD2 OW_FIRST_COMMAND+5
+#define OW_CONVERT_RUN1 OW_FIRST_COMMAND+2
+#define OW_READ_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+3
+#define OW_READ_SCRATCHPAD2 OW_FIRST_COMMAND+4
+#define OW_WRITE_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+5
+#define OW_WRITE_SCRATCHPAD2 OW_FIRST_COMMAND+6
+
;---------------------------------------------------
ldi r_temp,1
sts gcontrol,r_temp
- rjmp handle_end_sleep
+ ldi r_mode,OW_CONVERT_RUN1
+ ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run1:
+ ldi r_bcount,0
+ ldi r_rwbyte,0
+ rjmp handle_end_no_bcount
hrc_copy_scratchpad1:
extern void OWINIT();
-
+extern void EXTERN_SLEEP();
uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/
extern uint8_t alarmflag;
-
+uint8_t max_adr=0;
typedef union {
volatile uint8_t bytes[8];
MCUSR=0;
USI_TWI_Master_Initialise();
-
+ if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
gcontrol=1;
+ //DDRB|=(1<<PINB1);
sei();
while(1) {
if (gcontrol) {
- volatile double l=MAX44009getlux(1);
+ //PORTB|=(1<<PINB1); //Dauer 2.3ms
+ volatile double l=MAX44009getlux(max_adr);
if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
//double l=1000;
l=log(l)*10*16;
pack.temp=w;
//pack.temp++;
alarmflag=af;
- sei();
- gcontrol=0;
+ sei();
+ EXTERN_SLEEP();
+ //PORTB&=~(1<<PINB1);
}
.macro COMMAND_TABLE
rjmp h_readscratchpad
rjmp h_writescratchpad
+ rjmp h_convert_run
.endm
#include "../common/OWRomFunctions.s"
; Ab hier Geraeteabhaenging
#define OW_READ_SCRATCHPAD OW_FIRST_COMMAND+0
#define OW_WRITE_SCRATCHPAD OW_FIRST_COMMAND+1
+#define OW_CONVERT_RUN OW_FIRST_COMMAND+2
;---------------------------------------------------
; ldi r_rwbyte,1
;hrc_set_convertT_end:
; sts alarmflag,r_rwbyte
- rjmp handle_end_sleep
-
+ ldi r_mode,OW_CONVERT_RUN
+ ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run:
+ ldi r_bcount,0
+ ldi r_rwbyte,0
+ rjmp handle_end_no_bcount
hrc_copy_scratchpad:
ldi r_bytep,2
-
#include "../common/OWPinInterrupt.s"
.end
\ No newline at end of file
extern void OWINIT();
-
+extern void EXTERN_SLEEP();
uint8_t owid1[8]={0x28, 0xA3, 0xD9, 0x84, 0x00, 0x16, 0x05, 0x18};/**/
volatile double temperatureC,humidityRH;
volatile double l;
+uint8_t max_adr=0;
int main(void){
PRR|=(1<<PRADC); // adc for save Power
MCUSR=0;
USI_TWI_Master_Initialise();
+ if (checkMAX44009(0)) max_adr=0; else max_adr=1 ;
SHT2x_SoftReset();
SHT2x_ReadUserRegister(userRegister);
//(userRegister & ~SHT2x_RES_MASK) | SHT2x_RES_10_13BIT;
gcontrol=1;
sei();
+ //DDRB|=(1<<PINB1);
while(1) {
if (wdcounter>0) {
+ //PORTB|=(1<<PINB1); //Dauer 440ms
SHT2x_MeasurePoll(HUMIDITY, &sRH);
// --- measure temperature with "Polling Mode" (no hold master) ---
SHT2x_MeasurePoll(TEMP, &sT);
double hhum=(1.0546-0.000216*temperatureC)*(humidityRH);
am2302_hum=0.318*hhum +76.0;
am2302_temp=temperatureC*25.6;
+ //PORTB&=~(1<<PINB1);
wdcounter=0;
}
if (gcontrol==1) {
- l=MAX44009getlux(0);
+ l=MAX44009getlux(max_adr);
if (l<0.030) l=0.030; //Darf nicht 0 sein. minimum -35°C Sensor minimum 0.045
//double l=1000;
l=log(l)*10*16;
//pack.temp++;
alarmflag=af;
sei();
- gcontrol=0;
+ EXTERN_SLEEP();
}
if ((gcontrol==2)||(gcontrol==3)) {
gcontrol=0;
MCUCR|=(1<<SE);
MCUCR&=~(1<<SM1);
}
- //MCUCR&=~(1<<ISC01);
asm("SLEEP");
}
#define _CHANGEABLE_ID_
#define _ZERO_POLLING_
-#define _DB_
+//#define _DB_
#include "../common/OWConfig.s"
#include "../common/OWCRC8.s"
.macro COMMAND_TABLE
rjmp h_readscratchpad1
rjmp h_writescratchpad1
+ rjmp h_convert_run1
rjmp h_readscratchpad_adr2
rjmp h_readscratchpad2
rjmp h_writescratchpad_adr2
; Ab hier Geraeteabhaenging
#define OW_READ_SCRATCHPAD1 OW_FIRST_COMMAND+0
#define OW_WRITE_SCRATCHPAD1 OW_FIRST_COMMAND+1
-#define OW_READ_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+2
-#define OW_READ_SCRATCHPAD2 OW_FIRST_COMMAND+3
-#define OW_WRITE_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+4
-#define OW_WRITE_SCRATCHPAD2 OW_FIRST_COMMAND+5
+#define OW_CONVERT_RUN1 OW_FIRST_COMMAND+2
+#define OW_READ_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+3
+#define OW_READ_SCRATCHPAD2 OW_FIRST_COMMAND+4
+#define OW_WRITE_SCRATCHPAD_ADR2 OW_FIRST_COMMAND+5
+#define OW_WRITE_SCRATCHPAD2 OW_FIRST_COMMAND+6
;---------------------------------------------------
ldi r_temp,1
sts gcontrol,r_temp
- rjmp handle_end_sleep
+ ldi r_mode,OW_CONVERT_RUN1
+ ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run1:
+ ldi r_bcount,0
+ ldi r_rwbyte,0
+ rjmp handle_end_no_bcount
hrc_copy_scratchpad1:
#include <avr/pgmspace.h>
extern void OWINIT();
+extern void EXTERN_SLEEP();
-//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};
+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]));
+ float t0=pgm_read_float(&(k_rs[iv]));
+ float t1=pgm_read_float(&(k_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};
+uint8_t config_info[16]={0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
#if (owid>128)
#error "Variable not correct"
for(uint8_t i=0;i<16;i++) {
sum+=ares[i];
}
- V=sum/20.0/1024.0*1.174*1000.0/16.0;
+ V=sum/20.0/1024.0*1.12*1000.0/16.0;
//V=sum/20.0/1024.0*1.01*1000.0/16.0;
ktemp=gettemp_rs(V);
owm_reset();
pack.temp=htemp;
alarmflag=af;
sei();
- gcontrol=0;
+ EXTERN_SLEEP();
PORTB&=~(1<<PORTB0);
}
<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>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
<avrdevice>ATtiny84A</avrdevice>
<ToolName>Atmel-ICE</ToolName>
</com_atmel_avrdbg_tool_atmelice>
<avrtoolinterface>debugWIRE</avrtoolinterface>
+ <ExternalProgrammingToolCommand />
</PropertyGroup>
<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.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.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.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>
// 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"
.macro COMMAND_TABLE
rjmp h_readscratchpad
rjmp h_writescratchpad
+ rjmp h_convert_run
.endm
#include "../common/OWRomFunctions.s"
; Ab hier Geraeteabhaenging
#define OW_READ_SCRATCHPAD OW_FIRST_COMMAND+0
#define OW_WRITE_SCRATCHPAD OW_FIRST_COMMAND+1
+#define OW_CONVERT_RUN OW_FIRST_COMMAND+2
;---------------------------------------------------
; ldi r_rwbyte,1
;hrc_set_convertT_end:
; sts alarmflag,r_rwbyte
- rjmp handle_end_sleep
+ ldi r_mode,OW_CONVERT_RUN
+ ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_run:
+ ldi r_bcount,0
+ ldi r_rwbyte,0
+ rjmp handle_end_no_bcount
hrc_copy_scratchpad:
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450", "DS2450.cproj", "{7A5672FE-8226-4158-B931-E1F36B9A8858}"
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "DS2450", "DS2450.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
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
+ {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
+ {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
+ {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
+ {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
#include <avr/pgmspace.h>
extern void OWINIT();
+extern void EXTERN_SLEEP();
uint8_t owid[8]={0x20, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x02, 0x5D};/**/
uint8_t config_info[16]={0x06,0x09,0x06,0x09,0x06,0x09,0x06,0x09,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
MCUCR &=~(1<<PUD); //All Pins Pullup...
MCUCR |=(1<<BODS);
PORTA&=~((1<<PINA0)|(1<<PINA1)|(1<<PINA2)|(1<<PINA3));
- ADCSRA=(1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);
+ ADCSRA=(1<<ADEN)|(1<ADPS0)|(1<<ADPS2);
gcontrol=1;
ADCSRB|=(1<<ADLAR);
sei();
+
+ //DDRB|=(1<<PINB1);
while(1) {
if (gcontrol) {
+ //PORTB|=(1<<PINB1);
uint8_t bb=1;
uint8_t bb1=1;
for(uint8_t i=0;i<4;i++){
//CHanel A
if (pack.convc1&1) {
if (pack.CSA2&0x01) ADMUX=0; else ADMUX=0x80;
- _delay_ms(10);
+ _delay_us(100);
ADCSRA|=(1<<ADSC);
while ((ADCSRA&(1<<ADSC)));
cli();pack.A=ADC;sei();
if (pack.convc1&2) {
if (pack.CSB2&0x01) ADMUX=1; else ADMUX=0x81;
- _delay_ms(10);
+ _delay_us(100);
ADCSRA|=(1<<ADSC);
while ((ADCSRA&(1<<ADSC)));
cli();pack.B=ADC;sei();
if (pack.convc1&4) {
if (pack.CSC2&0x01) ADMUX=2; else ADMUX=0x82;
- _delay_ms(10);
+ _delay_us(100);
ADCSRA|=(1<<ADSC);
while ((ADCSRA&(1<<ADSC)));
cli();pack.C=ADC;sei();
}
if (pack.convc1&8) {
if (pack.CSD2&0x01) ADMUX=3; else ADMUX=0x83;
- _delay_ms(10);
+ _delay_us(100);
ADCSRA|=(1<<ADSC);
while ((ADCSRA&(1<<ADSC)));
cli();pack.D=ADC;sei();
if (pack.bytes[1]<pack.LD) {alarmflag=1;pack.CSD2|=0x10;}
}
- gcontrol=0;
+ EXTERN_SLEEP();
+ //PORTB&=~(1<<PINB1);
}
uint8_t bb=1;
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<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>{7a5672fe-8226-4158-b931-e1f36b9a8858}</ProjectGuid>
+ <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
<avrdevice>ATtiny84A</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<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.19.0" />
- </dependencies>
- </framework-data>
+ <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.avrdragon</avrtool>
+ <avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
+ <avrtoolserialnumber>J41800000779</avrtoolserialnumber>
+ <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
<com_atmel_avrdbg_tool_atmelice>
<ToolOptions>
<InterfaceProperties>
<ToolName>Atmel-ICE</ToolName>
</com_atmel_avrdbg_tool_atmelice>
<avrtoolinterface>debugWIRE</avrtoolinterface>
- <ExternalProgrammingToolCommand />
- <avrtoolserialnumber>00A20004766E</avrtoolserialnumber>
- <avrdeviceexpectedsignature>0x1E930C</avrdeviceexpectedsignature>
- <com_atmel_avrdbg_tool_avrdragon>
- <ToolOptions>
- <InterfaceProperties>
- </InterfaceProperties>
- <InterfaceName>debugWIRE</InterfaceName>
- </ToolOptions>
- <ToolType>com.atmel.avrdbg.tool.avrdragon</ToolType>
- <ToolNumber>00A20004766E</ToolNumber>
- <ToolName>AVR Dragon</ToolName>
- </com_atmel_avrdbg_tool_avrdragon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
- <Value>DEBUG</Value>
+ <Value>NDEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<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.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.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>
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define _CHANGEABLE_ID_
+#define _ZERO_POLLING_
#include "../common/OWConfig.s"
#include "../common/OWCRC16.s"
rjmp h_convert
rjmp h_convertcrc1
rjmp h_convertcrc2
+ rjmp h_convert_conv
.endm
#include "../common/OWRomFunctions.s"
#define OW_CONVERT OW_FIRST_COMMAND+9
#define OW_CONVERT_CRC1 OW_FIRST_COMMAND+10
#define OW_CONVERT_CRC2 OW_FIRST_COMMAND+11
-
+#define OW_CONVERT_CONV OW_FIRST_COMMAND+12
;---------------------------------------------------
; READ COMMAND and start operation
ldi r_temp,1
sts gcontrol,r_temp
;ldi r_bcount,1
- ldi r_mode,OW_SLEEP
- clr r_sendflag
- rjmp handle_end
+ ldi r_mode,OW_CONVERT_CONV
+ ;clr r_sendflag
+ ldi r_sendflag,3 ;set bit 0 and 1 for no zero polling
+h_convert_conv:
+ ldi r_bcount,0
+ ldi r_rwbyte,0
+ rjmp handle_end_no_bcount
#include "USI_TWI_Master.h"
#include "MAX44009.h"
+uint8_t checkMAX44009(uint8_t nr) {
+ volatile uint8_t b1;
+ nr=(nr<<1)&0x02f;
+
+ I2c_StartCondition();
+ I2c_WriteByte(0b10010100|nr);
+ I2c_WriteByte(0x03);
+ I2c_StartCondition();
+ I2c_WriteByte (0b10010101|nr);
+ b1 =I2c_ReadByte(NO_ACK);
+ I2c_StopCondition();
+ return b1!=0xFF;
+
+}
+
+
double MAX44009getlux(uint8_t nr) {
volatile uint8_t b1,b2;
nr=(nr<<1)&0x02f;
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
double MAX44009getlux(uint8_t nr);
-
+uint8_t checkMAX44009(uint8_t nr);
#endif
\ No newline at end of file
//-- poll every 10ms for measurement ready. Timeout after 20 retries (200ms)--
do
{ I2c_StartCondition();
- _delay_ms(1000); //delay 10ms
+ _delay_ms(200); //delay 10ms
if(i++ >= 20) break;
} while(I2c_WriteByte (I2C_ADR_R) == ACK_ERROR);
if (i>=20) error |= TIME_OUT_ERROR;
rjmp zeropolling
rjmp no_zerromaker
zeropolling:
+ sbrc r_sendflag,1 ; sendflag bit 1 -> switch off zeropolling in software eg for asking convert is donne (DS2450, DS18B20 and others)
+ rjmp no_zerromaker
+zeropolling_h_loop:
sbic OW_PIN,OW_PINN ;warten bis leitung wieder h
rjmp zeropolling_wait ;leitung ist low ->Schleie
in r_temp,TCNT_REG
cpi r_temp,(~OWT_MIN_RESET)+OWT_ZP_WAIT_LOW_TO;aller zwei us zaehlt der timer
brsh zeropolling_timeout ;Timeout Reset?
- rjmp zeropolling
+ rjmp zeropolling_h_loop
zeropolling_wait:
sbis OW_PIN,OW_PINN ;warten bis leitung wieder l
rjmp zeropolling_low_imp ;Leitung ist low raus aus schleufe
sts alarmflag,r_temp
RESETZEROMARKER
ret
+
+
+.global EXTERN_SLEEP
+EXTERN_SLEEP:
+ cli
+ push r_temp
+ ldi r_temp,0
+ sts mode,r_temp ;SLEEP
+ sts gcontrol,r_temp
+ sts sendflag,r_temp
+ sts bcount,r_temp
+ RESETZEROMARKER
+ pop r_temp
+ sei
+ ret
\ No newline at end of file
sts alarmflag,r_temp
RESETZEROMARKER
ret
+
+.global EXTERN_SLEEP
+EXTERN_SLEEP:
+ cli
+ push r_temp
+ ldi r_temp,0
+ sts mode,r_temp ;SLEEP
+ sts gcontrol,r_temp
+ sts sendflag,r_temp
+ sts bcount,r_temp
+ RESETZEROMARKER
+ pop r_temp
+ sei
+ ret
\ No newline at end of file
avrdude -c usbasp -p t84 -U lfuse:w:0xE2:m -U hfuse:w:0xDF:m -U efuse:w:0xFE:m
-avrdude -c usbasp -p t84 -e -U flash:w:"../programmer/Debug/programmer.hex"
+avrdude -c usbasp -p t84 -e -U flash:w:"../programmer/Release/programmer.hex"