Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

New!

Thinking MCU? Think TI
Visit the new
TI MCU resource center for the latest videos and documents to help support your design efforts.

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Comp.Arch.Embedded | PS/2 mouse interface with 8052 microcontroller

There are 6 messages in this thread.

You are currently looking at messages 0 to 6.

PS/2 mouse interface with 8052 microcontroller - Ab Sah - 2005-01-15 16:48:00

I am tring to interface  PS/2 mouse (optical) with a 8052 (AT89S52)
microcontroller. From what I get from the internet without adding any
extra hardware I cannot interface the mouse directly with the UART
(serial port) of the microcontroller (mouse has data and clock lines;
uC has RXD, TXD).
1. Are baud rates defined for asynchronous serial communication? What
are the common baud rates used for PS/2 mouse communnication?
2. Would transmitting at any one of these baud rates allow me to
communicate with the mouse or is the baud rate for the mouse fixed for
receiving data?
3. I am not using the inbuilt routines for serial communication, I'll
be using inbuilt timers for transmiting data. What values should I set
for the timers so that I could generate both clock and data on port
0(?) ?

Does the entire idea sound feasible?

Thanks
-Sahai
India



Re: PS/2 mouse interface with 8052 microcontroller - CBarn24050 - 2005-01-15 18:52:00

>Subject: PS/2 mouse interface with 8052 microcontroller

>
>I am tring to interface  PS/2 mouse (optical) with a 8052 (AT89S52)
>microcontroller. From what I get from the internet without adding any
>extra hardware I cannot interface the mouse directly with the UART
>(serial port) of the microcontroller (mouse has data and clock lines;

The mouse generates the clock, the data is latched on one of the edges,I forget
which, when it sends data to the pc and the other edge when the pc sends data
to it, just like a keyboard. You need to connect the clock line to an interrupt
input and the data to a bidirectional port bit. Then you need to write the
software. You could just use an old mouse that sends ascii or buy a ps2-ascii
converter.



Re: PS/2 mouse interface with 8052 microcontroller - 2005-01-15 21:08:00

yes, i figured that much, but when i have to send a reset signal (0xff)
and 0xf4, at what rate should i generate the clock (& data) from the uC
side?
i don't think it'll work without a timed delay because i'm using a
11.0592 mhz crystal and i read somewhere that the mouse works between
10 and 16 khz?

thanks


Re: PS/2 mouse interface with 8052 microcontroller - Antti Keskinen - 2005-01-16 04:05:00

The device (mouse/keyboard) ALWAYS generates the clock. The clock is in 10 -
16.7 kHz range.

The device will start sending data when the line is at idle state (DATA and
CLOCK are held at logic high). To send data to the device, you must signal a
Request-to-send state, which is done by first pulling CLOCK to logic low.
Then pull DATA to logic low, and restore CLOCK to logic high, in this order.

After this, the device will start generating clock signals, and you can
start pushing data out when the interrupts arrive. In host-to-device
communication, data bit changes when the clock is low. When the clock goes
high, device will read the data bit.

For more specific information about the PS/2, read the following web page
through. It explains pretty much everything you need to know.

http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/PS2/ps2.htm

-Antti Keskinen 



Re: PS/2 mouse interface with 8052 microcontroller - 2005-01-16 08:38:00

got it.. thanks :)


Re: PS/2 mouse interface with 8052 microcontroller - Neil Kurzman - 2005-01-18 00:12:00


Ab Sah wrote:

> I am tring to interface  PS/2 mouse (optical) with a 8052 (AT89S52)
> microcontroller. From what I get from the internet without adding any
> extra hardware I cannot interface the mouse directly with the UART
> (serial port) of the microcontroller (mouse has data and clock lines;
> uC has RXD, TXD).
> 1. Are baud rates defined for asynchronous serial communication? What
> are the common baud rates used for PS/2 mouse communnication?
> 2. Would transmitting at any one of these baud rates allow me to
> communicate with the mouse or is the baud rate for the mouse fixed for
> receiving data?
> 3. I am not using the inbuilt routines for serial communication, I'll
> be using inbuilt timers for transmiting data. What values should I set
> for the timers so that I could generate both clock and data on port
> 0(?) ?
>
> Does the entire idea sound feasible?
>
> Thanks
> -Sahai
> India

It is very possible to do the original PS/2 receiver was another 8752 in
the PC.
You may need to bit bang it but it can be done.