Combined code for the ATtiny404 micro-controller that combines the relay testing code and the socket protection code. It also adds some additional features.
Go to file
jakeg00dwin cb928b22b8 Finished two functions to get relays enabled/disabled on zero crossing. 2024-09-05 14:36:27 -07:00
.generated_files/flags/attiny404 MPLABX added existing files 2024-09-03 16:40:01 -07:00
.template_files Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
build Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
debug/attiny404/queuelogs Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
dist MPLABX 2024-09-05 13:44:46 -07:00
inc Updated documentation comments 2024-09-05 13:29:26 -07:00
mocks Added mocks module for the ADC 2024-09-02 13:52:56 -07:00
nbproject MPLAbX 2024-09-05 13:29:17 -07:00
queuelogs Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
src Finished two functions to get relays enabled/disabled on zero crossing. 2024-09-05 14:36:27 -07:00
tests Added test to ensure the relay is activated/deactivated for timing testing. 2024-09-03 18:48:52 -07:00
.gitignore Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
CMakeLists.txt cleaned up interfaces for mocking 2024-09-02 13:33:30 -07:00
Doxyfile Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
Makefile Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
README.md Added note about changes in MPLABX config's power for the pickit5. 2024-09-03 16:52:49 -07:00
avr-gcc-toolchain.cmake Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
defmplabxtrace.log Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
defmplabxtrace.log.inx Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
otto.sh Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00
setup.sh Inital commit of relay repo's code 2024-08-29 14:06:38 -07:00

README.md

Combined Relay and Socket Protection

Description

This embedded firmware is a combination of the Relay_Tester repo and the sockets protection code.

NOTE The setup currently has the pickit powersupply option disabled, as driving the circuit off it is a bad idea when you have relays being powered on the circuit as well.

Micro Controller Pins

ATtiny404

  1. VDD(+5v)
  2. PA4(SW2/BREAK)
  3. PA5(SW1/MAKE)
  4. PA6(RELAY_READ)
  5. PA7(RELAY_OUT)
  6. PB3(BIT6)
  7. PB2(BIT5)
  8. PB1(BIT4)
  9. PB0(BIT3)
  10. RST(NC)
  11. PA1(BIT2)
  12. PA2(BIT1)
  13. PA3(BIT0)
  14. VSS(GND)

key NC:: Not Connected PBX:: Port B pin X PAX:: Port A pin X RST:: Reset pin BIT:: A bit place out of a byte of data for output

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.