My adventure with Raspberry Pi and atmega328p (Arduino)
My goal was to program an Atmega328p using a Raspberry Pi's GPIO interface which is a feature built into avrdude as of something like Avrdude 6.0 or 6.2.
I originally started with a fresh install of Raspbian Bookworm (Debian 12), but run into troubles with libgpiod not having control over the gpio. Whenever avrdude tried to reconfigure the gpio to bit bang the commands it would just throw a error message that it was unable to export the gpio pin. I was also unable to export the gpio pins by interacting with the sys filesystem either which after researching aparently thing have changed in Debian 12 so I reverted. I loaded up Raspbian Buster (Debian 10) and I was able to compile avrdude 6.4 without a problem, read/write my atmega328p chip without incident.
sudo -s
wget https://download-mirror.savannah.gnu.org/releases/avrdude/avrdude-6.4.tar.gz
tar xvf avrdude-6.4.tar.gz
cd avrdude-6.4
apt install libpigpio-dev libgpio-dev
./configure --enable-linuxgpio --enable-linuxspi
make
make install
avrdude -v
/usr/local/bin/avrdude -p atmega328p -c linuxgpio -v
Fuse configuration for 5v 16mhz external clock
/usr/local/bin/avrdude -p atmega328p -c linuxgpio -v -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m
Fuse configuration for 3.3v/5v 8mhz internal RC clock
/usr/local/bin/avrdude -p atmega328p -c linuxgpio -v -U lfuse:w:0xE2:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m
To flash a binary
/usr/local/bin/avrdude -p atmega328p -c linuxgpio -v -U flash:w:simple_blink_test.ino.eightanaloginputs.hex:i