TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136954 times)
  2. FAT32 Library (70069 times)
  3. Network Ethernet Library (56015 times)
  4. USB Device Library (46338 times)
  5. Network WiFi Library (41958 times)
  6. FT800 Library (41266 times)
  7. GSM click (29051 times)
  8. mikroSDK (26480 times)
  9. PID Library (26447 times)
  10. microSD click (25411 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Example

PS2 click with interrupt

Rating:

0

Author: Alejandro Butron Guillen

Last Updated: 2020-04-22

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: Communication

Downloaded: 113 times

Not followed.

License: MIT license  

This program decodes the key strokes from a PS/2 keyboard, connected to a Mikroe PS/2 click module, using an external interrupt. It echoes each pressed key to the UART terminal and stores on a buffer. When the ENTER key is pressed, a line feed together with the content of the buffer are sent to the UART terminal, as a demonstration purpose.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "PS2 click with interrupt" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "PS2 click with interrupt" changes.

Do you want to report abuse regarding "PS2 click with interrupt".

  • Information
  • Comments (4)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

PS2IntDecoder.c

This program decodes the key strokes from a PS/2 keyboard, connected to a PS/2 click module. It echoes each pressed key to the UART          terminal and stores on a rx buffer. When the ENTER key is pressed, a line feed together with the content of the rx buffer are sent to the UART terminal, as a demonstration purpose.

It doesn´t sends commands to the keyboard; SHIFT, CAPS LOCK and ENTER keys are functional as expected when using a keyboard.

This program is based on the following:
Original title: keyboard_pc_to_rs232.c
Description: Interface between an AT keyboard and a RS232C port.
Date: Abr-2005. Author: XP8100 (xp8100@gmail.com)

Based on the AN AVR313: Interfacing the PC AT Keyboard from ATMEL.
Adapted for a 16F628A by Redraven. Link (in Spanish):
http://picmania.garcia-cuervo.net/proyectos_teclado_ps2.htm

Describes the functioning of the Ps/2 keyboard, codes, commands and connections. Also describes in detail the communication protocol and implements the code for a PIC 16f628.

Adapted for the MikroC compiler and PIC18F45K22 by AlexBG.

The array of n rows by 3 columns for the scan codes, comes from:
http://www.lucadavidian.com/2017/11/15/interfacing-ps2-keyboard-to-a-microcontroller/

The code for using two pointers to the buffer comes from:
https://libstock.mikroe.com/projects/view/641/serial-to-glcd-for-easypic7

Hardware and connections.
You can use the Mikroe PS/2 click (https://www.mikroe.com/ps2-click) or build your own based on the schematic for this module; but for this program, do not connect it into the mikro BUS. Use the connections described below.

PS/2 Module       EasyPIC 7
  CS (CLK)              RB0
RST (DATA)            RB3
     VCC                   +5V
     GND                  GND

The reason for these connections is because the sample code provided for the Mikroe PS/2 click module, does not makes use of the external interrupt INT, located at RB0.

This program does use the external interrupt INT, located at RB0. On each falling edge of the clock signal, an interrupt is generated and at     that moment, the level at RB3 pin is checked, for decoding the corresponding value (8 bits) for the pressed key.

EasyPIC V7 settings:
- Enable the USB UART terminal with J3 and J4.
- Select the ON position for SW1.1 and SW2.1.
- Connect your PS/2 click module to any of the external PORTB connectors.

 

RELATED CODES

Mikromedia 5 for Tiva - RF Communication Example

5

This is demonstration project how Mikromedia 5 for Tiva communicates over RF. Data is send over simple 'led protocol' (1 byte command). Development board for Stellaris with an add-on board nRF Click is used as a receiver device.

[Learn More]

Arduino HANDLING MULTIPLE INTERRUPTIONS FOR FULL DUPLEX COMMUNICATION AND AC load dimmer.

0

show in arduino HANDLING MULTIPLE INTERRUPTIONS FOR FULL DUPLEX COMMUNICATION AND AC load dimmer. SUBSCRIBE TO MY YOUTUBE CHANNEL. https://www.youtube.com/channel/UCAEmDP2EkFOVB6JCKJ9iGGw?view_as=subscribe

[Learn More]

CAN dsPIC33EP

0

The example shows how to use the ECAN module on the dsPIC33EP devices running at 140Mhz(70MIPS) The code transmit messages and Receive messages with interrupt driven events. The LM35 Tempsensor voltage is read and send over CAN . Development Board EasyPIC Fusion 7 with dsPIC33EP512MU810 module Example Code for mikroC compiler

[Learn More]