![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Mr Goodwin, I was checking your keypad routine in your tutorials. Could you explain the following subroutine.
call Scan_Keys movlw 0x10 ;check for no key pressed subwf key, w btfss STATUS, Z goto Key_Found call Delay20 goto Keys
__________________
People perish because of lack of knowledge |
|
|
|
|
|
|
(permalink) |
|
Pretty self explanitory really?, the first line scans the keypad, and the next two check if any pressed key was found. If one was, then it jumps to Key_Found to process the key, otherwise it loops back round.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
__________________
People perish because of lack of knowledge |
||
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) | |
|
Quote:
Code:
Keys call Scan_Keys
movlw 0x10 ;check for no key pressed
subwf key, w
btfss STATUS, Z
goto Key_Found
call Delay20
goto Keys
Does this then mean that for 'no key pressed', in 'key' there should be 0x10 or 00010000
__________________
People perish because of lack of knowledge |
||
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Would you explain what happens in terms of voltage levels when I press say key '1' and scan that row? In my case, which I suppose is similar to yours, the columns are tied to Vcc through resistors, and I scan the rows. Initially, the rows are all high
__________________
People perish because of lack of knowledge |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Keypad Code | gregmcc | Micro Controllers | 5 | 11th May 2006 08:01 AM |
| keypad encoder | Mel_noypi | Datasheet/Parts Requests | 5 | 22nd February 2006 02:01 PM |
| 16f628 keypad interface | scarab | Micro Controllers | 2 | 21st April 2004 05:15 AM |
| PicBasic Keypad program | Sora | Micro Controllers | 0 | 20th April 2004 07:01 PM |
| pic keypad | nevada | Electronic Projects Design/Ideas/Reviews | 2 | 25th November 2003 03:45 PM |