Arduino(1) PWM into Arduino(2) Analog in

Hi all, just a quick one, I have to produce some frequencies on my Uno to help develop another app on a Mega.
I'm looking around for a simple circuit to connect the Arduino to a headphone jack, but for now PWM will be suitable.

My initial problem is I'm sampling a little mic setup ( freetronics module ) but it has incredible noise on the line, so for testing purposes I want a clean signal.

Is it fine to simply connect the grounds together and wire the Uno PWM pin directly into the analog in pin?
Or is a resistor needed to prevent a short circuit?

Also anybody tried and had good results with any headphone jack circuits, everything I have looked at seems to be a variation of some sort of peak detector, whereas I want raw audio biased for Arduino voltages.

Connecting a PWM directly into an Anlaog Pin won't in analog.

You'll get 0 (or close to it) or 1024 (or close to it) depending on when you sample the signal.

Yeah, thats cool, I'm using the max and min values to configure graphs on a tft and play with things like zero crossing calculations.

I plan to use a pot to vary the amplitude if needed, I was just wondering if the connection needs some sort of over current protection.

A small value resistor (100ohm) is usually a good idea. It helps prevent against the situations you forgot about (aka mistakes.)

Cheers, always good to be safe.