https://github.com/neoxic/atmega-analog-gate
Simple analog gate firmware for ATmega MCUs
https://github.com/neoxic/atmega-analog-gate
analog-gate atmega
Last synced: about 2 months ago
JSON representation
Simple analog gate firmware for ATmega MCUs
- Host: GitHub
- URL: https://github.com/neoxic/atmega-analog-gate
- Owner: neoxic
- License: gpl-3.0
- Created: 2022-02-22T06:15:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T04:51:19.000Z (almost 3 years ago)
- Last Synced: 2025-01-15T19:55:21.404Z (over 1 year ago)
- Topics: analog-gate, atmega
- Language: C
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple analog gate firmware for ATmega MCUs
===========================================
Dependencies
------------
+ cmake
+ avr-gcc
+ avr-libc
+ avrdude
Configuration
-------------
There are a couple of _#define_ values at the beginning of _src/main.c_ to set up the gate.
| Value | Description |
|-------|-------------------------------------------------------------------------------------|
| AVCC | Voltage on the AVCC pin (must be measured with a multimeter) |
| VIN1 | The output pin goes high if voltage on the input pin becomes higher than this value |
| VIN2 | The output pin goes low if voltage on the input pin becomes lower than this value |
* The difference between VIN1 and VIN2 (VIN1 > VIN2) defines the depth of hysteresis between output transitions.
* The output pin can be inverted via the OUT_INV option.
Installation
------------
To build, run (with your own MCU):
cmake -B build -D MCU=ATMEGA32U4
cd build
make
To install on the device using AVRDUDE, run (with your own programmer):
make PROG=usbasp flash
or for Teensy 2.0:
make flash-teensy
Pinout
------
| Pin | I/O | Description |
|-----------|-----|----------------|
| PF4 (PC4) | AIN | Input |
| PD7 | OUT | Output |
| PD6 (PB5) | OUT | Status LED |
Pins in brackets pertain to 32-pin devices, i.e. ATmega88/168/328/etc.