Browse Source

wip

master
Your Name 4 years ago
parent
commit
799795f0aa
32 changed files with 1740 additions and 1 deletions
  1. +4
    -0
      .gitignore
  2. BIN
      60hz_Divider/datasheets/sn74ls14.pdf
  3. BIN
      60hz_Divider/datasheets/sn74ls90.pdf
  4. +113
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/Makefile
  5. +158
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-default.mk
  6. +10
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-genesis.properties
  7. +69
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-impl.mk
  8. +36
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-local-default.mk
  9. +13
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-variables.mk
  10. +73
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Package-default.bash
  11. +160
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/configurations.xml
  12. +25
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/private/configurations.xml
  13. +6
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/private/private.xml
  14. +29
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/project.xml
  15. +31
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/newmain.c
  16. +113
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/Makefile
  17. +23
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/main.c
  18. +158
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-default.mk
  19. +10
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-genesis.properties
  20. +69
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-impl.mk
  21. +36
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-local-default.mk
  22. +13
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-variables.mk
  23. +73
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Package-default.bash
  24. +160
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/configurations.xml
  25. +25
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/private/configurations.xml
  26. +30
    -0
      Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/project.xml
  27. +0
    -0
      Attiny_Solar_Energy_Harvest/datasheets/Atmel-8127-AVR-8-bit-Microcontroller-ATtiny4-ATtiny5-ATtiny9-ATtiny10_Datasheet.pdf
  28. +0
    -0
      Attiny_Solar_Energy_Harvest/datasheets/SHT10_11_15.pdf
  29. +0
    -0
      Attiny_Solar_Energy_Harvest/datasheets/drv5032.pdf
  30. +299
    -0
      Attiny_Solar_Energy_Harvest/docs/21.tex
  31. BIN
      Attiny_Solar_Energy_Harvest/resources/ATtiny4_5_9_10_20_40Programmer/.ATtiny4_5_9_10_20_40Programmer.ino.swp
  32. +4
    -1
      Attiny_Solar_Energy_Harvest/resources/ATtiny4_5_9_10_20_40Programmer/ATtiny4_5_9_10_20_40Programmer.ino

+ 4
- 0
.gitignore View File

@ -0,0 +1,4 @@
/Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/build/
/Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/dist/
/Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/build/
/Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/dist/

BIN
60hz_Divider/datasheets/sn74ls14.pdf View File


BIN
60hz_Divider/datasheets/sn74ls90.pdf View File


+ 113
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/Makefile View File

@ -0,0 +1,113 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
# WARNING: the IDE does not call this target since it takes a long time to
# simply run make. Instead, the IDE removes the configuration directories
# under build and dist directly without calling make.
# This target is left here so people can do a clean when running a clean
# outside the IDE.
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

+ 158
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-default.mk View File

@ -0,0 +1,158 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Include project Makefile
ifeq "${IGNORE_LOCAL}" "TRUE"
# do not include local makefile. User is passing all local related variables already
else
include Makefile
# Include makefile containing local settings
ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk"
include nbproject/Makefile-local-default.mk
endif
endif
# Environment
MKDIR=mkdir -p
RM=rm -f
MV=mv
CP=cp
# Macros
CND_CONF=default
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else
IMAGE_TYPE=production
OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif
ifeq ($(COMPARE_BUILD), true)
COMPARISON_BUILD=
else
COMPARISON_BUILD=
endif
ifdef SUB_IMAGE_ADDRESS
else
SUB_IMAGE_ADDRESS_COMMAND=
endif
# Object Directory
OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
# Distribution Directory
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=newmain.c
# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/newmain.o
POSSIBLE_DEPFILES=${OBJECTDIR}/newmain.o.d
# Object Files
OBJECTFILES=${OBJECTDIR}/newmain.o
# Source Files
SOURCEFILES=newmain.c
CFLAGS=
ASFLAGS=
LDLIBSOPTIONS=
############# Tool locations ##########################################
# If you copy a project from one host to another, the path where the #
# compiler is installed may be different. #
# If you open this project with MPLAB X in the new host, this #
# makefile will be regenerated and the paths will be corrected. #
#######################################################################
# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build
FIXDEPS=fixDeps
.build-conf: ${BUILD_SUBPROJECTS}
ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE)
endif
${MAKE} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
MP_PROCESSOR_OPTION=ATtiny10
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/newmain.o: newmain.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/newmain.o.d
@${RM} ${OBJECTDIR}/newmain.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/newmain.o.d" -MT "${OBJECTDIR}/newmain.o.d" -MT ${OBJECTDIR}/newmain.o -o ${OBJECTDIR}/newmain.o newmain.c
else
${OBJECTDIR}/newmain.o: newmain.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/newmain.o.d
@${RM} ${OBJECTDIR}/newmain.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/newmain.o.d" -MT "${OBJECTDIR}/newmain.o.d" -MT ${OBJECTDIR}/newmain.o -o ${OBJECTDIR}/newmain.o newmain.c
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assemble
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assembleWithPreprocess
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.map -D__DEBUG=1 -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -gdwarf-2 -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -gdwarf-3 $(COMPARISON_BUILD) -Wl,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -o dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1
@${RM} dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.hex
else
dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.map -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -gdwarf-3 $(COMPARISON_BUILD) -Wl,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -o dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}/avr-objcopy -O ihex "dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.hex"
endif
# Subprojects
.build-subprojects:
# Subprojects
.clean-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r build/default
${RM} -r dist/default
# Enable dependency checking
.dep.inc: .depcheck-impl
DEPFILES=$(shell "${PATH_TO_IDE_BIN}"mplabwildcard ${POSSIBLE_DEPFILES})
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

+ 10
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-genesis.properties View File

@ -0,0 +1,10 @@
#
#Tue Mar 24 00:44:11 EDT 2020
default.Pack.dfplocation=/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10
default.languagetoolchain.dir=/opt/microchip/xc8/v2.10/bin
configurations-xml=dc486da706a233a5325c3abb5c6e1e8e
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6e453b0cf7f7da72a932cfdb2f655401
default.languagetoolchain.version=2.10
host.platform=linux
conf.ids=default
default.com-microchip-mplab-nbide-toolchainXC8-XC8LanguageToolchain.md5=23d12c447ed4f9462f01e2202bc2f36a

+ 69
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-impl.mk View File

@ -0,0 +1,69 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=test2.X
# Active Configuration
DEFAULTCONF=default
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=default
# build
.build-impl: .build-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean
# all
.all-impl: .all-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build
# dependency checking support
.depcheck-impl:
# @echo "# This code depends on make tool being used" >.dep.inc
# @if [ -n "${MAKE_VERSION}" ]; then \
# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
# echo "include \$${DEPFILES}" >>.dep.inc; \
# echo "endif" >>.dep.inc; \
# else \
# echo ".KEEP_STATE:" >>.dep.inc; \
# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
# fi

+ 36
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-local-default.mk View File

@ -0,0 +1,36 @@
#
# Generated Makefile - do not edit!
#
#
# This file contains information about the location of compilers and other tools.
# If you commmit this file into your revision control server, you will be able to
# to checkout the project and build it from the command line with make. However,
# if more than one person works on the same project, then this file might show
# conflicts since different users are bound to have compilers in different places.
# In that case you might choose to not commit this file and let MPLAB X recreate this file
# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at
# least once so the file gets created and the project can be built. Finally, you can also
# avoid using this file at all if you are only building from the command line with make.
# You can invoke make with the values of the macros:
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
PATH_TO_IDE_BIN=/opt/microchip/mplabx/v5.25/mplab_platform/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
PATH:=/opt/microchip/mplabx/v5.25/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="/opt/microchip/mplabx/v5.25/sys/java/jre1.8.0_181/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="/opt/microchip/xc8/v2.10/bin/xc8-cc"
# MP_CPPC is not defined
# MP_BC is not defined
MP_AS="/opt/microchip/xc8/v2.10/bin/xc8-cc"
MP_LD="/opt/microchip/xc8/v2.10/bin/xc8-cc"
MP_AR="/opt/microchip/xc8/v2.10/bin/xc8-ar"
DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v5.25/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="/opt/microchip/xc8/v2.10/bin"
# MP_CPPC_DIR is not defined
# MP_BC_DIR is not defined
MP_AS_DIR="/opt/microchip/xc8/v2.10/bin"
MP_LD_DIR="/opt/microchip/xc8/v2.10/bin"
MP_AR_DIR="/opt/microchip/xc8/v2.10/bin"
# MP_BC_DIR is not defined

+ 13
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Makefile-variables.mk View File

@ -0,0 +1,13 @@
#
# Generated - do not edit!
#
# NOCDDL
#
CND_BASEDIR=`pwd`
# default configuration
CND_ARTIFACT_DIR_default=dist/default/production
CND_ARTIFACT_NAME_default=test2.X.production.hex
CND_ARTIFACT_PATH_default=dist/default/production/test2.X.production.hex
CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package
CND_PACKAGE_NAME_default=test2.x.tar
CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/test2.x.tar

+ 73
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/Package-default.bash View File

@ -0,0 +1,73 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
CND_CONF=default
CND_DISTDIR=dist
TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
OUTPUT_BASENAME=test2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
PACKAGE_TOP_DIR=test2.x/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/test2.x/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/package/test2.x.tar
cd ${TMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/test2.x.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}

+ 160
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/configurations.xml View File

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>newmain.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="default" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>ATtiny10</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool></platformTool>
<languageToolchain>XC8</languageToolchain>
<languageToolchainVersion>2.10</languageToolchainVersion>
<platform>2</platform>
</toolsSet>
<packs>
<pack name="ATtiny_DFP" vendor="Microchip" version="2.0.10"/>
</packs>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
<subordinates>
</subordinates>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<HI-TECH-COMP>
<property key="additional-warnings" value="true"/>
<property key="asmlist" value="true"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="define-macros" value=""/>
<property key="disable-optimizations" value="false"/>
<property key="extra-include-directories" value=""/>
<property key="favor-optimization-for" value="-speed,+space"/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="identifier-length" value="255"/>
<property key="local-generation" value="false"/>
<property key="operation-mode" value="free"/>
<property key="opt-xc8-compiler-strict_ansi" value="false"/>
<property key="optimization-assembler" value="true"/>
<property key="optimization-assembler-files" value="true"/>
<property key="optimization-debug" value="false"/>
<property key="optimization-invariant-enable" value="false"/>
<property key="optimization-invariant-value" value="16"/>
<property key="optimization-level" value="-O1"/>
<property key="optimization-speed" value="false"/>
<property key="optimization-stable-enable" value="false"/>
<property key="pack-struct" value="true"/>
<property key="preprocess-assembler" value="true"/>
<property key="short-enums" value="true"/>
<property key="undefine-macros" value=""/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="verbose" value="false"/>
<property key="warning-level" value="-3"/>
<property key="what-to-do" value="ignore"/>
</HI-TECH-COMP>
<HI-TECH-LINK>
<property key="additional-options-checksum" value=""/>
<property key="additional-options-code-offset" value=""/>
<property key="additional-options-command-line" value=""/>
<property key="additional-options-errata" value=""/>
<property key="additional-options-extend-address" value="false"/>
<property key="additional-options-trace-type" value=""/>
<property key="additional-options-use-response-files" value="false"/>
<property key="backup-reset-condition-flags" value="false"/>
<property key="calibrate-oscillator" value="false"/>
<property key="calibrate-oscillator-value" value="0x3400"/>
<property key="clear-bss" value="true"/>
<property key="code-model-external" value="wordwrite"/>
<property key="code-model-rom" value=""/>
<property key="create-html-files" value="false"/>
<property key="data-model-ram" value=""/>
<property key="data-model-size-of-double" value="24"/>
<property key="data-model-size-of-double-gcc" value="no-short-double"/>
<property key="data-model-size-of-float" value="24"/>
<property key="data-model-size-of-float-gcc" value="no-short-float"/>
<property key="display-class-usage" value="false"/>
<property key="display-hex-usage" value="false"/>
<property key="display-overall-usage" value="true"/>
<property key="display-psect-usage" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="fill-flash-options-addr" value=""/>
<property key="fill-flash-options-const" value=""/>
<property key="fill-flash-options-how" value="0"/>
<property key="fill-flash-options-inc-const" value="1"/>
<property key="fill-flash-options-increment" value=""/>
<property key="fill-flash-options-seq" value=""/>
<property key="fill-flash-options-what" value="0"/>
<property key="format-hex-file-for-download" value="false"/>
<property key="initialize-data" value="true"/>
<property key="input-libraries" value="libm"/>
<property key="keep-generated-startup.as" value="false"/>
<property key="link-in-c-library" value="true"/>
<property key="link-in-c-library-gcc" value=""/>
<property key="link-in-peripheral-library" value="false"/>
<property key="managed-stack" value="false"/>
<property key="opt-xc8-linker-file" value="false"/>
<property key="opt-xc8-linker-link_startup" value="false"/>
<property key="opt-xc8-linker-serial" value=""/>
<property key="program-the-device-with-default-config-words" value="true"/>
<property key="remove-unused-sections" value="true"/>
</HI-TECH-LINK>
<XC8-CO>
<property key="coverage-enable" value=""/>
</XC8-CO>
<XC8-config-global>
<property key="advanced-elf" value="true"/>
<property key="gcc-opt-driver-new" value="true"/>
<property key="gcc-opt-std" value="-std=c99"/>
<property key="gcc-output-file-format" value="dwarf-3"/>
<property key="omit-pack-options" value="false"/>
<property key="output-file-format" value="-mcof,+elf"/>
<property key="stack-size-high" value="auto"/>
<property key="stack-size-low" value="auto"/>
<property key="stack-size-main" value="auto"/>
<property key="stack-type" value="compiled"/>
<property key="user-pack-device-support" value=""/>
</XC8-config-global>
</conf>
</confs>
</configurationDescriptor>

+ 25
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/private/configurations.xml View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<projectmakefile>Makefile</projectmakefile>
<defaultConf>0</defaultConf>
<confs>
<conf name="default" type="2">
<platformToolSN></platformToolSN>
<languageToolchainDir>/opt/microchip/xc8/v2.10/bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
</mdbdebugger>
<runprofile version="6">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>

+ 6
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/private/private.xml View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
</open-files>
</project-private>

+ 29
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/nbproject/project.xml View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>tests1</name>
<name>test2</name>
<name>test1</name>
<creation-uuid>1f6b2f6c-8c6d-40dd-a737-d73d987b2bef</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<asminc-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<make-dep-projects/>
<sourceRootList/>
<confList>
<confElem>
<name>default</name>
<type>2</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
</configuration>
</project>

+ 31
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests1.X/newmain.c View File

@ -0,0 +1,31 @@
/*
* File: newmain.c
* Author: dev
*
* Created on March 23, 2020, 11:48 PM
*/
#include <xc.h>
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
//Write CCP
CCP = 0xD8;
//change CLK to 128KHz
CLKMSR = 0b01;
// PB2 output
DDRB = 1<<2;
while(1)
{
// Toggle PB2
PINB = 1<<2;
//_delay_ms(500);
}
}

+ 113
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/Makefile View File

@ -0,0 +1,113 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
# WARNING: the IDE does not call this target since it takes a long time to
# simply run make. Instead, the IDE removes the configuration directories
# under build and dist directly without calling make.
# This target is left here so people can do a clean when running a clean
# outside the IDE.
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

+ 23
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/main.c View File

@ -0,0 +1,23 @@
#include <xc.h>
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
//Write CCP (to enable changing clock)
CCP = 0xD8;
//change CLK to 128KHz
CLKMSR = 0b01;
// PB2 change to output
DDRB = 1<<2;
while(1)
{
// Toggle PB2 Hi/Low
PINB = 1<<2;
//_delay_ms(500);
}
}

+ 158
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-default.mk View File

@ -0,0 +1,158 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Include project Makefile
ifeq "${IGNORE_LOCAL}" "TRUE"
# do not include local makefile. User is passing all local related variables already
else
include Makefile
# Include makefile containing local settings
ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk"
include nbproject/Makefile-local-default.mk
endif
endif
# Environment
MKDIR=mkdir -p
RM=rm -f
MV=mv
CP=cp
# Macros
CND_CONF=default
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else
IMAGE_TYPE=production
OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif
ifeq ($(COMPARE_BUILD), true)
COMPARISON_BUILD=
else
COMPARISON_BUILD=
endif
ifdef SUB_IMAGE_ADDRESS
else
SUB_IMAGE_ADDRESS_COMMAND=
endif
# Object Directory
OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
# Distribution Directory
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=main.c
# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.o
POSSIBLE_DEPFILES=${OBJECTDIR}/main.o.d
# Object Files
OBJECTFILES=${OBJECTDIR}/main.o
# Source Files
SOURCEFILES=main.c
CFLAGS=
ASFLAGS=
LDLIBSOPTIONS=
############# Tool locations ##########################################
# If you copy a project from one host to another, the path where the #
# compiler is installed may be different. #
# If you open this project with MPLAB X in the new host, this #
# makefile will be regenerated and the paths will be corrected. #
#######################################################################
# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build
FIXDEPS=fixDeps
.build-conf: ${BUILD_SUBPROJECTS}
ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE)
endif
${MAKE} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
MP_PROCESSOR_OPTION=ATtiny10
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/main.o.d
@${RM} ${OBJECTDIR}/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/main.o.d" -MT "${OBJECTDIR}/main.o.d" -MT ${OBJECTDIR}/main.o -o ${OBJECTDIR}/main.o main.c
else
${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/main.o.d
@${RM} ${OBJECTDIR}/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -MD -MP -MF "${OBJECTDIR}/main.o.d" -MT "${OBJECTDIR}/main.o.d" -MT ${OBJECTDIR}/main.o -o ${OBJECTDIR}/main.o main.c
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assemble
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assembleWithPreprocess
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.map -D__DEBUG=1 -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -gdwarf-2 -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -gdwarf-3 $(COMPARISON_BUILD) -Wl,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -o dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1
@${RM} dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.hex
else
dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.map -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -Wall -gdwarf-3 $(COMPARISON_BUILD) -Wl,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -o dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}/avr-objcopy -O ihex "dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.hex"
endif
# Subprojects
.build-subprojects:
# Subprojects
.clean-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r build/default
${RM} -r dist/default
# Enable dependency checking
.dep.inc: .depcheck-impl
DEPFILES=$(shell "${PATH_TO_IDE_BIN}"mplabwildcard ${POSSIBLE_DEPFILES})
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

+ 10
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-genesis.properties View File

@ -0,0 +1,10 @@
#
#Tue Apr 14 01:07:13 EDT 2020
default.Pack.dfplocation=/home/dev/.mchp_packs/Microchip/ATtiny_DFP/2.0.10
default.languagetoolchain.dir=/opt/microchip/xc8/v2.10/bin
configurations-xml=5e854234238a55dafe0eba84ce6d1401
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6e453b0cf7f7da72a932cfdb2f655401
default.languagetoolchain.version=2.10
host.platform=linux
conf.ids=default
default.com-microchip-mplab-nbide-toolchainXC8-XC8LanguageToolchain.md5=23d12c447ed4f9462f01e2202bc2f36a

+ 69
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-impl.mk View File

@ -0,0 +1,69 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=tests2.X
# Active Configuration
DEFAULTCONF=default
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=default
# build
.build-impl: .build-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean
# all
.all-impl: .all-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build
# dependency checking support
.depcheck-impl:
# @echo "# This code depends on make tool being used" >.dep.inc
# @if [ -n "${MAKE_VERSION}" ]; then \
# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
# echo "include \$${DEPFILES}" >>.dep.inc; \
# echo "endif" >>.dep.inc; \
# else \
# echo ".KEEP_STATE:" >>.dep.inc; \
# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
# fi

+ 36
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-local-default.mk View File

@ -0,0 +1,36 @@
#
# Generated Makefile - do not edit!
#
#
# This file contains information about the location of compilers and other tools.
# If you commmit this file into your revision control server, you will be able to
# to checkout the project and build it from the command line with make. However,
# if more than one person works on the same project, then this file might show
# conflicts since different users are bound to have compilers in different places.
# In that case you might choose to not commit this file and let MPLAB X recreate this file
# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at
# least once so the file gets created and the project can be built. Finally, you can also
# avoid using this file at all if you are only building from the command line with make.
# You can invoke make with the values of the macros:
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
PATH_TO_IDE_BIN=/opt/microchip/mplabx/v5.25/mplab_platform/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
PATH:=/opt/microchip/mplabx/v5.25/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="/opt/microchip/mplabx/v5.25/sys/java/jre1.8.0_181/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="/opt/microchip/xc8/v2.10/bin/xc8-cc"
# MP_CPPC is not defined
# MP_BC is not defined
MP_AS="/opt/microchip/xc8/v2.10/bin/xc8-cc"
MP_LD="/opt/microchip/xc8/v2.10/bin/xc8-cc"
MP_AR="/opt/microchip/xc8/v2.10/bin/xc8-ar"
DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v5.25/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="/opt/microchip/xc8/v2.10/bin"
# MP_CPPC_DIR is not defined
# MP_BC_DIR is not defined
MP_AS_DIR="/opt/microchip/xc8/v2.10/bin"
MP_LD_DIR="/opt/microchip/xc8/v2.10/bin"
MP_AR_DIR="/opt/microchip/xc8/v2.10/bin"
# MP_BC_DIR is not defined

+ 13
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Makefile-variables.mk View File

@ -0,0 +1,13 @@
#
# Generated - do not edit!
#
# NOCDDL
#
CND_BASEDIR=`pwd`
# default configuration
CND_ARTIFACT_DIR_default=dist/default/production
CND_ARTIFACT_NAME_default=tests2.X.production.hex
CND_ARTIFACT_PATH_default=dist/default/production/tests2.X.production.hex
CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package
CND_PACKAGE_NAME_default=tests2.x.tar
CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/tests2.x.tar

+ 73
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/Package-default.bash View File

@ -0,0 +1,73 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
CND_CONF=default
CND_DISTDIR=dist
TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
OUTPUT_BASENAME=tests2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
PACKAGE_TOP_DIR=tests2.x/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/tests2.x/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/package/tests2.x.tar
cd ${TMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/tests2.x.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}

+ 160
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/configurations.xml View File

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>main.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="default" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>ATtiny10</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool></platformTool>
<languageToolchain>XC8</languageToolchain>
<languageToolchainVersion>2.10</languageToolchainVersion>
<platform>2</platform>
</toolsSet>
<packs>
<pack name="ATtiny_DFP" vendor="Microchip" version="2.0.10"/>
</packs>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
<subordinates>
</subordinates>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<HI-TECH-COMP>
<property key="additional-warnings" value="true"/>
<property key="asmlist" value="true"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="define-macros" value=""/>
<property key="disable-optimizations" value="false"/>
<property key="extra-include-directories" value=""/>
<property key="favor-optimization-for" value="-speed,+space"/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="identifier-length" value="255"/>
<property key="local-generation" value="false"/>
<property key="operation-mode" value="free"/>
<property key="opt-xc8-compiler-strict_ansi" value="false"/>
<property key="optimization-assembler" value="true"/>
<property key="optimization-assembler-files" value="true"/>
<property key="optimization-debug" value="false"/>
<property key="optimization-invariant-enable" value="false"/>
<property key="optimization-invariant-value" value="16"/>
<property key="optimization-level" value="-O1"/>
<property key="optimization-speed" value="false"/>
<property key="optimization-stable-enable" value="false"/>
<property key="pack-struct" value="true"/>
<property key="preprocess-assembler" value="true"/>
<property key="short-enums" value="true"/>
<property key="undefine-macros" value=""/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="verbose" value="false"/>
<property key="warning-level" value="-3"/>
<property key="what-to-do" value="ignore"/>
</HI-TECH-COMP>
<HI-TECH-LINK>
<property key="additional-options-checksum" value=""/>
<property key="additional-options-code-offset" value=""/>
<property key="additional-options-command-line" value=""/>
<property key="additional-options-errata" value=""/>
<property key="additional-options-extend-address" value="false"/>
<property key="additional-options-trace-type" value=""/>
<property key="additional-options-use-response-files" value="false"/>
<property key="backup-reset-condition-flags" value="false"/>
<property key="calibrate-oscillator" value="false"/>
<property key="calibrate-oscillator-value" value="0x3400"/>
<property key="clear-bss" value="true"/>
<property key="code-model-external" value="wordwrite"/>
<property key="code-model-rom" value=""/>
<property key="create-html-files" value="false"/>
<property key="data-model-ram" value=""/>
<property key="data-model-size-of-double" value="24"/>
<property key="data-model-size-of-double-gcc" value="no-short-double"/>
<property key="data-model-size-of-float" value="24"/>
<property key="data-model-size-of-float-gcc" value="no-short-float"/>
<property key="display-class-usage" value="false"/>
<property key="display-hex-usage" value="false"/>
<property key="display-overall-usage" value="true"/>
<property key="display-psect-usage" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="fill-flash-options-addr" value=""/>
<property key="fill-flash-options-const" value=""/>
<property key="fill-flash-options-how" value="0"/>
<property key="fill-flash-options-inc-const" value="1"/>
<property key="fill-flash-options-increment" value=""/>
<property key="fill-flash-options-seq" value=""/>
<property key="fill-flash-options-what" value="0"/>
<property key="format-hex-file-for-download" value="false"/>
<property key="initialize-data" value="true"/>
<property key="input-libraries" value="libm"/>
<property key="keep-generated-startup.as" value="false"/>
<property key="link-in-c-library" value="true"/>
<property key="link-in-c-library-gcc" value=""/>
<property key="link-in-peripheral-library" value="false"/>
<property key="managed-stack" value="false"/>
<property key="opt-xc8-linker-file" value="false"/>
<property key="opt-xc8-linker-link_startup" value="false"/>
<property key="opt-xc8-linker-serial" value=""/>
<property key="program-the-device-with-default-config-words" value="true"/>
<property key="remove-unused-sections" value="true"/>
</HI-TECH-LINK>
<XC8-CO>
<property key="coverage-enable" value=""/>
</XC8-CO>
<XC8-config-global>
<property key="advanced-elf" value="true"/>
<property key="gcc-opt-driver-new" value="true"/>
<property key="gcc-opt-std" value="-std=c99"/>
<property key="gcc-output-file-format" value="dwarf-3"/>
<property key="omit-pack-options" value="false"/>
<property key="output-file-format" value="-mcof,+elf"/>
<property key="stack-size-high" value="auto"/>
<property key="stack-size-low" value="auto"/>
<property key="stack-size-main" value="auto"/>
<property key="stack-type" value="compiled"/>
<property key="user-pack-device-support" value=""/>
</XC8-config-global>
</conf>
</confs>
</configurationDescriptor>

+ 25
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/private/configurations.xml View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<projectmakefile>Makefile</projectmakefile>
<defaultConf>0</defaultConf>
<confs>
<conf name="default" type="2">
<platformToolSN></platformToolSN>
<languageToolchainDir>/opt/microchip/xc8/v2.10/bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
</mdbdebugger>
<runprofile version="6">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>

+ 30
- 0
Attiny_Solar_Energy_Harvest/code/mplab/tests2.X/nbproject/project.xml View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>tests2</name>
<name>tests1</name>
<name>test2</name>
<name>test1</name>
<creation-uuid>1f6b2f6c-8c6d-40dd-a737-d73d987b2bef</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<asminc-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<make-dep-projects/>
<sourceRootList/>
<confList>
<confElem>
<name>default</name>
<type>2</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
</configuration>
</project>

Attiny_Solar_Energy_Harvest/resources/Atmel-8127-AVR-8-bit-Microcontroller-ATtiny4-ATtiny5-ATtiny9-ATtiny10_Datasheet.pdf → Attiny_Solar_Energy_Harvest/datasheets/Atmel-8127-AVR-8-bit-Microcontroller-ATtiny4-ATtiny5-ATtiny9-ATtiny10_Datasheet.pdf View File


Attiny_Solar_Energy_Harvest/resources/SHT10_11_15.pdf → Attiny_Solar_Energy_Harvest/datasheets/SHT10_11_15.pdf View File


Attiny_Solar_Energy_Harvest/resources/drv5032.pdf → Attiny_Solar_Energy_Harvest/datasheets/drv5032.pdf View File


+ 299
- 0
Attiny_Solar_Energy_Harvest/docs/21.tex View File

@ -0,0 +1,299 @@
\documentclass[11pt]{article}
%Gummi|065|=)
\usepackage{graphicx}
\usepackage{caption}
\usepackage{xcolor}
\usepackage[vcentering,dvips]{geometry}
\geometry{papersize={6in,9in},total={4.5in,6.8in}}
%\title{\textbf{Door Alarm}}
\author{Steak Electronics}
\date{}
\begin{document}
%\maketitle
%\tableofcontents
\textcolor{green!60!blue!70}{
\section{Attiny Solar Energy Harvest Tests}}
I have the following:
\begin{itemize}
\item Solar panels
\item Attiny 10
\end{itemize}
To this list, I will add a supercap, and an energy harvesting IC. The goal being to load the super cap during the day, and to run 24/7. I will need an exceptionally low power micro. The super cap will need to be about 3.3V or 5V.
\textcolor{green!60!blue!70}{
\subsection{Micro Considerations}}
The Arduino Atmega328P is not an option. I'm looking to have a current draw of only 1mA max, (ideally 500uA) when active. Moteino is also not an option for this. Those are made for batteries. I want to be battery free. A super cap, however can be used to store energy. I'll get to that shortly.
For micros, I have some Attiny10 on hand, and these have a reasonably low power pull in active mode. Let's build those up first. What will the micro do? No idea. I haven't a clue.
\textcolor{green!60!blue!70}{
\subsubsection{Micro Notes}}
Must run at 1.8V / 1MHz per front page of data sheet, for 200uA draw in active mode.
\\
\\
\textcolor{green!60!blue!70}{
\subsection{Energy Storage}}
I don't want a battery. Let's go with a super cap. The solar panels will only be active some of the time, so I will want to harvest energy with some kind of IC into the cap when the sun is out.\footnote{Reference: www.analog.com/media/en/technical-documentation/technical-articles/solarenergyharvesting.pdf is a start. I'll need to do more research.}
\textcolor{green!60!blue!70}{ \subsection{Make parts, not scrap}} I will
want to make sure that all parts I build are perf board parts, not
breadboard scrap (to be torn down and rebuilt again). This is an Attiny,
so no need to test much, yet.
\textcolor{green!60!blue!70}{
\subsection{Programming}}
To program the Attiny10, I'll use the Arduino adapter from the Junk + Arduino blog. I built it up\footnote{Had slight error where the Arduino + board wouldn't read - pins too short on headers, then the arduino wouldn't boot - due to bad connection on perf board shield. Thankfully, the USB port didn't try to run. Protection circuitry cut in on the laptop.}, and was able to Read the memory. In order to upload to the board, you will need a compiler setup. You can possibly do it in AVRGCC, but instead I opted for either Arduino IDE (via Attiny10Core which didn't work), and then went to Mplab. In order for mplab 5.25 to work, it will need XC8 compiler, and there is a pack that can be downloaded through the IDE to get Attiny10 support.
It appears the AVR Dragon (which I have) can not be used. However, other programmers can be used. Pickit 4, Mkavrii, stk600, I think.
\textcolor{green!60!blue!70}{ \subsubsection{Testing Arduino Loader}}
Tested this with the blink\_LED.c in code folder. The code is as simple as possible.
It is the following:
\begin{verbatim}
//#include <xc.h>
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
// PB2 output
DDRB = 1<<2;
while(1)
{
// Toggle PB2
PINB = 1<<2;
_delay_ms(500);
}
}
\end{verbatim}
When programmed in Mplab, with XC8 compiler, and Attiny10 support, I get the following
hex output:
\begin{verbatim}
:100000000AC020C01FC01EC01DC01CC01BC01AC01B
:1000100019C018C017C011271FBFCFE5D0E0DEBF41
:0A002000CDBF03D000C0F894FFCF5D
:10002A0044E041B940B95FE966E871E05150604087
:0A003A007040E1F700C00000F5CFB0
:02004400DDCF0E
:00000001FF
\end{verbatim}
The content of this hex isn't the focus of this passage. Instead, I want you to review the
results of a D for Dump Memory, by the Arduino Loader.
\begin{verbatim}
Current memory state:
registers, SRAM
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
0000: 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0030: 00 00 00 00 00 00 03 00 00 79 00 03 00 00 00 00
0040: B7 AD AE FA 58 70 63 6B FB 5A B4 1B FF FF 35 3F
0050: 67 D7 33 43 DF 5F FB 72 C9 7D FE E9 9D C5 00 12
NVM lock
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
3F00: FF FF
configuration
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
3F40: FF FF
calibration
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
3F80: 79 FF
device ID
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
3FC0: 1E 90 03 FF
program
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
4000: 0A C0 20 C0 1F C0 1E C0 1D C0 1C C0 1B C0 1A C0
4010: 19 C0 18 C0 17 C0 11 27 1F BF CF E5 D0 E0 DE BF
4020: CD BF 03 D0 00 C0 F8 94 FF CF 44 E0 41 B9 40 B9
4030: 5F E9 66 E8 71 E0 51 50 60 40 70 40 E1 F7 00 C0
4040: 00 00 F5 CF DD CF FF FF FF FF FF FF FF FF FF FF
4050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
4060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
(...some memory omitted here for brevity...)
43E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
43F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
\end{verbatim}
Notice that the "AC020C01F" is set. That is from the hex. But the 01000...
before it seems to be missing. Some deciphering of how the Arduino programs
the Attiny is in order here. It also doesn't end the same.
Regardless, when programming, the Arduino reports 70 bytes written, and
likewise in the Mplab project memorymap.xml file, it also notes 70 bytes
for the sketch. This lines up.\footnote{Although for an unknown reason, every command registers twice on the Arduino serial monitor, but this appears to be harmless.}
The blinking LED works. Let's move on.
\textcolor{green!60!blue!70}{\subsubsection{Conclusion on Arduino Programming Attiny10}}
It's possible, but you have to make a dedicated jig (almost), so it might be easier to use the official programming tools. However, based on this https://www.avrfreaks.net/forum/pickit-4-and-avr-mcu I might not have a choice. So I will use the Arduino for now. But will have to devise what on board parts are req'd for programming, and incorporate into proto board layout.
\textcolor{green!60!blue!70}{ \subsubsection{IO Port Switching Speed}}
Using the above code without any delay\_ms, I get the following results from a default clock
speed, and a 128KHz clock speed. This test was done to confirm that I could change the clock with
\begin{verbatim}
//Write CCP
CCP = 0xD8;
//change CLK to 128KHz
CLKMSR = 0b01;
\end{verbatim}
There was no issue.
\begin{verbatim}
Default CLK (8MHz? or 1MHz?): 160KHz IO Switch
128KHz CLK: 2.5KHz IO Switch
\end{verbatim}
I am going to pursue 128KHz for starters, for lower current dissipation. Note that with the Arduino loader, it is cumbersome to test and change code as you move along. It is
therefore going to be necessary to use a programmer, with a dedicated header on board.
\textcolor{green!60!blue!70}{ \subsubsection{VCC 1.8V}}
The lowest power supported: 1.8V can be applied, without any configuration
needed. It does not affect IO switching speed (although obviously amplitude is affected).
\begin{verbatim}
128KHz CLK (5.0V): 2.5256 KHz IO switch
128KHz CLK (3.3V): 2.5477 KHz IO switch
128KHz CLK (1.8V): 2.5849 KHz IO switch
\end{verbatim}
As voltage drops, IO increases.
\\
\\
\textbf{VCC Dropout voltage:}
\\
From 1.5, it drops out at 1.248V or so. Comes back at about 1.34V
\\
\\
Test size of 1.
\\
\\
Can't run this with one (AA) battery, but you could with 2.
\\
\\
Current Draw: 128KHz - IO test, 1.8V, 0.08mA (~78uA) (tested w/3478A)
\\
\\
\textcolor{green!60!blue!70}{\subsection{Application}}
First, I need a board for these and a programmer, to quickly program. Second, I need an application. I want extremely low power. Hopefully, solar with no batteries, to start. This is extremely low - that is the point. Let's keep this ridiculous.
Given the power requirements put me under 1mA (with my current panels), I'm considering the following: EEPROMs would require SPI protocol. Doable, but overcomplicated for now.
\\
\\
Eink (need to find a small and cheap enough option. So far, they have either too many pins, and/or use too much current. Something like what stores use to display prices would work, but that doesn't get the data out, only makes it readable.),
\\
\\
Third option would be RF. That is a viable path, but not today. Let's skip that for now.
\\
\\
Fourth option that comes to mind is IR. IR diodes, as in TV remotes, would work well here. I am choosing this as the first project. I will have dumb clients, that consist of - Attiny / IR / Sensor powered by solar. I will have a BBB that receives the IR data, and does all intelligent data gathering. To keep things simple, the IR will be binary ADC data, or otherwise sensor numbers. No SPI, no protocol complexity. That would require space on the Attiny.
\\
\\
Let's build some boards based on the above.
\\
\\
For sensors:
While building, I came across an option. Hall effect sensors. I think also capacitive sensors can be used. This may find a use in a gate sensor, for when a driveway gate is opened or closed. With a small battery, it would work for years.
Footprints: I had to make a footprint for this module on board package for one sensor. The solution to get footprints right? copy graphic image and make it into silkscreen on the board. Easy.
The sensor I looked at was a temp and humidity sensor SHT11 (SHT10 is obsolete). It is low power enough. However, it's \$20. So not in my price range. Otherwise, it would work here. Looks like communication is a shift register, or SPI.
\textcolor{green!60!blue!70}{
\subsubsection{Magnetic Current Sensor}}
There is this:
BM14270AMUV-LB
Which is low enough current here (<1mA). But \$7 in qty, and req's I2C. Not today.
\textcolor{green!60!blue!70}{
\subsubsection{Accelerometers}}
These are an option.
Best pinout (for deadbug) is LIS344ALHTR (but lacks vcc down to 1.8)
2nd Best pinout with full 1.8 -3.6 vcc is ADXL337BCPZ-RL7
(Keep in mind, these are low end options only)
(Analog output only. keep it simple for now.)
Runner up to all above, is KXTC9-2050-FR . But has worse pinout.
Going with AD part. \$5 in single qty.
Digital output Accelmeters are cheaper.
All have tiny package sizes.
Since I am grabbing 1 output only, will need to orient or choose correct output.
\textcolor{green!60!blue!70}{
\subsubsection{Temperature Sensors}}
Temperature can be boring, but why not. Let's throw one of these on: LMT84LP . Pin compatible with LM35. Supply current is maybe 8uA. Extremely low.
LM84 (1.5V starts, to 5.5), LM85 (1.8V to 5.5)
\textcolor{green!60!blue!70}{
\subsubsection{Gas Sensors}}
Lowest is 5mV as of writing on dkey. Skipping. The SHT would work, but its too expensive.
\textcolor{green!60!blue!70}{
\subsubsection{Supercap}}
For now, trying this:
FG0V155ZF
\textcolor{green!60!blue!70}{
\subsubsection{Hall Effect Sensors - Push Pull vs Open Drain Outputs}}
\begin{verbatim}9.1.1OutputTypeTradeoffsThe push-pulloutputallowsfor the lowestsystempowerconsumptionbecausethereis no currentleakagepathwhenthe outputdriveshighor low. The open-drainoutputinvolvesa leakagepaththroughthe externalpullupresistorwhenthe outputdriveslow.The open-drainoutputsof multipledevicescan be tied togetherto forma logicalAND.In this setup,if any sensordriveslow, the voltageon the sharednodebecomeslow. Thiscan allowa singleGPIOto measurean arrayofsensors
\end{verbatim} From DRV5032 data sheet.
\textcolor{green!60!blue!70}{
\subsection{Starting Sensors}}
So as a recap, to start with affordable, low power sensors for my project, I have the following types:
\begin{itemize}
\item Temp sensor (cheapest)
\item Magnetic Sensor (hall effect)
\item Movement Sensor (accellerometer) (analog output) (tiny package)
\item capacitive sensor (azoteq)(may only be short range)
\end{itemize}
Output, I have not determined yet. IR will not work, as its too high power. Unless I dedicate a battery just for the IR diode... Or make it battery powered. I'll start with batteries, but for solar panel and supercap, it will likely not be viable, unless I transmit extremely rarely. That is also an option, however.
\subsubsection{Farad to mA}
1.5F supercap can supply 1.5A for 1 second. That is 0.025A for 60 seconds, or 25mA for a minute.
Let's stay I use half that, so 12mA for 60 seconds is my supply. If I transmit once every other hour (when in sunlight)...
\subsection{PCB}
I have built rev2 of the board today. Using an Uno, user must remember to include VCC and GND. So the programming takes up all 6 pins. The 0.1'' headers were slightly close to the resistors, and the top row of VCC and GND headers are separated, so I labeled them V+2, and GND2.\footnote{Forgetting to plug in GND, and or 5v+ (for Uno), while still plugging in the TPI pins, did not break the Attiny10, in my tests today.}
The 0.05'' pin headers work perfect for scope probes. The extra breakout I made demonstrates this.
\subsection{PCB Programming}
By default, the Attiny10 idles around 1.5mA (5V), before programming.
First thing to do, is to program it into a low power mode.
In order to use low power, whilst using the Uno, I will need to add a jumper to the PCB,
so that you can switch between V+2, and V+1. Three pin jumper. Outside pins are each V+, internal goes to Attiny V+. I'll need to remove the trace on gerber rev2, that goes from 4 to VCC.
\subsubsection{PCB programming and use}
It's not possible to leave the Arduino plugged in, while testing the Attiny10.
example: Even if you power down the Uno, and use a jumper to change V+ rails,
the power dissipation through the TPI pins (10,11,12,13) will cause a draw of about 545uA, and the Attiny10 will not toggle its led.
Therefore, not only a power jumper is required to use the Attiny, but also
a 4 or 5 pin 0.1" cable for the TPI pins, must be disconnected before using the Attiny.
\footnote{In code section, mplab - tests2, the power draw of the 128KHz internal CLK with PB2 flipping at about 400us a cycle, at 3V VCC is about 115uA. At 2V it is ~95uA.}
\end{document}

BIN
Attiny_Solar_Energy_Harvest/resources/ATtiny4_5_9_10_20_40Programmer/.ATtiny4_5_9_10_20_40Programmer.ino.swp View File


+ 4
- 1
Attiny_Solar_Energy_Harvest/resources/ATtiny4_5_9_10_20_40Programmer/ATtiny4_5_9_10_20_40Programmer.ino View File

@ -177,6 +177,7 @@ char HVON = 0;
void setup(){
// set up serial
Serial.begin(9600); // you cant increase this, it'll overrun the buffer
Serial.println(F("setupend")); //anything?
// set up SPI
/* SPI.begin();
SPI.setBitOrder(LSBFIRST);
@ -189,6 +190,7 @@ void setup(){
pinMode(HVReset, OUTPUT);
// initialize memory pointer register
setPointer(0x0000);
timeout = 20000;
idChecked = false;
@ -202,7 +204,7 @@ void hvserial()
else
Serial.println(F("High Voltage Programming Disabled"));
Serial.print(F("Pin 9 "));
// M
Serial.print(HVON?F("HIGH"):F("LOW"));
Serial.print(F(" supplies 12v"));
@ -277,6 +279,7 @@ void setLockBits(){
}
void loop(){
Serial.print(F("Start"));
if(!idChecked){
// start_tpi();
checkID();

Loading…
Cancel
Save