PS/2 click not detecting the key pressed

Discussion on projects that are created by users and posted on mikroElektronika website.
Post Reply
Author
Message
AlexBG
Posts: 5
Joined: 19 Nov 2019 05:11
Location: Mexico

PS/2 click not detecting the key pressed

#1 Post by AlexBG » 23 Jan 2020 18:39

Hi,

I would like to use a PS/2 keyboard for testing some of the WIFI click modules that work with the AT commands. The idea, is to type directly the commands and see the response of the WIFI click module, at run-time, rather than compiling and downloading each command.

For this, I am using the PIC Fusion v7, the PS/2 click demonstration program and associated PS_2_P32MX library, with a PIC32MX795F512L. The PS/2 click module was made by myself, as it is quite simple and the diagram is provided in both, the click’s manual and the help file of the C compiler.

The problem is in the demonstration program; after detecting the pressed key, it is not sending any key code to the USART terminal. After reading some posts here in the Forum, I found a reference to an external program, in which they added the instruction

Code: Select all

IntToStrWithZeros(keydata,txt);
after

Code: Select all

Ps2_Key_Read(&keydata, &special, &down)
So, I tried this and started to get some response at the USART terminal, but I am receiving only a row of four zeros repeated three times with any key I press at the PS/2 keyboard (sorry, I was going to attach an image, but still need to find out how to do it).

I am sure the keyboard is working, as I tested it on a desktop computer. My hardware implementation of the PS/2 click is also working, as I measured with an oscilloscope the clock and data signals directly on the pins of the microcontroller.

I’ve tried the same setup with an Easy PIC board, with the same result. The demonstration program has no problem in detecting each pressed key, but it is not identifying which one was pressed. As these are pre-compiled routines, I cannot investigate or debug further.

Any help for solving this problem, will be much appreciated.

Alex

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: PS/2 click not detecting the key pressed

#2 Post by filip » 28 Feb 2020 16:00

Hi,

Have you made any progress with this issue ?

Regards,
Filip.

AlexBG
Posts: 5
Joined: 19 Nov 2019 05:11
Location: Mexico

Re: PS/2 click not detecting the key pressed

#3 Post by AlexBG » 04 Mar 2020 01:55

Hi Filip,

Not really. My two lines of action are:
1. Buy an original PS/2 Click at the first opportunity, just to be sure everything is okay.
2. In the mean time, I'm adapting to Mikro C the PS/2 interface code found in the following address (it is in Spanish and has a good explanation of the protocol):
http://picmania.garcia-cuervo.net/proye ... do_ps2.htm

I will let you know how it works.

Regards,

Alex

AlexBG
Posts: 5
Joined: 19 Nov 2019 05:11
Location: Mexico

Re: PS/2 click not detecting the key pressed

#4 Post by AlexBG » 20 Apr 2020 17:15

Hi,
I've uploaded a program to Libstock for decoding a PS/2 keyboard, using interrupts and the Mikroe PS/2 click module. You can find it here:

https://libstock.mikroe.com/projects/vi ... -interrupt

I will use this program for sending the AT commands to the Wifi modules, at run time.

Regards,

Alex

Post Reply

Return to “User Projects”