Getting voltage high enough to trip binary counter - CD4040

I'm running a CD4040BE binary counter at 12V, and I'm trying to increment the counter from a 5V square wave generated by an ATMega328P. The attached schematic shows the circuit, which someone gave me. I'm not getting enough voltage swing in the square wave to trigger the counter.

My ATMega square wave is 0-5V and I'm getting a reduce voltage range, but higher peak after the RC network (see 'QuickPrint' from scope). Can anyone help?

Cheers,

But why are you running the CD4040 at 12V then?

I would say, easiest way is to just add a transistor that switches the 12V...

Power it from 5V, remove the capacitor to ground on the clock pulse input, that is wrong.

If you need 12V on the 4040's outputs you'll have to use a level shifter on the clock pulse, such as
a transistor.