From 2b1327994c7d6380e584133d1bbe6dabe4a14fa7 Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Tue, 5 Apr 2022 20:34:09 +0200 Subject: [PATCH] Additions from 17/12/2021: Speculation ? Interruption not working so going backward ? --- i2c_test_attiny85/USI_TWI_Slave.h | 1 - .../i2c_test_attiny85.componentinfo.xml | 26 +-- i2c_test_attiny85/i2c_test_attiny85.cproj | 166 +++++++++--------- i2c_test_attiny85/led_gen.c | 14 +- i2c_test_attiny85/led_receptor.c | 16 +- i2c_test_attiny85/led_receptor.h | 4 +- i2c_test_attiny85/main.c | 13 +- 7 files changed, 120 insertions(+), 120 deletions(-) diff --git a/i2c_test_attiny85/USI_TWI_Slave.h b/i2c_test_attiny85/USI_TWI_Slave.h index 92cbcff..0035f32 100755 --- a/i2c_test_attiny85/USI_TWI_Slave.h +++ b/i2c_test_attiny85/USI_TWI_Slave.h @@ -179,7 +179,6 @@ defined( __AVR_ATtiny85__ ) (0< Atmel - 1.8.0 - D:/Programs\Atmelstudio\7.0\Packs + 1.2.0 + C:/Program Files (x86)\Atmel\Studio\7.0\Packs - D:/Programs\Atmelstudio\7.0\Packs\atmel\ATtiny_DFP\1.8.332\include\ + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.2.118\include include C - include/ + include - D:/Programs\Atmelstudio\7.0\Packs\atmel\ATtiny_DFP\1.8.332\include\avr\iotn85.h + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.2.118\include\avr\iotn85.h header C - T0lnJZ6iliUJCzU7ZHCMPQ== + RcYmivGpgsCGGCzeWAIjcA== include/avr/iotn85.h - D:/Programs\Atmelstudio\7.0\Packs\atmel\ATtiny_DFP\1.8.332\templates\main.c + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.2.118\templates\main.c template source C Exe - KjvOcFWd++tbnsEMfVPd/w== + GD1k8YYhulqRs6FD1B2Hog== templates/main.c Main file (.c) - D:/Programs\Atmelstudio\7.0\Packs\atmel\ATtiny_DFP\1.8.332\templates\main.cpp + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.2.118\templates\main.cpp template source C Exe - mkKaE95TOoATsuBGv6jmxg== + YXFphlh0CtZJU+ebktABgQ== templates/main.cpp Main file (.cpp) - D:/Programs\Atmelstudio\7.0\Packs\atmel\ATtiny_DFP\1.8.332\gcc\dev\attiny85 + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.2.118\gcc\dev\attiny85 libraryPrefix GCC @@ -71,8 +71,8 @@ ATtiny_DFP - D:/Programs/Atmelstudio/7.0/Packs/atmel/ATtiny_DFP/1.8.332/Atmel.ATtiny_DFP.pdsc - 1.8.332 + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.2.118/Atmel.ATtiny_DFP.pdsc + 1.2.118 true ATtiny85 diff --git a/i2c_test_attiny85/i2c_test_attiny85.cproj b/i2c_test_attiny85/i2c_test_attiny85.cproj index e050ff9..59a26aa 100755 --- a/i2c_test_attiny85/i2c_test_attiny85.cproj +++ b/i2c_test_attiny85/i2c_test_attiny85.cproj @@ -28,23 +28,23 @@ 0 - - - - - - - - - + + + + + + + + + - com.atmel.avrdbg.tool.simulator + com.atmel.avrdbg.tool.stk500 0x1E930B - 0 + 125000 ISP @@ -54,7 +54,7 @@ STK500 ISP - 0 + 125000 0 @@ -72,79 +72,79 @@ - -mmcu=attiny85 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\gcc\dev\attiny85" - True - True - True - True - False - True - True - - - NDEBUG - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\include\ - - - Optimize for size (-Os) - True - True - True - - - libm - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\include\ - - - + -mmcu=attiny85 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\gcc\dev\attiny85" + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\include + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\include + + + - -mmcu=attiny85 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\gcc\dev\attiny85" - True - True - True - True - False - True - True - - - DEBUG - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\include\ - - - Optimize (-O1) - True - True - Default (-g2) - True - - - libm - - - - - %24(PackRepoDir)\atmel\ATtiny_DFP\1.8.332\include\ - - - Default (-Wa,-g) - + -mmcu=attiny85 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\gcc\dev\attiny85" + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\include + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\include + + + Default (-Wa,-g) + @@ -160,12 +160,6 @@ compile - - compile - - - compile - compile diff --git a/i2c_test_attiny85/led_gen.c b/i2c_test_attiny85/led_gen.c index c3b4427..9e5e026 100755 --- a/i2c_test_attiny85/led_gen.c +++ b/i2c_test_attiny85/led_gen.c @@ -10,7 +10,7 @@ void led1_init(void) { DDRB |= (1< #include @@ -21,7 +21,7 @@ #define NOTHING 0x54 #define ERROR 0xF0 #define VOLTMIN 1 -#define TIMING 500 +#define TIMING 100 void ADC_init(void); void ADC_start_conversion(void); diff --git a/i2c_test_attiny85/main.c b/i2c_test_attiny85/main.c index 82dcdd6..90e2d40 100755 --- a/i2c_test_attiny85/main.c +++ b/i2c_test_attiny85/main.c @@ -16,7 +16,7 @@ #include "led_gen.h" #include "led_receptor.h" #include "USI_TWI_Slave.h" - +//#define F_CPU 1000000 #define NOM_CONSTRUC 0x08 #define NOM_CAPTEUR 0x10 #define VALEUR_DEMAN 0x49 @@ -27,11 +27,11 @@ volatile float adcled1; volatile float adcled2; volatile unsigned char recVal; -ISR (ADC_vect){//On récupère les données à chaque fin de conversion Analogique/Numérique +/*ISR (ADC_vect){ adcled1=measureLed1(); adcled2=measureLed2(); recVal=compareLed(adcled1,adcled2); -} +}*/ int main( void ) { @@ -39,11 +39,12 @@ int main( void ) unsigned char nom_capteur[8]= {'T','u','r','k','i','s','h','Z'}; unsigned char sensor_type[8]= {'C','a','t','c','h','E','y','e'}; slaveAdress = 0x01; + MCUCR |= (1<