Midi controller

Thread Starter


Joined Jul 3, 2009
Hi! I use a PIC18F4525 on my project. I have a LCD display and 14 switches mounted on a metal chassis. Pic PORTB has internal weak pull-ups enabled for input pins 0-3 and pins 4-7 are outputs. My switches are in grid, PORTB 0-3 are row sensors and 4-7 are column drivers. I have set all unused I/O pins to output and connected them to ground thru resistors.

I noticed that the LCD display's metal frame is connected to ground and therefore the metal chassis is also grounded. Is this the way it should be? If I touch the PIC, it starts acting weirdly. Well, normally you don't touch it, but Is there something I should take care of to make this device to be immune to any interference?

I also have a problem with the switches. Pic starts to act crazy when I connect the switches. Sometimes I just need to touch the chassis and the pic goes crazy. I tried to take switch scanning off of my code, but it didn't help. I tried to take switches out of the chassis, that didn't help. Then I took switch wires off and now it works. How should I implement the switches to make it work correctly?
Last edited: