SUNROM ELECTRONICS

PS/2 Keyboard Decoder - Serial Out

Accepts any PS/2 Keyboard and outputs serial data for every key press

Sunrom Part# 1420

Available We dispatch same day if ordered by 4PM (excluding holidays), then courier usually takes 2-5 days.
Quantity Pricing
Quantity :
Price (Discount%)
1-4 :
Rs.180/- (0%)
5-9 :
Rs.175/- (3%)
10-24 :
Rs.167/- (7%)
25-49 :
Rs.162/- (10%)
50-74 :
Rs.158/- (12%)
75-99 :
Rs.153/- (15%)
100-249 :
Rs.148/- (18%)
250-499 :
Rs.144/- (20%)
500-999 :
Rs.140/- (22%)
1000+ :
Rs.135/- (25%)

Downloads

1420 User Manual

This decoder is able to accept standard PC keyboard and decode the data into serial ASCII at 9600bps output. Today’s PC’s keyboards are easily available at low cost and can be a cheap alternate to a keyboard on a microcontroller development system with lots of available keys. The data output can be used in a embedded system for input and control or you can use it as remote terminal with LCD display.

Features

  • Complete keyboard keys decoded
  • All specials keys like ALT, CTL, SHIFT etc supported
  • Simple to Use
  • Works on 5V supply
  • Standard 9600 bps ASCII output

Interfacing with microcontroller 

In below diagram we have used AT89S52’s RXD pin to receive serial data from decoder. You can use any microcontroller to interface using this interface. We have chosen AT89S52 to show here since it is more widely used but can be any 8051 MCU or other MCU. The sample code we have given can be adapted to any C compiler or any microcontrollers like AVR or PIC since with minor changes. The interfacing with microcontroller is shown below, The decoder level is 5V data so directly connected to Microcontroller RXD pin. 

 

// Sample code to receive serial data from keyboard decoder model 1182 from sunrom.com
// Compiler: Keil
#include <REGX51.H> // standard 8051 defines
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Hardware Defines -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
char ch; 

//receive serial character from serial port
char mygetchar(void)
{
	char c;
	while(!RI);
	RI =0;
	c = SBUF;
	return SBUF;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=- Main Program -=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void main()
{
	// -=-=- Intialize variables -=-=-=
	ch = 0;
	// -=-=- Intialise Serial Port -=-=-=
	//Sets up MCU to use 9600 bps @ 11.059 MHz Crystal
	SCON = 0x52; // 8-bit UART mode
	TMOD = 0x20; // timer 1 mode 2 auto reload
	TH1= 0xfd; // 9600 8-n-1
	TR1 = 1; // run timer1
// -=-=- Program Loop -=-=-=
while(1)
{
	ch = mygetchar(); //loop till character received
	if(ch=='a') // if received character is A
	{
		P2=0x00;
	}
	if(ch=='b') // if received character is A
	{
		P2=0xFF;
	}	
	} // end while
}// end main

 

Bestselling Products

Sunrom Electronics & Sunrom Technologies are two companies, that are the foremost online e-commerce stores since 2004, providing innovative embedded systems, components & services. Our aim is to empower you to Make In India. We work closely with electronics manufacturing companies & individuals to understand & solve the challenges faced during production. We do not just sell things, We use them ourselves in our products, and provide you with high quality tested components for trouble free experience.

  • Sunrom Electronics
  • GSTIN: 24AFBPT4632H1ZJ
  • Sunrom Technologies
  • GSTIN: 24AJLPP4029L1ZW
Google Reviews