System Overview
STVC070WT-01 is a 7-inch color touch screen produced by Beijing STONE Technology Co., Ltd. The color smart display has a built-in 128M storage space and can communicate with the outside through RS485/RS232. The official also provides a dedicated development tool TOOL to accelerate the development process. In addition, this system uses the Bluetooth module BC1110. and a simple Android phone APP to realize data intercommunication between the phone and the screen.
System Design
STONE STVC070WT-01 is a smart display terminal with a Cortex-M4 processor and 128M storage space. Any visual material and interface switching logic can be written into the display terminal in advance. And it can communicate with the outside through the serial port. Here we write the interface elements and interface switching logic directly into STVC070WT-01, and then reserve a serial port command to communicate with the mobile phone APP through the Bluetooth module.
Process Design
The biggest feature of STVC070WT-01 is that it abstracts GUI development from the entire product development process, thereby isolating the GUI development process, reducing the complexity and coupling of the entire project, accelerating the project development progress, and reducing project uncertainty.
As shown in the figure above, traditional display terminal GUI development will go through a process of GUI element code abstraction. This abstract process requires the use of GUI code libraries such as QT, EmWin, LVGL, etc. This process will couple the GUI module with other code modules. This increases the complexity and uncertainty of the project.
However, the use of smart display terminal development will eliminate the code abstraction process of GUI elements. Developers can directly divide functions and switch logic on the original image according to the art design, and are self-contained, and can be executed and tested independently of other product modules. Reserve the external functional interface (serial communication) to be organically integrated with the entire product. Simplifies the GUI development process, improves the product development speed, and reduces the complexity and uncertainty of the project.
STVC070WT-01 smart display Development
STVC070WT-01 is a civilian-grade smart display terminal of STONE Tech. Just get the product, you can first check the equipment is in good condition (below-left picture), open the plastic film on the screen, you can clearly feel the screen’s penetrating luster.
Use the official distribution power adapter board and adapter cable to connect to smart display STVC070WT-01 to connect to the 12V power supply, then the device will run a factory test program (Test Case). At this time, we might as well click “HW TEST” in the figure below to perform a hardware test.
At this time, we click to enter “Bad Points & grayscale” to perform a dead pixel and grayscale test. At this time, the screen will enter a solid color and grayscale gradient display, click to switch, and exit.
After confirming that there is no problem with the screen, we follow the following address to download the development tool TOOL and its tutorial from the STONE site.
This program uses two variable storage spaces 0x1251 and 0x1253, which are respectively used to store the indicator light display on and off (corresponding data: 1 and 0) and whether the Bluetooth connection mark is displayed (corresponding data: 1 and 0). For the development details of TOOL, please refer to the above document, so I won’t repeat it here.
After using STONE TOOL to complete the GUI interface design and development, we connect the computer to the STVC070WT-01 smart display through a USB cable and connect it. The screen will display the program download prompt message “After download, please plug out USB mini”.
Click the download button in the left picture below to download our program to STVC070WT-01. After the download is successful, the following right picture is displayed.
As shown in the figure below, click the switch button at the bottom right to change the brightness of the small light in the middle.
BC1110 Bluetooth Development
The CC2541 is a power-optimized true system-on-chip (SoC) solution for both Bluetooth low energy and proprietary 2.4-GHz applications. It enables robust network nodes to be built with low total bill-of-material costs. The CC2541 combines the excellent performance of a leading RF transceiver with an industry-standard enhanced 8051 MCU, in-system programmable flash memory, 8-KB RAM, and many other powerful supporting features and peripherals. The CC2541 is highly suited for systems where ultra low power consumption is required. This is specified by various operating modes. Short transition times between operating modes further enable low power consumption. The CC2541 is pin-compatible with the CC2540 in the 6-mm × 6-mm QFN40 package if the USB is not used on the CC2540 and the I2C/extra I/O is not used on the CC2541. Compared to the CC2540, the CC2541 provides lower RF current consumption. The CC2541 does not have the USB interface of the CC2540 and provides lower maximum output power in TX mode. The CC2541 also adds an HW I2C interface.
FEATURES
RF
- 2.4-GHz Bluetooth low energy Compliant and Proprietary RF System-on-Chip
- Supports 250-kbps, 500-kbps, 1-Mbps, 2-Mbps Data Rates
- Excellent Link Budget, Enabling Long-Range Applications Without External Front End
- Programmable Output Power up to 0 dBm
- Excellent Receiver Sensitivity (–94 dBm at 1 Mbps), Selectivity, and Blocking Performance
- Suitable for Systems Targeting Compliance With Worldwide Radio Frequency Regulations: ETSI EN 300 328 and EN 300 440 Class 2 (Europe), FCC CFR47 Part 15 (US), and ARIB STD-T66 (Japan)
Layout
- Few External Components
- Reference Design Provided
- 6-mm × 6-mm QFN-40 Package
- Pin-Compatible With CC2540 (When Not Using USB or I2C)
Low Power
- Active-Mode RX Down to: 17.9 mA
- Active-Mode TX (0 dBm): 18.2 mA
- Power Mode 1 (4-µs Wake-Up): 270 µA
- Power Mode 2 (Sleep Timer On): 1 µA
- Power Mode 3 (External Interrupts): 0.5 µA
- Wide Supply-Voltage Range (2 V–3.6 V)
TPS62730 Compatible Low Power in Active Mode
- RX Down to: 14.7 mA (3-V supply)
- TX (0 dBm): 14.3 mA (3-V supply)
- High-Performance and Low-Power 8051 Microcontroller Core With Code Prefetch
- In-System-Programmable Flash, 128- or 256-KB
- 8-KB RAM With Retention in All Power Modes
- Hardware Debug Support
- Extensive Baseband Automation, Including Auto-Acknowledgment and Address Decoding
- Retention of All Relevant Registers in All Power Modes
Peripherals
- Powerful Five-Channel DMA
- General-Purpose Timers (One 16-Bit, Two 8-Bit)
- IR Generation Circuitry
- 32-kHz Sleep Timer With Capture
- Accurate Digital RSSI Support
- Battery Monitor and Temperature Sensor
- 12-Bit ADC With Eight Channels and Configurable Resolution
- AES Security Coprocessor
- Two Powerful USARTs With Support for Several Serial Protocols
- 23 General-Purpose I/O Pins(21 × 4 mA, 2 × 20 mA)
- I2C interface
- 2 I/O Pins Have LED Driving Capabilities
- Watchdog Timer
- Integrated High-Performance Comparator
Development Tools
- CC2541 Evaluation Module Kit(CC2541EMK)
- CC2541 Mini Development Kit (CC2541DK-MINI)
- SmartRF™ Software
- IAR Embedded Workbench™ Available
SOFTWARE FEATURES
Bluetooth v4.0 Compliant Protocol Stack for Single-Mode BLE Solution
- Complete Power-Optimized Stack Including Controller and Host
- GAP – Central, Peripheral, Observer, or Broadcaster (Including Combination Roles)
- ATT / GATT – Client and Server
- SMP – AES-128 Encryption and Decryption
- L2CAP
- Sample Applications and Profiles
- Generic Applications for GAP Central and Peripheral Roles
- Proximity, Accelerometer, Simple Keys, and Battery GATT Services
- More Applications Supported in BLE Software Stack
- Multiple Configuration Options
- Single-Chip Configuration, Allowing Applications to Run on CC2541
- Network Processor Interface for Applications Running on an External Microcontroller
- BTool – Windows PC Application for Evaluation, Development, and Test
APPLICATIONS
- 2.4-GHz Bluetooth low energy Systems
- Proprietary 2.4-GHz Systems
- Human-Interface Devices (Keyboard, Mouse, Remote Control)
- Sports and Leisure Equipment
- Mobile Phone Accessories
- Consumer Electronics
CC2541 WITH TPS62730
- TPS62730 is a 2-MHz Step-Down Converter With Bypass Mode
- Extends Battery Lifetime by up to 20%
- Reduced Current in All Active Modes
- 30-nA Bypass Mode Current to Support Low Power Modes
- RF Performance Unchanged
- Small Package Allows for Small Solution Size
- CC2541 Controllable
BC1110 is a low-power Bluetooth transparent transmission module (BLE) launched by Fengxin Internet of Things. It uses the CC2541 Bluetooth chip of Texas Instruments (TI), which has the characteristics of low power consumption and strong anti-interference.
It uses library BPS to communicate with STVC070WT-01 and set the BPS_CMD_SET to ‘T’.
#define BPS_NULL 0
#define BPS_INLINE extern inline
/** @Brief: BPS command set */
#define BPS_CMD_SET_B 'B'
#define BPS_CMD_SET_T 'T'
#define BPS_CMD_SET_C 'C'
#ifdef WIN32
#define EXPORT_API __declspec(dllexport)
#else
#define EXPORT_API
#endif
/***************************************************************************************************************
*** #define BPS_CPU64/BPS_CPU32/BPS_CPU16/BPS_CPU8, MUST BE DEFINED BY YOUR OWN
***************************************************************************************************************/
/**
* @Brief: BPS_CPU64/32/16/8 uncomment one of the following line to indicate the CPU type.
*/
// #define BPS_CPU64
// #define BPS_CPU32
// #define BPS_CPU16
#define BPS_CPU8
/**
* @Brief: BPS_MEM_DYN for system that can alloc memory dynamically(malloc/free)
* it will enable to compile functions 'ParseXXXReqDyn/ParseXXXRspDyn',
* which are more efficient for memory usage.
*/
#define BPS_MEM_DYN
/**
* @Brief: BPS_CMD_SET define the command set for BPS_CMD_SET_B/BPS_CMD_SET_T/BPS_CMD_SET_C
*/
#define BPS_CMD_SET BPS_CMD_SET_T
/**
* @Brief: BPS_USE_STD define this macro to use standard c library, otherwise we will use the ones from BPS
*/
#define BPS_USE_STD
/**
* @Brief: BPCPUXX define determine the cpu type
* @Note: Must define one of "BPS_CPU64/BPS_CPU32/BPS_CPU16/BPS_CPU8" to match your cpu, NO DEFAULT VALUE
*/
#ifdef BPS_CPU64
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned int BPS_UINT32;
typedef int BPS_INT32;
typedef unsigned long long BPS_UINT64;
typedef long long BPS_INT64;
typedef float BPS_FLOAT;
typedef BPS_UINT64 BPS_WORD;
#elif defined BPS_CPU32
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned int BPS_UINT32;
typedef int BPS_INT32;
typedef float BPS_FLOAT;
typedef BPS_UINT32 BPS_WORD;
#elif defined BPS_CPU16
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned long BPS_UINT32;
typedef long BPS_INT32;
typedef float BPS_FLOAT;
typedef BPS_UINT16 BPS_WORD;
#elif defined BPS_CPU8
typedef unsigned char BPS_UINT8;
typedef char BPS_INT8;
typedef unsigned short BPS_UINT16;
typedef short BPS_INT16;
typedef unsigned long BPS_UINT32;
typedef long BPS_INT32;
typedef float BPS_FLOAT;
typedef BPS_UINT8 BPS_WORD;
#else
#error Please define your cpu macro first: BPS_CPU64/BPS_CPU32/BPS_CPU16/BPS_CPU8
#endif
#define BPS_BOOL BPS_UINT8
#define BPS_TRUE 1
#define BPS_FALSE 0
We use the Bluetooth transparent transmission module BC1110 of Fengxin Internet of Things, and modify its code to send the connection status data to STVC070WT-01 every 1 second. And lead out the DIN, DOUT, and GND of the adapter cable and connect them to TX, RX, and GND of BC1110.
Note: When STONE smart display STVC070WT-01 leaves the factory, the J17 of the backplane pad is connected to facilitate computer serial communication, but this will cause communication failure with the Bluetooth module, and you need to make sure it is disconnected here.
APP Development
After APP connects to Bluetooth, use STONEn’s official serial communication protocol to read and write data of 0x1251 and smart display STVC070WT-01 to display the light on and off simultaneously. Android’s source is listed as follows:
import static android.bluetooth.BluetoothAdapter.STATE_CONNECTED;
import static android.bluetooth.BluetoothAdapter.STATE_CONNECTING;
import static android.bluetooth.BluetoothAdapter.STATE_DISCONNECTED;
public class MainActivity extends AppCompatActivity {
private BluetoothAdapter mBluetoothAdapter;
private BluetoothLeScanner mBluetoothLeScanner;
private boolean mScanning;
private static final int RQS_ENABLE_BLUETOOTH = 1;
public final static String UUID_BLE_DATA_CHANNEL_WRITE = "0000fff1-0000-1000-8000-00805f9b34fb";
public final static String UUID_BLE_DATA_CHANNEL_NOTIFY = "00002902-0000-1000-8000-00805f9b34fb";
private static final int PERMISSION_REQUEST_COARSE_LOCATION = 2;
private static String LOG_TAG = "Main";
public static final int SCAN_PERIOD = 15000;
private String address = "";
private Handler mHandler;
private ImageView light;
private ProgressBar link;
int mConnectionState = STATE_DISCONNECTED;
private BluetoothGatt mBluetoothGatt;
private boolean isLight = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
light = findViewById(R.id.id_image_light);
link = findViewById(R.id.id_progress_link);
light.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
byte[] data;
if(isLight) {
light.setColorFilter(Color.GRAY);
data = new byte[] {(byte)0xA5, 0x5A, 0x05, (byte)0x82, 0x12, 0x51, 0x00, 0x00};
} else {
light.setColorFilter(Color.YELLOW);
data = new byte[] {(byte)0xA5, 0x5A, 0x05, (byte)0x82, 0x12, 0x51, 0x00, 0x01};
}
isLight = !isLight;
List supportedGattServices = mBluetoothGatt.getServices();
for (BluetoothGattService gattService : supportedGattServices) {
//Service的Characteristics
List gattCharacteristics = gattService.getCharacteristics();
for (BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics) {
int charaProp = gattCharacteristic.getProperties();
if ((charaProp & BluetoothGattCharacteristic.PROPERTY_WRITE) > 0 && gattCharacteristic.getUuid().toString().contains(UUID_BLE_DATA_CHANNEL_WRITE)) {
gattCharacteristic.setValue(data);
mBluetoothGatt.writeCharacteristic(gattCharacteristic);
break;
}
}
}
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// Android M Permission check
if (this.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, PERMISSION_REQUEST_COARSE_LOCATION);
}
}
mHandler = new Handler();
getBluetoothAdapterAndLeScanner();
}
private void getBluetoothAdapterAndLeScanner(){
// Get BluetoothAdapter and BluetoothLeScanner.
final BluetoothManager bluetoothManager =
(BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter();
mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();
mScanning = false;
}
@Override
protected void onResume() {
super.onResume();
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, RQS_ENABLE_BLUETOOTH);
} else {
scanLeDevice(true, 10000);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RQS_ENABLE_BLUETOOTH && resultCode == Activity.RESULT_CANCELED) {
finish();
return;
}
getBluetoothAdapterAndLeScanner();
// Checks if Bluetooth is supported on the device.
if (mBluetoothAdapter == null) {
Toast.makeText(this,
"bluetoothManager.getAdapter()==null",
Toast.LENGTH_SHORT).show();
finish();
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
public void scanLeDevice(final boolean enable, int timeout) {
try {
if (enable) {
// bluetoothDeviceListNew.clear();
if (timeout < 0) {
timeout = SCAN_PERIOD;
}
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (true == mScanning) {
mScanning = false;
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
}
}, timeout);
mScanning = true;
mBluetoothAdapter.startLeScan(mLeScanCallback);
} else {
mScanning = false;
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
} catch(Exception e) {
Log.d(LOG_TAG, e.getMessage());
}
}
private BluetoothAdapter.LeScanCallback mLeScanCallback =
new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
if(null == device || null == device.getName()) return;
Log.d(LOG_TAG, device.getName());
if(device.getName().contains("BC1110")) {
address = device.getAddress();
scanLeDevice(false, 0);
mBluetoothGatt = device.connectGatt(getApplicationContext(), false, mGattCallback);
mConnectionState = STATE_CONNECTING;
}
}
};
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case PERMISSION_REQUEST_COARSE_LOCATION:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// TODO request success
}
break;
}
}
private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status,
int newState) {
String intentAction;
Log.d(LOG_TAG, "CONNECTING: " + status);
if (newState == STATE_CONNECTED) {
mConnectionState = STATE_CONNECTED;
gatt.discoverServices();
}
For complete code and project documentation, please contact us:
https://www.stone-hmi.com//contact
STONE STVC070WT-01+BC1110 Bluetooth transparent transmission mobile phone display synchronously Project Demo
Conclusion
STONE smart display STVC070WT-01 uses powerful local CPU calculation and storage, STONE TOOL development, and uses a serial port to communicate with the outside world, which greatly facilitates its work with external devices and greatly accelerates the development of embedded GUI interfaces.