13.07.2015 Views

PC Keyboard Decoder – Serial Out Features - Sunrom Technologies

PC Keyboard Decoder – Serial Out Features - Sunrom Technologies

PC Keyboard Decoder – Serial Out Features - Sunrom Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Email: info@sunrom.comVisit us at http://www.sunrom.comDocument: Datasheet Date: 18-Jul-11 Model #: 1183 Product’s Page: www.sunrom.com/p-1053.html<strong>PC</strong> <strong>Keyboard</strong> <strong>Decoder</strong> – <strong>Serial</strong> <strong>Out</strong>This decoder is able to accept standard <strong>PC</strong>keyboard and decode the data into serial ASCII at9600bps output. Today’s <strong>PC</strong>’s keyboards areeasily available at low cost and can be a cheapalternate to a keyboard on a microcontrollerdevelopment system with lots of available keys.The data output can be used in a embeddedsystem for input and control or you can use it asremote terminal with LCD display.<strong>Features</strong>• Complete keyboard keys decoded• All specials keys like ALT, CTL, SHIFT etcsupported• Simple to Use• Works on 5V supply• Standard 9600 bps ASCII output


Interfacing with RS232If you wish to interface the module with RS232 level like a <strong>PC</strong> serial port or any other RS232 deviceyou need a level convertor such as MAX232 as shown below.U5<strong>PC</strong> <strong>Keyboard</strong> <strong>Decoder</strong> Model#1183+5VTX-OUTGND321VCCRS232 INTERFACINGC1310uF 16VC1410uF 16V++VCC1191210132U6MAX232T1INR2OUTR1OUTT2INC+V+VCCVCC 16GND15T1OUTR2INR1INT2OUTC2+C1-C2-C16100nV-148137456++C1210uF 16VC1510uF 16VP2DB9-CONN-F162738495You can also use ourMax232 Board Model 1104http://www.sunrom.com/p-245.htmlInterfacing to USB Port and Powering from USB PortYou can use any USB to TTL convertor to convert the UART data of sensor through USB interfaceto <strong>PC</strong>.U9<strong>PC</strong> <strong>Keyboard</strong> <strong>Decoder</strong> Model#1183U8USB to <strong>Serial</strong> Board SUNROM#11513211234+5VTX-OUTGNDRX-INTX-OUTGND+5VUSB INTERFACINGIt will appear as virtual serial port on <strong>PC</strong> to which you cancommunicate through any software which can transmitreceive by this serial port like hyperterminal orcustom made software.You can use ourUSB to <strong>Serial</strong> BoardModel 11512To get +5V power for keyboard fromUSB port, solder +5V wire of decoder to+ve pin of this capacitor.http://www.sunrom.com/p-244.html<strong>Sunrom</strong> <strong>Technologies</strong> Your Source for Embedded Systems Visit us at www.sunrom.com


Interfacing with microcontrollerIn below diagram we have used AT89S52’s RXD pin to receive serial data from decoder. You canuse any microcontroller to interface using this interface. We have chosen AT89S52 to show heresince it is more widely used but can be any 8051 MCU or other MCU. The sample code we havegiven can be adapted to any C compiler or any microcontrollers like AVR or PIC since with minorchanges.The interfacing with microcontroller is shown below, The decoder level is 5V data so directlyconnected to Microcontroller RXD pin.// Sample code to receive serial data fromkeyboard decoder model 1182 from sunrom.com// Compiler: Keil#include // standard 8051 defines// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// -=-=-=-=- Hardware Defines -=-=-=-=-=-=-=// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=char ch;//receive serial character from serial portchar mygetchar(void){char c;while(!RI);RI =0;c = SBUF;return SBUF;}// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// -=-=-=-=- Main Program -=-=-=-=-=-=-=// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=void main(){// -=-=- Intialize variables -=-=-=ch = 0;// -=-=- Intialise <strong>Serial</strong> Port -=-=-=//Sets up MCU to use 9600 bps @ 11.059MHz CrystalSCON = 0x52; // 8-bit UART modeTMOD = 0x20; // timer 1 mode 2 autoreloadTH1= 0xfd; // 9600 8-n-1TR1 = 1; // run timer1// -=-=- Program Loop -=-=-=while(1){R110Kch = mygetchar(); //loop till character receivedif(ch==’A’) // if received character is A{//Do Something here}} // end while}// end mainVCCC810uF 16V+393837363534333212345678319U2AT89S52P0.0/AD0P0.1/AD1P0.2/AD2P0.3/AD3P0.4/AD4P0.5/AD5P0.6/AD6P0.7/AD7P1.0/T2P1.1/T2EXP1.2P1.3P1.4/SSP1.5/MOSIP1.6/MISOP1.7/SCKEA/VPPRSTGND20C933pVCCVCC 40XTAL119C1100nP2.0/A8P2.1/A9P2.2/A10P2.3/A11P2.4/A12P2.5/A13P2.6/A14P2.7/A1510P3.0/RXDP3.1/TXD 1112P3.2/INT013P3.3/INT114P3.4/T015P3.5/T116P3.6/WR17P3.7/RDXTAL2182122232425262728PSEN 29ALE/PROG 30Y111.0592TTL UART INTERFACINGC1033pU4<strong>PC</strong> <strong>Keyboard</strong> <strong>Decoder</strong> Model#1183+5VTX-OUTGNDVCC3213<strong>Sunrom</strong> <strong>Technologies</strong> Your Source for Embedded Systems Visit us at www.sunrom.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!