G4USP

Page last updated: 04/10/2012

Modified Sine Inverter #1 Firmware:

    The firmware for the inverter controller was developed using MPLAB a propriety integrated development environment (IDE), which can be downloaded free of charge from Arizona Microchip. I found MPLAB to be an invaluable tool, intuitive in use, and with its simulator, I believe days were shaved off the development time of the firmware.

    The assembly listing for the inverter  Modified Sine Inverter.asm 

            Software description

    Open Modified Sine Inverter.asm with MPLAB, or any text editing tool i.e. NOTEPAD if MPLAB is not available, however it is worth downloading and installing MPLAB as it formats the file in a way that makes it much easier to read.

    The assembly listing is organised and set out in a logical order, but a little further explanation of some sections / sub routines are in order

include P12F509.inc: when MPLAB compiles and assembles Modified Sine Inverter.asm the contents of P12F509.inc are included.  P12F509.inc simply contains the definitions the ports and commonly used registers associated with the PIC16F84 microcontroller used for the inverter controller, its contents could just as easily have been cut and pasted into Modified Sine Inverter.asm but using the command include and the file name P12F509.inc makes for a less cluttered assembly listing.

initialise: as its name suggests system initialisation takes place here. Interrupts are disabled, timer and prescaler is set up, I/O ports are configured, and all software defined timers are cleared / reset.

main_loop: once initialised the system proceeds to the main loop, from this point onwards everything is accessed from within the main loop. Operating in this manor means should any routine freeze the HEARTBEAT LED will stop flashing.

modified_sine: whilst using the 5mS timing marker generated by soft_timing sub routing modified_sine controls the switching sequence applied to the power MOSFET's.

heartbeat: whilst using the 500mS timing marker generated by soft_timing, as its name suggests this subroutine switches the heartbeat LED on and off.

soft_timing: this routine generates the various timing markers required by the system. The primary timing markers are at 5mS for switch control timing, 500mS for the heartbeat LED.

 

BACK  HOME