Updated :
I did place the sections into a routine way. I re-modify my code. Almost the same code, except a bit more "modular"
Issue : The Add section still give me some problems. Sometime, it work, and then it is not, I even see the Over Flow ==> E the Numbers are lock and the add button is lock <== That is expected, that mean it did go through the Add Section. The clear work just great. Still have double entry, and I got the feeling my keypad circuit need to be change. The cause is : When I press a key, the voltage level is not approaching a LOW level for the input of the 74HC14. It is in the "If Zone" <-- "Can Not Make Up It Mind Level". So I will re-design the keypad circuit with LM339, and add a 555 circuit in a monostable mode to take care of the interrupt signal <-- possible cause of the "double" entry. The interrupt signal came from a 74LS20. The 555 is the "deboucing" circuit. And also, I may add a latch chip between the 74LS14 ( that is the buffer after the LM339 output ) and the 4021. Maybe the 555 output ? , or another digital out pin to take care of that ? 555 is a more reliable.
As for my code, I will keep it and test it with the new keypad circuit. Well I may change a bit the Add section... I press Add, and it display : 0000012 . That is just cosmetic bug, I will fix that in the Add section. Just replace the 0 before the 1 with 0x0F <-- code for Display Blank to be send at the MAX7219.
I know, it is sound overkill, I need reliability, that is why I overkill in my circuits and code. I am trying to remove Murphay's Law of the equation. Input + Murphay's Law = Garbage Output
Next post is the updated code.