I am considering building a microcontroller HAT for Raspberry Pi Model B+. Since the Pi have the SPI bus exposed and some
avrdude fork supports using it directly, I am hoping that my HAT can allow Raspberry Pi talk to the ATmega328P using SPI ICSP for flashing the chip instead of using serial and some serial bootloader. However the pins should be disengaged from the Pi when not required so that other SPI peripherals can be connected to both devices too. Similar situation exists for I2C, UART buses and one GPIO pin. All pin dis/engaging is done using one PCF8574 chip on Pi's I2C bus.
I know very well that I can run the ATmega328P at 3.3V, possibly overclock it to 16MHz, but I am asking about doing this with the microcontroller running at 5V. At 3.3V disengaging the pins requires just some CD4066s