# Oscillator slows down when my hand hovers over it

I'm teaching myself VHDL using this MAX II CPLD board.

I designed a frequency divider and 4-bit counter in VHDL using the onboard 50MHz oscillator. It seemed to work as the onboard LEDs are flashing in the right way, but I noticed that they flash slower when my hand is near the chip or the onboard crystal oscillator.

The oscillator is in a 4-pin metal package. It has markings 50.000 and e552. It's X1 in the board; pics are in the above link. Not sure if it contains a crystal or uses some other technology.

Some pictures of the board, especially the area between the CPLD and the oscillator. I think the clock goes from X1 through R5, then to the bottom side, then back to the top side, then to pin 62. Pin 62 is the only pin on the right side of the chip that doesn't go to the pin header at the right side of the board, roughly in the middle of the MAX II label.

It might be a problem of floating inputs, but the counter doesn't have any input pins (not even a reset!). I don't need to tie all unused 72 I/O pins to ground, do I? Here is the VHDL:

entity SpdifTest is
port(
CLOCK: in std_logic;
LED: out std_logic_vector(3 downto 0)
);
end SpdifTest;

architecture rtl of SpdifTest is
signal output : std_logic_vector(3 downto 0);
signal count : std_logic_vector ( 23 downto 0 );
begin

process(CLOCK)
begin
if (rising_edge(CLOCK)) then
count <= count+1;
output <= count(23 downto 20);
end if;
LED <= not output;
end process;
end rtl;


Here are the pin assignments in Tcl (pin 62 is the clock):

set_location_assignment PIN_62 -to CLOCK
set_location_assignment PIN_40 -to LED[0]
set_location_assignment PIN_43 -to LED[3]
set_location_assignment PIN_42 -to LED[2]
set_location_assignment PIN_41 -to LED[1]


Is there something else I missed, or maybe the board is faulty? The same thing happens with a similar board (with EPM570 instead of EPM240).

• Don't know what type of oscillator it is, but it could be that you are adding capacitance or something that slows down the oscillator. But it would seem unlikely in the case of a circuit with a crystal. May 10 '20 at 9:41
• Thanks, I added details about the oscillator. May 10 '20 at 9:46
• Odd. Is the oscillator's case grounded? May 10 '20 at 10:01
• @BrianDrummond it is. Did a continuity check. May 10 '20 at 10:15
• Sounds layout related. Please show related parts. May 10 '20 at 14:21