The PHYTEC America team decided to drive head on and test drive working with Zephyr by creating an EV charger GUI demo. This demo mimics the four stages you would expect from a simple EV charging station: unplugged, connected, charging, and paused.
To achieve this, the car-shaped PCB, phyCAR, is equipped with two switches connected to GPIO signals. These switches control which stage the charging station is in, while the I2C LCD displays the corresponding stage.
The I2C LCD, well that of course displays the various stages that the EV charger is in.
To make the demo even more exciting, the team souped it up by adding a photoresistor sensor connected to a single ADC signal. This sensor allows the display to switch between day and night modes based on ambient light. Simply place your hand over the sensor, and the screen automatically transitions to night mode.
Going the extra mile: The team utilized NXP's new and free GUI Guider Tool. This tool enabled them to design the GUI and export it directly into a Zephyr project, streamlining the development process.
Fun Fact: The phyCORE-RT1170 is the smallest SOM PHYTEC has created as of 2024; it's only 30x30mm, smaller than a mini sticky note.
The phyCORE-RT1170 System on Module (SOM) is based on NXP's RT1176 SoC. It modularizes common and difficult-to-route components found in a chip-down design, making it easier and faster to get to production for embedded systems. This dual-core microcontroller is small but powerful, and this demo only showcases a tiny portion of its capabilities.
So, take the SOM for a trial drive and run through the Quickstart guide. This guide will show you how to connect the SOM and power it on safely.
For more information about the SOM, visit the product page or take a "look under the hood" exploring PHYTEC's docs guide pages. These provide instructions on how to interact with various interfaces on the carrier board and other application demo instructions.
Enough about that, let's get rolling with the demo!
Gear Up for Software (Software Setup)Scenic View Point with GUI Guider ToolIf you wanted to adjust the GUI style of this project or create your own here is a fast tutorial of what that would look like.
Note: I worked with this tool on my Windows 10 Host machine
1. Download NXP's GUI Guider Tool
2. Open the desktop app and start creating!
I like to use Canva for icons and easy initial designing. Once you have a design, you can download the icons and upload them to the GUI Guider Tool.
There is a lot to learn with this tool, so I advise watching bits of NXP's webinar on the GUI Guider or embededpro's tutorial videos The version I was working with is an earlier version of the tool and the tool is still under development. So there were a couple dials and graphs that didn't function like I wanted to at that time but could be fixed later on. Also, Zephyr at the time did not support the landscape orientation of the display.
3. Verify your design by running the demo. Click on the Run tab then Build & Run. A screen will pop up on your desktop with your design. (Run > Build & Run)
4. Once happy with design, export the project as a Zephyr code. (Project > Export Code > Zephyr)
Time to get some miles under the belt and install Zephyr on your Linux Host machine.
Host Setup
I followed the steps found in the Zephyr getting started guide, I stopped after walking through "Install the Zephyr SDK". Here's a video if you prefer to learn through that medium.
I found it necessary to install an older driver for my Segger JLink debugger device to properly flash. Do this by simply:
1. Downloaded Driver V7.88 since some newer versions are known to have issues.
2. Installed dependencies.
sudo dpkg -i JLink_Linux_V788_x86_64.deb
sudo apt-get install -f
The phyCORE-RT1170 has not officially been added to Zephyr yet but it can be added to your setup by extracting the phycore_rt1170.tar.gz to the directory zephyr/boards/phytec.
tar -xzf phycore_rt1170.tar.gz
mv /phycore_rt1170 /path to/zephyr/boards/phytec/
Verify Hardware Setup
Before adding the demo changes, verify your hardware setup on the phyBOARD-RT1170 development kit.
1. With power removed from the development kit, connect the 40-pin ribbon cable to the mipi-dsi (X3) connector on the RT1170 development kit. The blue stripe should be facing toward from the carrier board (the pins should be facing you).
2. With the blue stripe facing the front of the display face, connect the flat flex cable to the LCD.
3. Connect the micro-USB to the USB console connector (X15) and to the Host PC, the 5V USB-C power supply to an outlet and then to the development board (X9), and the 9-pin J-link device to the development board (X18) and to the Host PC.
4. Open 2 COM ports and connect them to the USB serial console connection. This will display more information about what has been flashed to the development kit later.
Each COM port should be set to these parameters seen in the image below.
5. Set the boot switch (S5) to QSPI Flash then power on.
6. Now you are ready to run a "hello world" example lvgl demo on the system.
west build -p always -b phycore_rt1170/mimxrt1176/cm7 samples/subsys/display/lvgl/ -DSHIELD=rk055hdmipi4ma0
west flash
Charge Up with the Demo Project1. Rev it up by downloading and extracting the EV charger EV GUI project to your Zephyr environment.
tar -xzf ev-car-v6-zephyr.tar.gz
mv /ev-car-v6-zephyr/* /path to/zephyr/samples/subsys/display/lvgl/
2. Then add support for the ADC photoresistor sensor by downloading applying the ev-car-v6-full-demo.patch.
cd /zephyr/
git apply ev-car-v6-full-demo.patch
3. Verify that the software is setup correctly and flash the board.
west build -p always -b phycore_rt1170/mimxrt1176/cm7 samples/subsys/display/lvgl/ -DSHIELD=rk055hdmipi4ma0
west flash
Buckle Up for Hardware (Hardware Setup)Brighten it up with the LCDDisplay hardware connections were walked thru in "Verify Hardware Setup".
Wire Up the phyCAR ControlsBefore diving in, make sure you're working with at least a 1570.1 carrier boardβearlier versions had a different X8 expansion header pinout, and we want everything to line up correctly!
The phyCAR is a super simple circuit with two switches, two resistors, two diodes, and a 4-pin male header, acting as a basic flip-flop logic analyzer. The switches mimic the behavior of an EV charger cable, so when you flip them, the GUI updates in real time to show the correct status. (Pretty neat, right?) Check out the truth table in the images to see how the logic plays out.
For wiring, I used a 40-pin, 2.00mm male-to-female (M/F) pin header, but if you donβt have one handy, jumper cables work just as well. Just connect everything up, and youβre good to go!
As for the PCB car shape we utilize kicad's "Import Vector Graphics" function. The dxf file is attached to the project. Give this video a view to get a better idea of how to do this:
I actually reused the phyCAR design from an EV Charger demo for this project. Otherwise, I would have recommended including the photoresistor circuit directly in the PCB design. I did this to help reduce e-waste and make use of available resources.
The photoresistor switches the demo between day and night modes, keeping the switch behavior the same while changing the screen style. This sensor uses the ADC signal on the phyCORE-RT1170 carrier board to detect light levels.
There are two ways to connect the sensor (or a simple photoresistor breadboard circuit). The "no rework" method is the easiestβjust connect jumper wires to the X25 expansion header on the carrier board. The "rework" method involves connecting X25 signals to the X8 expansion header pins using a copper wire on the back of the board. This approach creates a cleaner demo setup with a single custom cable harness.
Whichever method you choose, the software works the same since it uses the same signals.
This demo has even been on the road! Here's the demo rocking it at Santa Clara, CA at the 2024 Sensors Converge Tradeshow.
Comments