It appears that I did leave a lot out. I apologize for that and the fact it took me so long to get back on here. I'm on waaaay tooo many projects...actually a good thing though with the economy how it is
So details:
1. This is a 5v RS422 keyboard. The keyboard only sees the +5v as DC. There is no AC in this system.
2. I'm using Atmel's 89S52(8052) micro. It's an old dog...but it's only a keyboard so it works for us.
3. I drive the LED's using a PIC12F675 which accepts an input signal and outputs a PWM signal.(the output is a function of the input) This PWM signal drives a P-channel fet. So, the FET is connected to 10-Pin R-packs(1k ohm) which turns the LED's on and off with the PWM signal. Kathode of the LED's are connected to GND. In case you were wondering we use PWM on our LED's because we buy them very cheap and they don't have the same brightness for a given applied voltage from LED To LED.
4. I will try and explain how I have the sounducer connected up..bare with me. So a designate a pin on the micro where when you hit a key(downstroke). This pin toggles from +5 to 0V. This makes the first click. Then once the user release that key(upstroke) you will hear the second click which is that port pin going back up to 5V. The keybaord will do this forever. I use a 74HC04(inverter) in an interesting way which is connected to a 1uF cap and then the cap is connected to the +side of a sounducer. Basically everytime the port pin on the micro changes state current just charges and discharges on the cap making a quick little click. I didn't design this actual circuit but it's kind of cool. I can email it to anyone if you'd like to take a look. Simple...but cool.
I have found a way to correct the problem but don't understand why I need to do such a thing and it's really bothering me. To correct it I lifted the power(+5v) leg of the 74HC04 and connected up a .1uF cap and a 1N5817 diode. The diode allows power to get to the chip but when it's noisy it doesn't allow the energy to leave the cap making the sounducer nice and quite. Why is this happening? Is it due to V=IR and the fact that i'm switching all this current and no matter what the voltage will fluctuate due to this? I"m confused and my boss is too busy to really think about it becaue i'm not sure if her even knows.
Anyway. I feel like I just jabbered aimlessly. It's difficult to have technical discussions via the internet so I apologize. Thanks for the help guys/gals.
-mike