Flowchart for main loop            Start            Init port B & RTCC                                    Init state machine             Display key pressed                         End State diagram of interrupt routine No key pressed (noise only) any debounce   scan column    key    use column    Fast scan Debouncing       by column for           & row count key time over          keys        to encode          pressed     found key   no key hit    debounce     key           time not over yet encoded check      key
release
key released