In this paper, the design and implementation of a dsPIC microcontroller-based photovoltaic (PV) microinverter has been presented. The flyback PV microinverter is controlled via a low-cost dsPIC microcontroller circuit, with the duty cycle variation of the power switch generated directly from the AC grid voltage, or from a reference sinusoidal waveform at power frequency in the case of standalone applications. No carrier signal generation and no extra phase detection circuitry, such as a phase-locked loop, are required to obtain the sinusoidal pulse width modulation signals of the flyback microinverter. The proposed scheme has the inherent voltage phase detection and control properties via the Direct Digital Synthesis technique adopted. Furthermore, the maximum power point tracking algorithm, and the anti-islanding protection feature required in grid-connected PV systems are easily implemented by the microcontroller, without the use of any extra hardware. The experimental results obtained on a 120 W, 220-V / 50-Hz protoype system verify the validity of the compact and low-cost dsPIC based flyback microinverter control scheme satisfactorily. This scheme is quite suitable for use in a PV AC module application.