Maker Pro
Maker Pro

So, where am I going wrong?

E

eatmorepies

Jan 1, 1970
0
I want to emulate a left mouse click by plugging in a cable from a mouse and
applying a 5V signal from a D type latch to the wires. This is to switch a
software stop clock on and off.

I looked up the USB connections here

http://pinouts.ru/Slots/USB_pinout.shtml

I opened a working mouse and connected it to a USB port. There was 5V across
the red and black connectors - as expected. What I also expected was that
the voltage at the green or white connection would go high (wrt
black/ground) when I pressed the left hand button - it didn't. The values of
the green and white were steady at about 3.3V.

Why don't the signals at the green and white change when I press the mouse
buttons?

John
 
W

Winston

Jan 1, 1970
0
eatmorepies said:
I want to emulate a left mouse click by plugging in a cable from a mouse and
applying a 5V signal from a D type latch to the wires. This is to switch a
software stop clock on and off.

I looked up the USB connections here

http://pinouts.ru/Slots/USB_pinout.shtml

I opened a working mouse and connected it to a USB port. There was 5V across
the red and black connectors - as expected. What I also expected was that
the voltage at the green or white connection would go high (wrt
black/ground) when I pressed the left hand button - it didn't. The values of
the green and white were steady at about 3.3V.

Why don't the signals at the green and white change when I press the mouse
buttons?

Suggest use a faster scope.

--Winston
 
E

eatmorepies

Jan 1, 1970
0
Winston said:
Suggest use a faster scope.

--Winston

Ah - that's where I'm going wrong. I'm using a DVM - I don't have a scope. I
simply expected the data connections to swap low to high on a button press.
I thought the IC in the mouse to just be doing a bit of de-bouncing.

John
 
R

Rich Webb

Jan 1, 1970
0
I want to emulate a left mouse click by plugging in a cable from a mouse and
applying a 5V signal from a D type latch to the wires. This is to switch a
software stop clock on and off.

I looked up the USB connections here

http://pinouts.ru/Slots/USB_pinout.shtml

I opened a working mouse and connected it to a USB port. There was 5V across
the red and black connectors - as expected. What I also expected was that
the voltage at the green or white connection would go high (wrt
black/ground) when I pressed the left hand button - it didn't. The values of
the green and white were steady at about 3.3V.

Why don't the signals at the green and white change when I press the mouse
buttons?

They did. You just weren't looking fast enough. The mouse sent a short
serial data message (ref: universal *serial* bus) to the host PC. If you
hooked up a logic analyzer or oscilloscope to the Data+ and Data- lines
you could capture the activity. A voltmeter just isn't quick enough.
 
W

Winston

Jan 1, 1970
0
eatmorepies said:
(...)


Ah - that's where I'm going wrong. I'm using a DVM - I don't have a scope. I
simply expected the data connections to swap low to high on a button press.

They do, a lot.
Transitions occur about 12,000,000 times faster than your DVM
can indicate, though.
I thought the IC in the mouse to just be doing a bit of de-bouncing.

It does.

But it does a bunch more than that, too.

Just use your USB protocol analyzer.
(Hall closet on the floor. Left side, behind the carry - on luggage.)

:)

--Winston
 
J

Jasen Betts

Jan 1, 1970
0
I want to emulate a left mouse click by plugging in a cable from a mouse and
applying a 5V signal from a D type latch to the wires. This is to switch a
software stop clock on and off.

I looked up the USB connections here

http://pinouts.ru/Slots/USB_pinout.shtml

I opened a working mouse and connected it to a USB port. There was 5V across
the red and black connectors - as expected. What I also expected was that
the voltage at the green or white connection would go high (wrt
black/ground) when I pressed the left hand button - it didn't. The values of
the green and white were steady at about 3.3V.

Why don't the signals at the green and white change when I press the mouse
buttons?

you need some sort of computer to communicate over USB,
the mouse has one in it, get a cheap USB mouse and examine the wiring.

if you may find that the button switches connect wires from the chip to
the black USB ground wire if that's the case you can substitte some other
input.

Nsb runs at 3.3V so the 5V signal from the latch may need to be
reduced to be compatible with the processor in the mouse

latch --->|--------.-------------- to button terminal
outout red LED |
1K resistor
|
-----------------+-------------- usb black / logic ground

If the buttons are multiplexed ( neither side of the button is
connected to ground or +5) that approach will not work, in that case
a small relay is probably the easiest way to emulate a button-press to
the mouse circuit.
 
T

Tom Biasi

Jan 1, 1970
0
I don't even think that an PS-2 mouse just wires the switches to the
cable -- I'm pretty sure that even back then the button presses &c. were
encoded and sent out on a serial stream.

They did.
 
R

Rich Webb

Jan 1, 1970
0
It is USB. The basic block diagram of a USB ->anything<- is:

.---------. .----------.
| stuff | | little |
| you |--->| micro- |---> USB Cable
| touch | | 'puter |
'---------' '----------'

I don't even think that an PS-2 mouse just wires the switches to the
cable -- I'm pretty sure that even back then the button presses &c. were
encoded and sent out on a serial stream.

A PS/2 mouse? Why laddie back in the day we would have killed for a PS/2
mouse! A real mouse was shaped like a brick and weighed nearly as much
and it use an honest DB-9 serial port, none of this fancy schmancy PS/2
synchronous stuff. Pfaugh!

Embarrassing (but true) story. The very first time I used a computer
mouse, my mental map was "the cord must be the tail, so that's the head"
and I expected that the "tail" (cord) end would be on the back and the
other "head" end would be the pointer. The horror! My Amiga was broken!
No, wait ...
 
W

Winston

Jan 1, 1970
0
Rich Webb wrote:

(...)
Embarrassing (but true) story. The very first time I used a computer
mouse, my mental map was "the cord must be the tail, so that's the head"
and I expected that the "tail" (cord) end would be on the back and the
other "head" end would be the pointer. The horror! My Amiga was broken!
No, wait ...


--Winston
 
M

Michael Black

Jan 1, 1970
0
It is USB. The basic block diagram of a USB ->anything<- is:

.---------. .----------.
| stuff | | little |
| you |--->| micro- |---> USB Cable
| touch | | 'puter |
'---------' '----------'

I don't even think that an PS-2 mouse just wires the switches to the
cable -- I'm pretty sure that even back then the button presses &c. were
encoded and sent out on a serial stream.
Probably not, I can't remember. Early mice did, in the days when you had
to add a mouse controller to your computer, or even the original Macintosh
mouse had the button press and the actual signals out of the photodiodes
going to the Mac.

I'm not sure why the original poster is having problems. If he's actually
taken a mouse and then simply put a switch in parallel with the mouse
button (I think that's what he's doing, but maybe not), then it's a
simple matter of keeping that mouse plugged in and then using the external
switch to see if the computer does what it normally would with that button
pressed. That would be the point of using a mouse, it's an easy way of
obtaining a USB controller, you don't have to fuss with USB, just extend
one of the mouse buttons to whatever you want to control it with.

Michael
 
M

Michael Black

Jan 1, 1970
0
A PS/2 mouse? Why laddie back in the day we would have killed for a PS/2
mouse! A real mouse was shaped like a brick and weighed nearly as much
and it use an honest DB-9 serial port, none of this fancy schmancy PS/2
synchronous stuff. Pfaugh!

Embarrassing (but true) story. The very first time I used a computer
mouse, my mental map was "the cord must be the tail, so that's the head"
and I expected that the "tail" (cord) end would be on the back and the
other "head" end would be the pointer. The horror! My Amiga was broken!
No, wait ...
When I got my first 5.25" drive, in 1984, what wasn't obvious was which
way the floppies went in (and when I got a second drive 2 years later,
that one wasn't obvious either, since it wasn't the same as the first
drive).

But real original mice likely didn't even have serial controllers. As I
said in another post, the original Macintosh mouse just brought the
outputs of the photodiodes and the mouse button to the cable, well through
comparators for buffering. There were various methods back then, often
there was a special card you put in a "PC" to interface the mouse, so the
mouse was likely just as "primitive" as the Mac mouse. And of course,
since mice go back to 1968, likely those were just soldered into the
computer, someone adding some hardware for interface.

Which reminds me, in the old days when RS-232 ports were plentiful, one
could use the control pints for simple I/O, though in this day and age one
doesn't deal with hardware directly, so that (and parallel ports) aren't
so useful for adding simple external switches.

Michael
 
Top