The Testing program for the ATtiny404 Socket Protection project.
Go to file
jakeg00dwin c64fb08bec MPLABX config updates 2024-07-24 17:54:59 -07:00
.generated_files/flags/default Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
.template_files Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
build/default Updated the repo with the load.h and load.c files in order to impliment the Low Power Operation Mode. 2024-07-02 15:27:57 -07:00
dist/default Adding the binary output as well 2024-07-02 08:45:33 -07:00
inc Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
mocks Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
nbproject MPLABX config updates 2024-07-24 17:54:59 -07:00
queuelogs Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
src defined the F_CPU here 2024-07-24 17:54:41 -07:00
tests Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
.gitignore Added more stuff to not track. 2024-07-24 17:21:57 -07:00
CMakeLists.txt Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
Doxyfile Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
Makefile Converted the template unix project to mplabx 2024-07-01 17:53:09 -07:00
README.md Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
avr-gcc-toolchain.cmake Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
compile_commands.json Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
defmplabxtrace.log Converted the template unix project to mplabx 2024-07-01 17:53:09 -07:00
defmplabxtrace.log.inx Converted the template unix project to mplabx 2024-07-01 17:53:09 -07:00
otto.sh Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00
setup.sh Converted to hybrid between MPLABX and Cmake for test harness. 2024-07-24 17:21:29 -07:00

README.md

FG004_A(Triac Testing)

Description

This embedded firmware is the testing mode for the triac software.

It causes the attiny404 to generate pulses continuously, which are delayed by a value configured in the config.h file.

The timing is done after the PZC(positive zero crossing) of the AC input waveform.

Micro Controller Pins

ATtiny404

  1. VDD(+5v)
  2. PA4(ADC_LOAD1)
  3. PA5(ADC_LOAD2)
  4. PA6(ADC_LOAD3)
  5. PA7(zerocrossing)
  6. PB3(G2)
  7. PB2(G3)
  8. PB1(SDA)
  9. PB0(SCL)
  10. RST(NC)
  11. PA1(G1)
  12. PA2(NC)
  13. PA3(NC)
  14. VSS(GND)

key NC:: Not Connected PBX:: Port B pin X PAX:: Port A pin X RST:: Reset pin

Project Layout

Tree -L 1, output

.
├── avr-gcc-toolchain.cmake
├── build
├── CMakeLists.txt
├── compile_commands.json -> ./build/compile_commands.json
├── docs
├── Doxyfile
├── inc
├── mocks
├── otto.sh
├── README.md
├── setup.sh
├── src
└── tests

6 directories, 7 files

The source code required to run/build the project is in the /src directory, with the headers residing inside the /inc directory for most public modules.

All other directories are for supporting the development cycle and are used for testitng the code base to ensure accuracy and quality. These are contained in the tests and mocks directories.

Documentation that has been generated is inside the docs folder which contains the html output that can be browswed via your regular web browser.

PDF genreation from the doumentaiton is also possible if enabled through the Doxyfile inside the projects root directory.

The build directory contains the output and makefiles genrerated automatically when using CMake.

This build directory also holds the bin files genreated along with the hex and elf files.

Build Requirements

  • AVR-GCC toolchain OR XC8 from microchip.
  • Make OR CMAKE
  • avrdude
  • A AVR programmer, usbasp for older chips and UPDI for newer ones.

Dev Requirements

  • ATtiny404 series micro-controller
  • AVR-GCC toolchain.
  • Cmake
  • cpputest(Unit testing harness.)
  • Doxygen(For documentation)
  • Git(For version control)

Running Unit Tests

To run the cppunit tests you can use the included shell script inside a bash shell.

echo "1" | ./otto.sh

The command runs the otto script which automates parts of the development cycle such as running and building tests, compiling hex files and flashing the code to a micro-controller using arvdude.

Roadmap

Some stuff that still needs done.

  • Add ADC Mocked interface.
  • Write tests for ADC Mock
  • Write ZCD using ADC Mock.
  • Write ADC version for devboard(328p)
  • Write ADC version for ATtiny404
  • Add GPIO mock?
  • Add GPIO mock tests.
  • Add GPIO module.
  • Add Triac module.
  • Add Triac tests.