From 0a2c8b1dabd4415c7009d2b1526e92f8e06216bf Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Wed, 10 Jul 2024 09:40:56 -0700 Subject: [PATCH] Changed to using the reset default clock divider of 6. More stable given variable voltage, also reduces power consumption of attiny404. --- main.c | 20 ++++---------------- nbproject/Makefile-genesis.properties | 6 +++--- nbproject/configurations.xml | 6 +----- nbproject/private/configurations.xml | 2 +- nbproject/private/private.xml | 8 ++------ 5 files changed, 11 insertions(+), 31 deletions(-) diff --git a/main.c b/main.c index 03044f8..30d2d78 100644 --- a/main.c +++ b/main.c @@ -9,7 +9,9 @@ * extracted into separate source files and headers for configuration. */ -#define F_CPU 2000000UL +//#define F_CPU 2000000UL +#define F_CPU 3333333UL + //These defines are mostly useful for when you want you editors LSP server to //function correctly. @@ -46,7 +48,7 @@ static void CLK_DisablePrescaler(void) int main(int argc, char **argv) { - CLK_DisablePrescaler(); + //CLK_DisablePrescaler(); while(true){ for(int i = 0; i < GatePulsesQty; i++){ ZCD_Poll(); @@ -55,20 +57,6 @@ int main(int argc, char **argv) TriacOut_SetAllHigh(); TriacOut_PulsePins(GatePulses[i]); } - - //The G1-G3 pins are low at this point. - _delay_ms(2500); - ZCD_Poll(); - TriacOut_SetupPins(); - TriacOut_SetAllHigh(); - - Load_HandleLoadPortA(ADC_LOAD1, 1); - Load_HandleLoadPortB(ADC_LOAD2, 3); - Load_HandleLoadPortB(ADC_LOAD3, 2); - - while(true){ - ; //Do nothing until new Power cycle/reset occurs - } } } diff --git a/nbproject/Makefile-genesis.properties b/nbproject/Makefile-genesis.properties index ccefd2c..f91c1a9 100644 --- a/nbproject/Makefile-genesis.properties +++ b/nbproject/Makefile-genesis.properties @@ -1,11 +1,11 @@ # -#Tue Jul 09 19:36:46 PDT 2024 -attiny404.com-microchip-mplab-mdbcore-PK5Tool-PK5ToolImpl.md5=8ed9aa4326bfc0c1a849e697826741b7 +#Wed Jul 10 08:03:09 PDT 2024 attiny404.languagetoolchain.version=2.46 attiny404.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=bf89cdcdd6c0a49174fe4b605ef2b42d conf.ids=,attiny404 host.id=2ov5-ff4p-rv -configurations-xml=e56c7c9ee537971b71816dcaac78a7cf +configurations-xml=a2902459fa41badc4b7c9fbc5e9c3988 +attiny404.platformTool.md5=null com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321 attiny404.languagetoolchain.dir=/opt/microchip/xc8/v2.46/bin proj.dir=/home/ronin/Documents/projects/freelance/laith_naaman/fg004a_test.X diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml index 45a215f..e5a7675 100644 --- a/nbproject/configurations.xml +++ b/nbproject/configurations.xml @@ -212,8 +212,6 @@ - @@ -316,7 +314,7 @@ ATtiny404 - PK5Tool + noID XC8 2.46 2 @@ -467,8 +465,6 @@ - diff --git a/nbproject/private/configurations.xml b/nbproject/private/configurations.xml index c998f00..0baf893 100644 --- a/nbproject/private/configurations.xml +++ b/nbproject/private/configurations.xml @@ -22,7 +22,7 @@ - :=MPLABComm-USB-Microchip:=<vid>04D8:=<pid>9036:=<rev>0100:=<man>Microchip Technology Incorporated:=<prod>MPLAB PICkit 5:=<sn>020026702RYN031742:=<drv>x:=<xpt>b:=end + noToolString /opt/microchip/xc8/v2.46/bin place holder 1 diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 420dcec..49034af 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,12 +3,8 @@ - file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/main.c - file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/load.c - file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/load.h - file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/config.h - file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/RegEdit.c - file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a.X/ADC.c + file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a_test.X/main.c + file:/home/ronin/Documents/projects/freelance/laith_naaman/fg004a_test.X/config.h