Building and Programming

Please note that building the source code is only required if you want to change the source code.
It’s not required if you want to build a EVSE and use a pre-programmed Smart EVSE module.

To build the Smart EVSE source code and program it into the PIC18F25K22 controller you require the following components:

The Pickit 2 or 3 programmer is a piece of hardware you require to program the Smart EVSE. We recommend using Pickit 3 which you can buy at various store. Simply search on the internet for Pickit PG164130 and you should find a shop which sells them.

A step by step guide to build and program Smart EVSE:

Step 1: Download the MPLAB X IDE

Smart EVSE can be build using the MPLAB X IDE.

This IDE is available for Windows, Linux and Mac OSX from the Microchip website.

The current version is v3.35 and works with Smart EVSE.

Step 2: Download the C18 compiler
To actually turn the source into binary code which we can program into the PIC controller we require a compiler.

In the case of Smart EVSE we need the C18 compiler which we can download from the Microchip website.

  • Windows: “MPLAB C for PIC18 v3.XX in LITE mode” from the Microchip website.
  • Linux: Download the .run file here.
  • Mac OSX: Download the .dmg file here.

The C18 compiler is a essential part to be able to build Smart EVSE!

Step 3: Import the Smart EVSE project

By now we have the MPLAB X IDE and Microchip C18 compiler installed on our system and we are ready to start the IDE.

Below are a couple of screenshots which show you step by step how to import the Smart EVSE project.

Note: The screenshots were made on a Ubuntu Linux system:

When you open the MPLAB X IDE for the first time you will be greeted with this screen. Click on Import MPLAB Legacy Project.
Import Step 1

Browse the the src directory from the Smart EVSE repository you cloned and select EVSE_MAIN.mcp.
Import Step 2

Keep these settings to the default ones, simply click on Next.
Import Step 3

Select the Pickit 3 programmer and debugger. Assuming you have a Pickit 3. If you have a Pickit 2, select that.
Import Step 4

Now select the C18 compiler. The MPLAB X IDE should detect the C18 compiler automatically.
Import Step 5

You can change the project name if you want to, otherwise hit Next.
Import Step 6

A overview of the project settings. Now hit Finish.
Import Step 7

All done! You should now have the Smart EVSE project imported into your IDE.

Step 4: Build Smart EVSE

To build the Smart EVSE click on the EVSE_MAIN project with the right mouse button and select Clean and Build.

The IDE now start invoking the compiler and the status Output should show:

BUILD SUCCESSFUL (total time: 503ms)

Clean and Build

Step 5: Program hardware

Right click again on the EVSE_MAIN project and select Make and Program Device.

The Pickit programmer should be connected at this point and the programmer will write the code to the device.

This is how you should connect the Pickit programmer:

Pickit3 on Smart EVSE

If all goes well you should now have programmed the software into the Smart EVSE! Congratulations!

Open Source EV charging