Custom EVSE charger build  

Couple of weeks ago, we were approach by YLE company, inquiring for EVSE <-> EV communication device. After doing some research, following device was created.

Standards and available ICs

For EVSE <-> EV communication the ISO 15118 is available, defining this interface. This standard is based on PLCPower Line Communication and to be precise HPGP – HomePlug Green PHY. More on the topics could be found here.

Unfortunately, no IC in normal distribution is available, only ready made modules with different flavours – some having stack embedded in attached MCU with UART control, some with SPI control, some with CAN control. Only one was sticking out – QCA700x.

Why selecting QCA700x (0 or 5)? Linux kernel support!  There ready made driver, which initialize the WCA as eth peripheral, allowing a user to directly use this IC. 

One of the modules based with QCA700x is Red BEET 1.1 (now 2.0 available)<– available, some documentation, compatible parts (tranformer) available at codico 

Motivation for this HAT is simply lack of similar devices, the only ones – expensive eval boards or AliExpress modules with no documentation. 

Finally the Red BEET 1.1 PLC module was used for creation of Raspberry PI HAT, with following assumptions:

  • Stackable HATs even with transformer, at least up to 4
  • Selection of SPI0 or 1
  • Selection of CS pin – 4 different
  • Selection of INT pin – 4 different 
  • ZC (zero crossing) connection
  • 5V supply
  • QCA700x reset button
Why 5V supply? 
The Raspberry PI 3.3V supply is generated (at least on 4B) with synchronous BUCK converter, supplying e.g. the RPi IO pins. That means, current capability of this rail is limited to the built-in RPI hardware.
However, 5V supply is provided by external power supply, which potentially current capability is greater and positively adjustable (by changing the power supply).

The most similar HAT – LINK

Assembly process 

Following issues were discovered along the way: 

  • RED Beet module is available in non-wettable flank type package 
  • Hand soldering nearly impossible to be successfully done with PLC modules, which are having higher heat capacity than normal IC. 
  • 2 out of 2 first modules were not working, due to poor soldering.  
  • In order to verify the initial connection and recognition by Raspberry and Raspbian over SPI, following “wire wrap” build was made. 
  • After confirmation that the PCB and SCH design is correct, the soldering process was concluded as the potential issue while commissioning first batch of parts.  Finally reflow soldering with solder paste and stencil was used to solder correctly working samples.

PLC tools and commissioning  

In order to confirm that Linux has access to the QCA700x IC and on the other end that the devices are connecting with each other, following tools can be used:

https://github.com/qca/open-plc-utils  

As the installation instruction is pretty much straight forward, the usage is trickier for someone without PLC background (as I am). Using docbook folder in the above-mentioned repo and the index.html file could bring some help in commissioning the devices. 

dmesg | grep qca 

sudo ./plctool -r -i eth1 

Later on the modules could be connected together, configured into single network and pinged for list of other devices in the network.

DT Overalay modification 

In order to use multiple QCA700x on the same SPI0, as the ETHx adapters, original DT Overlay file for Raspbian has to be modified.  

Original file can be found here:

https://github.com/raspberrypi/linux/blob/rpi-5.15.y/arch/arm/boot/dts/overlays/qca7000-overlay.dts  

The modified file, currently using fixed pins assignment can be found below: 

// Overlay for the Qualcomm Atheros QCA7000

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835";

	fragment@0 {
		target = <&spidev0>;
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@1 {
		target = <&gpio>;
		__overlay__ {
            eth1_pins: eth1_pins {
				brcm,pins = <25>;
				brcm,function = <0>; /* in */
				brcm,pull = <0>; /* none */
			};
            eth2_pins: eth2_pins {
				brcm,pins = <24>;
				brcm,function = <0>; /* in */
				brcm,pull = <0>; /* none */
			};
            eth3_pins: eth3_pins {
				brcm,pins = <22>;
				brcm,function = <0>; /* in */
				brcm,pull = <0>; /* none */
			};
            eth4_pins: eth4_pins {
				brcm,pins = <27>;
				brcm,function = <0>; /* in */
				brcm,pull = <0>; /* none */
			};
		};
	};

	fragment@2 {
		target = <&spi0_cs_pins>;
		__overlay__ {
			spi0_cs_pins: spi0_cs_pins {
				brcm,pins = <8 7 18 17>;
			};
        };
    };

	fragment@3 {
		target = <&spi0>;
		__overlay__ {
			/* needed to avoid dtc warning */
			#address-cells = <1>;
			#size-cells = <0>;
			cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 18 1>, <&gpio 17 1>;
			status = "okay";

			eth1: qca7000@0 {
				compatible = "qca,qca7000";
				pinctrl-names = "default";
				pinctrl-0 = <&eth1_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <25 0x1>; /* rising edge */
				reg = <0>;
				spi-max-frequency = <12000000>;
				status = "okay";
			};


			eth2: qca7000@1 {
				compatible = "qca,qca7000";
				pinctrl-names = "default";
				pinctrl-0 = <&eth2_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <24 0x1>; /* rising edge */
				reg = <1>;
				spi-max-frequency = <12000000>;
				status = "okay";
			};


			eth3: qca7000@2 {
				compatible = "qca,qca7000";
				pinctrl-names = "default";
				pinctrl-0 = <&eth3_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <22 0x1>; /* rising edge */
				reg = <2>;
				spi-max-frequency = <12000000>;
				status = "okay";
			};

			eth4: qca7000@3 {
				compatible = "qca,qca7000";
				pinctrl-names = "default";
				pinctrl-0 = <&eth4_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <27 0x1>; /* rising edge */
				reg = <3>;
				spi-max-frequency = <12000000>;
				status = "okay";
			};
		};
	};


};

Modify and compile the .dts files into /boot/overlays directory.

sudo dtc -@ -I dts -O dtb -o qca7000.dtbo qca7000-overlay.dts

Add following to line to /boot/config.txt: 

dtoverlay=qca7000 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top