How can I get the EV3 to control an ordinary motor with PWM?
The hardware solution is to simulate the motor circuit on pins 5 and 6.



There is a YouTube video by TechnicRobot that shows one way to do this. 



I'm not sure I understand completely the logic behind this wiring. Personally, I would just connect pin 6 to pin 3 directly and connect pin 5 to pin 3 using a 3.3k resistor so that it exactly matches one of the 4 possible states of an EV3 Large motor.

When you do this, the EV3 will detect your motor as an EV3 Large Motor. However, you shouldn't use the Large Motor blocks in the EV3 software. Since this hardware hack won't provide a position feedback signal, those blocks won't work correctly. Instead, use the Unregulated Motor block (one of the blue "advanced" blocks) to control the PWM duty cycle.



To get a PWM signal on pin 2, simply run the motor in reverse. It is not possible to get a PWM signal on both pin 1 and pin 2 at the same time using the official LEGO firmware.



For anyone looking for a software solution rather than a hardware solution, there are some similar questions that should be helpful:


Using the unregulated motor block and conversion cable to light LEDs
How to use Power Functions with Mindstorms EV3?