Ps/2 Library - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...

PS/2 Library

mikroC provides a library for communicating with common PS/2 keyboard.The
library does not utilize interrupts for data retrieval, and requires oscillator clock to
be 6MHz and above.
Library Routines
Ps2_Init
Ps2_Config
Ps2_Key_Read
Ps2_Init
Prototype
void Ps2_Init(unsigned short *port);
Description
Initializes
Data line, and port pin 1 is Clock line.
You need to call either
library.
Requires
Both Data and Clock lines need to be in pull-up mode.
Ps2_Config
Prototype
void Ps2_Config(char *port, char clock, char data);
Description
Initializes
data
and
You need to call either
library.
Requires
Both Data and Clock lines need to be in pull-up mode.
Example
Ps2_Config(&PORTB, 2, 3);
MikroElektronika: Development tools - Books - Compilers
for work with PS/2 keyboard, with default pin settings. Port pin 0 is
port
Ps2_Init
for work with PS/2 keyboard, with custom pin settings. Parameters
port
and
specify pins of
clock
need to be in range 0..7 and cannot point to the same pin.
clock
Ps2_Init
mikroC - C Compiler for Microchip PIC microcontrollers
or
before using other routines of PS/2
Ps2_Config
for Data line and Clock line, respectively.
port
or
before using other routines of PS/2
Ps2_Config
Data
page
237

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents