Currently I'm designing simple digital piano model. I used tons of decoders and And's to build my project. In simulation those ANDs are connected and enables external int0. So that If any button is pressed, this triggers button play function regardless of other processes. But in PCB and soldering i find these ANDs quite annoying. So I'm trying to omit those ANDs by changing my code. Is there any software interrupts that triggers automatically if any single input reaches zero? Or FPGA like component in Atmega 128? or do I have to write button scanning code in every single lines of my main code(I scanned datasheet but didn't reached success)
74148 is 8 to 3 encoder
With lots of keys, you may want to use a series of parallel-in shift registers (e.g. 74HC(T)165 ... 8 keys per unit) - daisy chained to each other - and read their values all at once every 10 ms or so using the ATMega128 SPI interface.