Searching \ for 'keyboard pc and pic' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'keyboard pc and pic'.

Truncated match.
PICList Thread
'keyboard pc and pic'
1999\08\24@114124 by Jose Antonio Gracia Negre

flavicon
face
part 0 416 bytes content-type:text/x-vcard; charset=us-ascii; name="vcard.vcf" (decoded 7bit)

       Anticipated thanks
                                   Jose Antonio Gracia

Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Tarjeta de Jose Antonio  GRACIA NEGRE
Content-Disposition: attachment; filename="vcard.vcf"

Attachment converted: wonderland:vcard.vcf 1 (TEXT/CSOm) (0000BAE2)

1999\08\24@195338 by Tony Nixon

flavicon
picon face
Jose Antonio Gracia Negre wrote:
>
> Hello
>     I want to connect pic 16f84 to a PC like keyboard.
>     A long time ago they asked for something similar.
>     Somebody can send a direction or schemes and program to me to make it. ?
>
>         Anticipated thanks
>                                     Jose Antonio Gracia

Here is a routine to read a 3 X 4 keypad
PortB bits <6:3> = outputs connected to the 4 rows
PortB bits <2:0> = inputs connected to the 3 columns with pull DOWN
resistors.
Set TMR0 for an acceptable delay loop.

Row and Col registers can be defined as a single RAM register if you
like.

keyloop btfss intcon,t0if       ; test for TMR0 overfolw
       goto keyloop

       bcf intcon,t0if         ; clear overflow flag
       ;
       ; SCAN KEYBOARD
       ;
       movlw 0xFF
       movwf keyres            ; final keypress result
       movlw b'00001000'
       movwf row               ; bit corresponding to row being scanned
       ;
scnrow  movf row,w              ; activate keyboard row
       movwf portb
       goto wait1              ; small delay
wait1   goto wait2
wait2   movf portb,w            ; scan column
       andlw b'00000111'       ; mask off row data
       btfss status,z
       goto coldcy             ; column is active, decypher which
       ;
       rlf row                 ; set for next row
       movlw .3
       addwf keyres            ; add for next 3 buttons
       btfss row,7             ; test for last row to scan
       goto scnrow
       ;
       clrf portb
       bcf flag1,keysrv        ; clear key serviced flag
       goto keyloop
       ;
coldcy  movwf col               ; store column result
       btfsc flag1,keysrv      ; has key been serviced already
       goto keyloop            ; yes, ignore keypress
       ;
rolcol  incf keyres
       rrf col                 ; decypher which column
       btfss status,carry
       goto rolcol
       ;
       bsf flag1,keysrv        ; flag key serviced
       movf keyres,w           ; key function routines
       addwf pcl
       goto key1
       goto key2
       goto key3
       goto key4
       goto key5
       goto key6
       goto key7
       goto key8
       goto key9
       goto keystar
       goto key0
       goto keyhatch


--
Best regards

Tony

http://www.picnpoke.com
Email spam_OUTsalesTakeThisOuTspampicnpoke.com

1999\08\24@200212 by Tony Nixon

flavicon
picon face
Doh!

Sorry about the keyboard post.

I noticed the "PC" keyboard reference just as the mouse button was
halfway pressed to send the message.

Oh well, maybe someone can use it.

--
Best regards

Tony

http://www.picnpoke.com
Email .....salesKILLspamspam@spam@picnpoke.com

1999\08\25@043434 by Steve Lawther

flavicon
face
Jose,

    See my web page :-

    http://ourworld.compuserve.com/homepages/steve_lawther/ucindex.htm

    for some info on PC AT keyboards, some PIC code, and (especially) links
to other
    info.

   Also check out the AT keyboard routines (both ends) on Mauricio
Culibrk's PIC
    page:-

    http://www.arne.si/~mauricio/PIC.HTM



    Steve Lawther


> {Original Message removed}

1999\08\26@113522 by Jose Antonio Gracia Negre

flavicon
face
part 0 3315 bytes content-type:text/x-vcard; charset=us-ascii; name="vcard.vcf" (decoded 7bit)

                                           Jose Antonio Gracia


              I have seen your second message. All we were mistaken sometimes

Tony Nixon escribis:

{Quote hidden}

Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Tarjeta de Jose Antonio  GRACIA NEGRE
Content-Disposition: attachment; filename="vcard.vcf"

Attachment converted: wonderland:vcard.vcf 2 (TEXT/CSOm) (0000BC26)

1999\08\26@193722 by Tony Nixon

flavicon
picon face
Jose Antonio Gracia Negre wrote:

> Hello
>   I want to connect pic 16f84 to a PC like keyboard.
>   A long time ago they asked for something similar.
>   Somebody can send a direction or schemes and program to me to make it. ?

>  Anticipated thanks
>  Jose Antonio Gracia

You can use this to interface a PIC to an XT type keyboard. The code as
is does not do anything else.
The scan code bit 0 determines whether a key is pressed (1) or released
(0).

If you need more scan codes I'm afraid you will need to find a table for
them on the web somewhere as I have missplaced my old copy.
Sorry about the length.

         movlw .9            ; set bit counter
         movwf bitcnt
         clrf flag1

mnloop    btfss porta,KBclk   ; (0) test for low/high keyboard clock
         goto clkizlo
         ;
         btfss flag1,hilo    ; (1) ignore if flagged high already
         bsf flag1,hilo      ; (1) flag clock is high
         goto mnloop
         ;
clkizlo   btfss flag1,hilo    ; (1) ignore if flagged low
already
         goto mnloop
         ;
         bcf flag1,hilo      ; (1) flag clock is low
         bcf status,carry
         btfsc porta,KBdat   ; (1) test data input
         bsf status,carry
         rlf keydata         ; move data bit into data register
         decfsz bitcnt       ; test for complete data byte
         goto mnloop         ; not yet
         ;
         movlw .9            ; reset bit counter
         movwf bitcnt
         btfsc keydata,0     ; if bit 0 = 1 then key was released, so
         goto usekey         ; decypher and use keypress
         ;
         btfsc flag1,kysv    ; (2) ignore if key data obtained already
         goto mnloop         ; key is held down and repeating
         ;
         bsf flag1,kysv      ; (2) flag, key data has been read
         bcf status,carry
         rrf keydata,w       ; prepare data to convert to ASCII
         call Table          ; convert to ASCII
         movwf keydata       ; store data until key is released
         goto mnloop
         ;
usekey    ; use keypress
         ;
         goto mnloop

         ;         ______________________________________
         ;
         ; CONVERT KEY DATA TO ASCII
         ;
Table     addwf pcl
         retlw '-'             ; 0
         retlw '-'
         retlw 'd'
         retlw '-'
         retlw 'q'
         retlw '-'
         retlw 'b'
         retlw '-'
         retlw '7'
         retlw '-'
         retlw '-'             ; 10
         retlw '-'
         retlw 'o'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '3'
         retlw '-'
         retlw 'j'
         retlw '-'
         retlw 't'           ; 20
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'z'
         retlw '-'
         retlw '-'     ; carriage return
         retlw '-'
         retlw '-'             ; 30
         retlw '-'
         retlw '1'
         retlw '-'
         retlw 'g'
         retlw '-'
         retlw 'e'
         retlw '-'
         retlw 'm'
         retlw '-'
         retlw '9'           ; 40
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '5'
         retlw '-'
         retlw 'l'           ; 50
         retlw '-'
         retlw 'u'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'c'
         retlw '-'
         retlw 'a'           ; 60
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'f'
         retlw '-'
         retlw 'w'
         retlw '-'
         retlw 'n'           ; 70
         retlw '-'
         retlw '8'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'p'
         retlw '-'
         retlw ' '
         retlw '-'
         retlw '4'           ; 80
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'y'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'x'           ; 90
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '2'
         retlw '-'
         retlw 'h'
         retlw '-'
         retlw 'r'           ; 100
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '0'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'             ; 110
         retlw '-'
         retlw '6'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw 'i'
         retlw '-'
         retlw '-'
         retlw '-'
         retlw '-'             ; 120
         retlw '-'
         retlw 'v'
         retlw '-'
         retlw 's'
         retlw '-'
         retlw '-'
         retlw '-'

--
Best regards

Tony

http://www.picnpoke.com
Email .....salesKILLspamspam.....picnpoke.com

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...