Welcome, Guest
Username: Password: Secret Key Remember me
  • Page:
  • 1
  • 2

TOPIC: pic to ps2 communication

Re: pic to ps2 communication 9 years 6 months ago #14730

  • Roshan
  • Roshan's Avatar
  • Offline
  • Fresh Boarder
Hi All !

I want to decode ps2 keyboard. I searched other sites & find some info.

One code is attached written in picbasic. I convert one part in pds & try to receive data.

But could not received data in correct format.

There are same make code, data then break code etc.

I could not received make code.

Here is my code.
scan:
         sc = 0
         Input Key_Clock
         Input Key_Data 

lp1:
        If Key_Clock = 0 Then
            GoTo lp1
            EndIf
lp2:
        If Key_Clock = 1 Then
            GoTo lp2
            EndIf 
        'data start            
'::::::::::::::::::::::::::::::::
        For j = 0 To 9 Step 1
lp3:
        If Key_Clock = 0 Then
            GoTo lp3
            EndIf
            If Key_Data = 1 Then
                SetBit d,j
                Else
                ClearBit d,j
                EndIf
             
                Next
               Clear PORTB
               Clear PORTC 
                d = d >> 1
                If STATUS.0 = 1 Then
                    Set PORTC.0
                    EndIf
                 d = d >> 1
                 If STATUS . 0  = Then
                    Set PORTC.1
                    EndIf
                    
                               
        
        PORTB = _d
 
    
    
            
            DelayMS 1000
                        
            Clear Enable_KeyBoard_Clock
             GoTo scan
            
            While 1 = 1 
            Wend
Attachments:

Re: pic to ps2 communication 9 years 6 months ago #1509

You've got a complete program to work with - I would focus on porting the attached program to Swordfish

You will have to make workarounds for the LOOKUP code - perhaps Const Array's would be the answer. Everything else would be almost 1:1

Re: pic to ps2 communication 9 years 6 months ago #1510

Hi Roshan,

Just a quick comment on LightSpeeds previous post;
You've got a complete program to work with - I would focus on porting the attached program to Swordfish
Given you have posted in the Proton forum, there is no direct advantage converting the program to SF, using Proton would do the job fine as well.

Re: pic to ps2 communication 9 years 6 months ago #1512

  • Roshan
  • Roshan's Avatar
  • Offline
  • Fresh Boarder
Hi !

When i press key "A" on the key board then keyboard send data to output with in folowing pattern.

Make Code which $F0
Ascii Code Of "A"
Break Code Again

I am trying to receive first Make code then i will go for next.

Attached program is written In melabs picbasic.

Re: pic to ps2 communication 9 years 6 months ago #1513

This link should really help you out Roshan http://users.picbasic.org/Howto/PC_keyb ... yboard.htm

Lots of info, and three example programs at the bottom of the page

Re: pic to ps2 communication 9 years 6 months ago #1514

  • Roshan
  • Roshan's Avatar
  • Offline
  • Fresh Boarder
Hi !

I sucessfully decoded ps2 keyboard.

still it is incomplete but project start working,

now it is decoding make code every time.

work on progress.
  • Page:
  • 1
  • 2
Time to create page: 0.240 seconds