FYI, using his code, i had similar problem as markcadam, so i decide to use my 'easy to use' INCLUDE with the same PIC and crystal... confirm that my hardware was good (EasyPIC4 + Keypad 4X4 adapter). Worked with internal pull-up AND external (of course).
Then i worked around his code. Use LATB intead of PORTB to write to the port for safety sake. On a whole port write, it doesn't really matter.. but when you write to few bit .. it may cause some problem. In this case leaving PORTB AS IS, will work anyways.
Writing to PORT before TRIS is also for safety sake even if some don't believe itBut if you leave it like this... it still working.. but sometimes you have some screwed values
BUT the real magic is in the @ nop. remove those lines and the readings are screwed up.. or intermittent. just by this famous PIC18Xxxxx feature called 'Read/Modify/write' behaviour.
18Fs are much noise sensitive.. so i would avoid to use internal weak-pull-ups... IMHO.. you know i hate those anyways![]()
Bookmarks