X-Git-Url: http://git.smho.de/gw/?p=owSlave2.git;a=blobdiff_plain;f=common%2FOWSet_ATTINYX4.s;fp=common%2FOWSet_ATTINYX4.s;h=4ddead19f10ee535fc996930c582f77273bec709;hp=98efef2c90335fdc72328ca98ae1644497e6b9e8;hb=a6a04f58e4afd20f206fdf4a8a7b3ce4062f1b67;hpb=cd92472e6fd63693741f8e168123a4182802651b diff --git a/common/OWSet_ATTINYX4.s b/common/OWSet_ATTINYX4.s index 98efef2..4ddead1 100644 --- a/common/OWSet_ATTINYX4.s +++ b/common/OWSet_ATTINYX4.s @@ -1,143 +1,143 @@ -// 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 OW_PORT _SFR_IO_ADDR(PORTB) //1 Wire Port -#define OW_PIN _SFR_IO_ADDR(PINB) //1 Wire Pin as number -#define OW_PINN PORTB2 -#define OW_DDR _SFR_IO_ADDR(DDRB) //pin direction register -#define TCNT_REG _SFR_IO_ADDR(TCNT0) - - -#define DB_PORT _SFR_IO_ADDR(PORTB) //DEBUG -#define DB_PIN _SFR_IO_ADDR(PINB) //DEBUG -#define DB_DDR _SFR_IO_ADDR(DDRB) //DEBUG -#define DB_PINN PORTB1 - -#define SETZEROMARKER sbi _SFR_IO_ADDR(DDRB),3 -#define RESETZEROMARKER cbi _SFR_IO_ADDR(DDRB),3 -#define TESTZEROMARKER sbic _SFR_IO_ADDR(DDRB),3 - -#ifdef _DB_ -#define sdb sbi _SFR_IO_ADDR(PORTB),DB_PINN -#define cdb cbi _SFR_IO_ADDR(PORTB),DB_PINN -#else -#define sdb -#define cdb -#endif - -#define TIMER_INTERRUPT TIM0_OVF_vect -#define PIN_INTERRIPT EXT_INT0_vect - - -//#define OWT_MIN_RESET 160 -//#define OWT_RESET2 40 -//#define OWT_RESET_PRESENT 15 -//#define OWT_PRESENT 50 -//#define OWT_WRITE 18 -//#define OWT_READ 4 - -#define OWT_MIN_RESET 180 -#define OWT_RESET2 80 -#define OWT_RESET_PRESENT 30 -#define OWT_PRESENT 130 -#define OWT_WRITE 35 -#define OWT_READ 12 -#define OWT_ZP_WAIT_LOW_TO 60 ; Zeit fuer die Maximale Lowzeit bei der Zerro Polling pruefung. Ist die Leitung laenger low, ist es vieleicht ein Reset -#define OWT_ZP_WAIT_HIGH_TO 90 ; Zeit fuer die Maximale Hight zeit bis zu einem Low Impuls vom Master. Nach laengeren Pausen wird nicht mehr gepollt sondern der Interrup vererndet. - - -.macro CLEAR_TOV_FLAG - ldi r_temp,1 - out _SFR_IO_ADDR(TIFR0),r_temp -.endm - -.macro JMP_NO_TOV - in r_temp, _SFR_IO_ADDR(TIFR0) - sbrc r_temp,TOV0 ; wenn ueberlauf gleiich weiter -.endm - -.macro CLEAR_INTERRUPT_FLAG - ldi r_temp,(1<