From 45806622c08cded7d77c9c9735c433de5f7fa027 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 18 May 2017 09:38:22 +0200 Subject: [PATCH] DS2423 FHEM LEDs 4MHz Timing --- DS2423_DS2413/DS2423_DS2413.c | 8 +- DS2423_DS2423/DS2423_DS2423.c | 24 ++-- DS2423_DS2423/DS2423_DS2423.cproj | 13 +- DS2450/DS2450.cproj | 156 +++++++++++------------ common/I2C/CDM7160.h | 4 +- common/OWDS2450.S | 2 +- common/OWSet_ATTINYX4.s | 2 +- programmer/programmer/programmer.asmproj | 18 +-- 8 files changed, 116 insertions(+), 111 deletions(-) diff --git a/DS2423_DS2413/DS2423_DS2413.c b/DS2423_DS2413/DS2423_DS2413.c index 29800f8..a44b62b 100644 --- a/DS2423_DS2413/DS2423_DS2413.c +++ b/DS2423_DS2413/DS2423_DS2413.c @@ -117,8 +117,8 @@ volatile uint8_t changefromeeprom; ISR(PCINT0_vect) { - if (((PIN_REG&PIN_CH2)==0)&&((istat&PIN_CH2)==PIN_CH2)) { counters1.c32[2]++; } - if (((PIN_REG&PIN_CH3)==0)&&((istat&PIN_CH3)==PIN_CH3)) { counters1.c32[3]++; } + if (((PIN_REG&PIN_CH2)==0)&&((istat&PIN_CH2)==PIN_CH2)) { counters1.c32[2]++; LED2_ON} + if (((PIN_REG&PIN_CH3)==0)&&((istat&PIN_CH3)==PIN_CH3)) { counters1.c32[3]++;LED2_ON } if ((PIN_REG&PIN_PIOA)==0) pin_state&=~0x1; else pin_state|=0x01; if ((PIN_REG&PIN_PIOB)==0) pin_state&=~0x4; else pin_state|=0x04; //Reset Switch on the FHEM_BOARD @@ -152,6 +152,9 @@ ISR(ANA_COMP_vect) { PORTB&=~(1<Ruecksetzen diff --git a/DS2423_DS2423/DS2423_DS2423.c b/DS2423_DS2423/DS2423_DS2423.c index 68fb010..1dbd395 100644 --- a/DS2423_DS2423/DS2423_DS2423.c +++ b/DS2423_DS2423/DS2423_DS2423.c @@ -47,7 +47,7 @@ extern void EXTERN_SLEEP(void); volatile uint8_t owid1[8]={0x1D, 0x40, 0xDA, 0x84, 0x00, 0x00, 0x05, 0xBD};/**/ volatile uint8_t owid2[8]={0x1D, 0x41, 0xDA, 0x84, 0x00, 0x00, 0x05, 0x8A};/**/ -#if RAMEND>260 //defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny84A__) +#if RAMEND>260 //defined(__AVR_ATtiny84__) ||defined(__AVR_ATtiny84A__) uint8_t config_info1[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 uint8_t config_info2[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 #endif @@ -75,7 +75,7 @@ typedef union { counterpack_t pack1; //The Memory of both Chips is the same, beause of the small memory of ATTiny44 -#define pack2 pack1 +#define pack2 pack1 volatile uint8_t lastcps; typedef union { @@ -162,6 +162,9 @@ ISR(ANA_COMP_vect) { PORTB&=~(1< minus of Comperator falls down -> output of Comperator rises -#ifdef FHEM_PLATINE + #ifdef FHEM_PLATINE //Switch std AIN1 to A0 ADCSRA&=~(1<Ruecksetzen if ((counters1.c32[2]!=0)||(counters1.c32[3]!=0)||(counters2.c32[2]!=0)||(counters2.c32[3]!=0)) { counters1.c32[0]++; counters2.c32[0]++; for (uint8_t i=2;i<4;i++) { @@ -281,7 +285,7 @@ int main(void){ //count Resets changefromeeprom=1; } } -#endif + #endif MCUCR|=(1<7.0 com.Atmel.AVRGCC8.C {7a5672fe-8226-4158-b931-e1f36b9a8858} - ATtiny44A + ATtiny84A none Executable C @@ -38,21 +38,18 @@ - - + com.atmel.avrdbg.tool.atmelice - - + debugWIRE com.atmel.avrdbg.tool.atmelice J41800000789 Atmel-ICE - - + debugWIRE @@ -67,7 +64,7 @@ J41800000789 - 0x1E930D + 0x1E930C diff --git a/DS2450/DS2450.cproj b/DS2450/DS2450.cproj index 856184d..f29fdfd 100644 --- a/DS2450/DS2450.cproj +++ b/DS2450/DS2450.cproj @@ -28,95 +28,95 @@ 1 - - - - - - - - - - + + + + + + + + + + - -mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a" - True - True - True - True - False - True - True - - - NDEBUG - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include - - - Optimize for size (-Os) - True - True - True - - - libm - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include - - - + -mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a" + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include + + + - -mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a" - True - True - True - True - False - True - True - - - DEBUG - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include - - - Optimize (-O1) - True - True - Default (-g2) - True - - - libm - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include - - - Default (-Wa,-g) - + -mmcu=attiny84a -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\gcc\dev\attiny84a" + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.0.79\include + + + Default (-Wa,-g) + diff --git a/common/I2C/CDM7160.h b/common/I2C/CDM7160.h index a3bf902..e057b3f 100644 --- a/common/I2C/CDM7160.h +++ b/common/I2C/CDM7160.h @@ -1,5 +1,5 @@ -#ifndef MAX44009_H -#define MAX44009_H +#ifndef CDM7160_H +#define CDM7160_H // Copyright (c) 2015, Tobias Mueller tm(at)tm3d.de // All rights reserved. // diff --git a/common/OWDS2450.S b/common/OWDS2450.S index c6a43ec..40e3907 100644 --- a/common/OWDS2450.S +++ b/common/OWDS2450.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/OWSet_ATTINYX4.s b/common/OWSet_ATTINYX4.s index 48282c4..1810047 100644 --- a/common/OWSet_ATTINYX4.s +++ b/common/OWSet_ATTINYX4.s @@ -69,7 +69,7 @@ #define OWT_MIN_RESET 80 #define OWT_RESET2 17 #define OWT_RESET_PRESENT 15 -#define OWT_PRESENT 10 +#define OWT_PRESENT 60 #define OWT_WRITE 16 #define OWT_READ 5 #define OWT_ZP_WAIT_LOW_TO 36 ; Zeit fuer die Maximale Lowzeit bei der Zerro Polling pruefung. Ist die Leitung laenger low, ist es vieleicht ein Reset diff --git a/programmer/programmer/programmer.asmproj b/programmer/programmer/programmer.asmproj index a077c58..cffffb4 100644 --- a/programmer/programmer/programmer.asmproj +++ b/programmer/programmer/programmer.asmproj @@ -28,15 +28,15 @@ 1 - - - - - - - - - + + + + + + + + + com.atmel.avrdbg.tool.atmelice -- 2.34.1