This project focuses on a protocol for lot control of different LOT devices across the network, using NuvotonHMI N9H30 and lvgl, a small graphical interface was developed that supports sliding windows and multitasking, although it lacks details it is functional
You must click on the following image to see the video of the internet protocol functionalities
In the extra time of the rt-read contest I developed an app that is compatible with the nuvoton protocol described below.
You can find the project of the android code echo in fluter in the following folder
android_protocol_nuvoton
soon I will upload the tutorial so you can understand how to link all these devices
Nuvoton offers HMI platforms which are embedded with Nuvoton N9H MPU. The N9H series with ARM926EJ-S core can operate at up to 300 MHz and can drive up to 1024x768 pixels in parallel port. It integrated TFT LCD controller and 2D graphics accelerator, up to 16 million colors (24-bit) LCD screen output, and provides high resolution and high chroma to deliver gorgeous display effects. It embedded up to 64 MB DDR memory, along with ample hardware storage and computing space for excellent design flexibility.
Features | |
---|---|
Part NO. | N9H30F61IEC(or N9H30F63IEC) (LQFP216 pin MCP package with DDR (64 MB) |
CPU ARCH. | 32-bit ARM926EJ-S |
Operation frequency | 300 MHz |
Embedded SDRAM size | Built-in 64MB |
Crypto engine | AES, DES,HMAC and SHA crypto accelerator |
RMII interface | 10/100 Mbps x2 |
USB 2.0 | High Speed Host/Device x1 |
Audio | Mono microphone / Stereo headphone |
Extern storage | 32MB SPI-NOR Flash |
SD card slot | SD |
Notice: Please remember to select corresponding Part NO in NuWriter.
Interface |
---|
Two RJ45 Ethernet |
An USB 2.0 HS Dual role(Host/Device) port |
A microSD slot |
A 3.5mm Audio connector |
An ICE connector |
Device | Description | Driver supporting status |
---|---|---|
Ethernet PHY | IP101GR | Supported |
Keypad | K[1, 6] | Supported |
LEDs | Supported | |
TFT-LCD panel | 7" inch 24b RGB | Supported |
Touch panel | 7" inch resistive | Supported |
Audio Codec | NAU8822, Supports MIC and earphone | Supported |
USB Device | VCOM + MStorage | Supported |
USB Host | MStorage | Supported |
SPI NOR flash | W25Q256JVEQ (32 MB) | Supported |
Support GCC and MDK IDE/compilers. More information of these compiler version as following:
IDE/Compiler | Tested version |
---|---|
MDK | uVision 5.25.2 |
GCC | 6-2017-q1-update |
Notice: carefully follow the instructions
the only requirement for the system to work is an ethernet connection, the server running, the firmware loaded on the board and the nodes with the corresponding software
IP addresses must be configured manually and specified in the document
use the following link
https://www.rt-thread.io/studio.html
(the compressed file is divided into 3 parts, you need all three parts to uncompress the project)
### In the following location you can find the server configuration
applications>OvniOs1>OvniOs.h
### The TCP client points to the following address and port by default
#define IP_SERVER "192.168.100.16"
#define Port_Server 3001
In this folder you can find the server that manages the connections, in order to run the server require the nodejs tool
Use the link to download the software
https://nodejs.org/es/
navigate with the console to the NuvotonProtocolServer folder and run the following command
npm install && node index.js
This will download the necessary modules and dependencies and run the server.
https://github.com/jeancode/Ovni_NuvotonN9h30/blob/main/esp32_Schematic.pdf
For node control in this project use esp32 but you can use any device that supports tcp and udp protocols
the tcp client of the nodes must point to the following address and port
const char* host = "192.168.100.16";
const int httpPort = 3000;
The specific protocol for tcp has a class that contains an 8-bit buffer processor that decodes and structures the following data
#include "nuvoton.h"
Nuvoton nuvoton;
nuvotonStruct Nstruct;
Nstruct = nuvoton.comnado(Input raw tcp);
Nstruct.id = Nstruct.id; //Contains the id assigned by the server
Nstruct.comandInter = Nstruct.comandInter; ///contains a value from 0 to ff that can mean different internal commands
Nstruct.datos = Nstruct.datos; //this contains an 8-bit buffer with data that can be any value sent from the interface
Structured data can be processed to perform different actions within the microcontroller
It is configured for use with an Esp32 microcontroller with the Arduino IDE.
The file explains how the protocol works and how it can be used to perform different actions.
Notice: Please install Drivers https://github.com/jeancode/Ovni_NuvotonN9h30/tree/main/NuWriter the file name is WinUSB4NuVCOM.exe
This is the correct configuration to upload the program to any memory
When you finish uploading the program, set the switches to the memory where you loaded your program, usually referred to as spi memory.
You can use NuWriter to download rtthread.bin into SDRAM, then run it.
Choose type: DDR/SRAM
<< Press Re-Connect >>
Choose file: Specify your rtthread.bin file.
Execute Address: 0x0
Option: Download and run
<< Press Download >>
Enjoy!!
You can use NuWriter to program rtthread.bin into SPI NOR flash.
Choose type: SPI
<< Press Re-Connect >>
Choose file: Specify your rtthread.bin file.
Image Type: Loader
Execute Address: 0x0
<< Press Program >>
<< Press OK & Wait it down >>
<< Set Power-on setting to SPI NOR booting >>
<< Press Reset button on board >>
Enjoy!!