Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Keyboard interface

Keyboard interface

2005-02-23 by kc9dag

I would like to interface my Butterfly to a PS/2 keyboard and I have 
a question:
   The Application note on interfacing to a PC keyboard says that one 
of the lines is the +5v line... the Butterfly (mainly it's dataflash 
which I AM using) can't go up to +5v.  Will the keyboard work on +3v, 
or can I power the keyboard from a +5v source and just use a common 
ground between the keyboard and the butterfly (and if I do it that 
way, can the AVR's inputs handle the +5v while it is running at 
+3v)???

Thanks,
Daniel

Re: Keyboard interface

2005-02-23 by brewski922

--- In AVR-Chat@yahoogroups.com, "kc9dag" <dpboyer@d...> wrote:
> 
> I would like to interface my Butterfly to a PS/2 keyboard and I 
have 
> a question:
>    The Application note on interfacing to a PC keyboard says that 
one 
> of the lines is the +5v line... the Butterfly (mainly it's 
dataflash 
> which I AM using) can't go up to +5v.  Will the keyboard work on 
+3v, 
> or can I power the keyboard from a +5v source and just use a common 
> ground between the keyboard and the butterfly (and if I do it that 
> way, can the AVR's inputs handle the +5v while it is running at 
> +3v)???
> 
> Thanks,
> Daniel

"can the AVR's inputs handle the +5v while it is running at +3v"

While I have not tried it to confirm, I say NO.

A 3VDC supply (2 AA batteries) and 5VDC supply (3 AA batteries) with 
the negative tied together should work.

For the DATA leads going back to the Butterfly do this
In Series: KYBD (2000 ohm resistor) BFly (3000 ohm resistor) Common

The signal comes out of the KYBD at 5VDC, 2V is dropped across the 
2000 ohm resistor leaving 3V across the 3000 ohm resistor for the 
BFly. You can probably see the ratio I'm using 
5000 = 2000 + 3000 (1.8K and 2.7K would work just fine). It could 
just as easily be 
10000 = 4000 + 6000. Just make sure that the total resister value is 
going to be high enough that the output of the keybaord is not loaded 
down. Here a higher resistance is better.

Re: [AVR-Chat] Keyboard interface

2005-02-24 by David Kelly

On Feb 23, 2005, at 2:13 PM, kc9dag wrote:

> Will the keyboard work on +3v,

If you are designing a product for mass production then the answer is 
"NO!" But if you are experimenting or playing with a one-off item then, 
"Try it and find out. Some keyboards probably will and some won't."

> or can I power the keyboard from a +5v source and just use a common
> ground between the keyboard and the butterfly (and if I do it that
> way, can the AVR's inputs handle the +5v while it is running at
> +3v)???

There is a pullup diode on the AVR inputs primarily intended for static 
zap protection. One Atmel apnote discusses using a 1M resister between 
an IRQ input pin and the AC power mains for a cheap zero crossing 
detector. Maybe with a series capacitor too. That at 1000 volts peak 
the AVR input pullup diode only has to conduct 1mA. They also go to 
great lengths to point out they have skipped all the safety 
ramifications.

As others have said, use a voltage divider to bring the keyboard 
outputs down to safe range. The AVR at 3 volts shouldn't have any 
problems making valid data levels for 5 volt TTL. 5 volt CMOS could be 
a problem. Would hope the keyboard has HCT logic rather than HC logic.

--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: Keyboard interface

2005-02-24 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "kc9dag" <dpboyer@d...> wrote:
> Will the keyboard work on +3v, > or can I power the keyboard from
> a +5v source and just use a common ground between the keyboard and
> the butterfly (and if I do it that way, can the AVR's inputs handle
> the +5v while it is running at +3v)???

You'll probably find that the keyboard does need +5V to function.  
However, the clock and data lines are "open collector" and need to 
have pullup resistors.  If you connect the pullups to +3V I would 
think that both the keyboard and the AVR would be happy.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.