Reply by Don Pomplun July 14, 20082008-07-14
Hi Dennis,
Thanx for the info. I've concluded that I'm just doing TOO much in the
interrupt handler. If I do nothing except increment a counter, I get the
expected number of interrupts for a keypress. I found a C program to
decode the kbd for a 4MHz ATMEL processor. I'm going to study that to see
where they streamlined it.

Producing the Morse was a challenge. I couldn't just do a simple one=dit,
zero because of the variable lengths of characters (1-6; I wanted
punctuation & numbers, too). What I ended up with is 1=dit 0, with the
relevant bits "right-justified" in a byte. Then the MSB is set to dit or
dah according to what the first part of the morse will be. The remaining
bits are set to the opposite of the MSB.

So an "A" [ .- ] would be coded as 10000010 -- the MSB 1 means the
"A" starts with a dit. You then ignore bits (reading left to right) until
you come to a 1. That and the remaining bits are used to generate the
appropriate length dits & dahs.
Likewise "7" [ --... ] would be coded as 01100111.
And "?" [ ..--.. ] is 10110011.
I was quite pleased how well that worked out.

Don [K2BIO]

At 04:44 AM 7/14/2008, you wrote:
>On Sunday, June 29, 2008 10:40 PM [GMT-3],
>Don Pomplun wrote:
>
> > The project is to make a maritime museum demo of the old "blinker
> > light" morse code system that ships use at sea during "radio silence".
> > The plan is to provide a PS2 keyboard, display the characters typed
> > on a serial 2-line LCD display and operate the shutter of a blinker
> > light. All the "parts" work fine (though not necessarily together)
> > until I got to interfacing the keyboard. If I scan the clock pin in a
> > tight loop, and ignore the start, parity & stop bits, I can get the
> > expected 3 data bytes for the pressed character. However, in order to
> > do more than one thing at a time, I'll need to use an interrupt for
> > the keyboard routine. The clock line is connected to B0 as an
> > interrupt, and the data line to B1. The PIC runs at ~4MHz on its
> > internal clock. I've read a number of web articles on interfacing the
> > PS2 kbd, but wonder if there's some secret I'm missing. This Should
> > be easy - I don't even want to do 2-way kbd comms.
> > Anything obvious, but not published, before I try posting code snippets?
> > TIA
> > Don
> > (CA)
>
>Hi Don,
>I did one of this morse generator for a friend, who installed in the
>"Belgrano" war ship model.
>Since you are going to do a PS2 keyboard to morse encoder, you migth buffer
>the KB input and limited to a certain quantity of characters. You can send a
>buffer full signal to the kb that usually beeps.
>I assume that you use a table to decode ASCII to morse.
>I'm interested in your conversion table. Mine is published in Pic-list at
>MIT.
>
>I'll look for the kb deco in my files, when I get some free time.
>
>Back to work, now.
>BR,
>Dennis
>
>
>to unsubscribe, go to http://www.yahoogroups.com and follow the
>instructionsYahoo! Groups Links
>
Reply by Dennis Crawley July 14, 20082008-07-14
On Sunday, June 29, 2008 10:40 PM [GMT-3],
Don Pomplun wrote:

> The project is to make a maritime museum demo of the old "blinker
> light" morse code system that ships use at sea during "radio silence".
> The plan is to provide a PS2 keyboard, display the characters typed
> on a serial 2-line LCD display and operate the shutter of a blinker
> light. All the "parts" work fine (though not necessarily together)
> until I got to interfacing the keyboard. If I scan the clock pin in a
> tight loop, and ignore the start, parity & stop bits, I can get the
> expected 3 data bytes for the pressed character. However, in order to
> do more than one thing at a time, I'll need to use an interrupt for
> the keyboard routine. The clock line is connected to B0 as an
> interrupt, and the data line to B1. The PIC runs at ~4MHz on its
> internal clock. I've read a number of web articles on interfacing the
> PS2 kbd, but wonder if there's some secret I'm missing. This Should
> be easy - I don't even want to do 2-way kbd comms.
> Anything obvious, but not published, before I try posting code snippets?
> TIA
> Don
> (CA)

Hi Don,
I did one of this morse generator for a friend, who installed in the
"Belgrano" war ship model.
Since you are going to do a PS2 keyboard to morse encoder, you migth buffer
the KB input and limited to a certain quantity of characters. You can send a
buffer full signal to the kb that usually beeps.
I assume that you use a table to decode ASCII to morse.
I'm interested in your conversion table. Mine is published in Pic-list at
MIT.

I'll look for the kb deco in my files, when I get some free time.

Back to work, now.
BR,
Dennis

Reply by Don Pomplun July 1, 20082008-07-01
The project is to make a maritime museum demo of the old "blinker
light" morse code system that ships use at sea during "radio silence".
The plan is to provide a PS2 keyboard, display the characters typed
on a serial 2-line LCD display and operate the shutter of a blinker
light. All the "parts" work fine (though not necessarily together)
until I got to interfacing the keyboard. If I scan the clock pin in a
tight loop, and ignore the start, parity & stop bits, I can get the
expected 3 data bytes for the pressed character. However, in order to
do more than one thing at a time, I'll need to use an interrupt for
the keyboard routine. The clock line is connected to B0 as an
interrupt, and the data line to B1. The PIC runs at ~4MHz on its
internal clock. I've read a number of web articles on interfacing the
PS2 kbd, but wonder if there's some secret I'm missing. This Should
be easy - I don't even want to do 2-way kbd comms.
Anything obvious, but not published, before I try posting code snippets?
TIA
Don
(CA)