check in
Completed

Smart phone based on D133

PROSmart phone based on D133

tag

10
0
0
0
Mode:Full

License

GPL 3.0

Creation time:2025-01-10 03:42:00Update time:2025-01-10 07:39:02

Description

1. Introduction

Some time ago, I came into contact with D133 single-chip microcomputer,Then I bought a development board and learned,In view of the D133 support mipi driver screen,Occasional opportunity to find a mobile phone screen with information (XH8379A) and successfully drive it,Including display and touch,So I hit it off,Decided to frustrate a mobile phone (development board),This is also one of the more complex projects I have designed (involving schematics、PCB design、Shell design、Panel design、Embedded development, etc.)

Video introduction: https://www.bilibili.com/video/BV1njBxYkErg/

2. Hardware design

2.1 Master (V1.0 2024.05.15)

Controller: D133CBS

Frequency: 400MHz

Flash: 16MB nor flash

RAM:1MB SRAM,8MB PSRAM

Package: QFN88-L10*10

Boot mode: SD card, NOR-NAND FLASH, USB-BOOT

The D133 uses a 24M passive crystal oscillator and a 32.768K low-speed crystal oscillator to provide a system clock source and a timer clock source.

The D133 needs to provide two sets of power inputs, 3.3V and 1.1V, and two LDOs of 2.5V and 1.8V with a current of 100mA.

This is followed by a reset circuit and a BOOT0 button.

2.2 Program Memory

The external W25Q128 provides 16M external FLASH for storing programs, using SPI0 (PB0~5), and the hardware requires a pull-up resistor.

2.3 Memory card interface

It is also necessary to provide a pull-up resistor, and the SD card holder supports inserting the detection pin, using SDMC1 (PC0~5), and the detection pin PC6.

2.4 Display touch

Screen interface: MIPI-DSI 2lines (PD18~21), hardware reset: PA5, no impedance, pay attention to the difference of equal length and try to wrap the ground, CTP-LED is the backlight power supply of the virtual button.

If you need to control the backlight of the virtual button, you also need to add a triode or MOS, LCD_ID is used to detect whether the screen is connected, PWM_OUT is a PWM output pin, which can be made to output PWM through the MIPI-DSI command, and then connected to the backlight driver circuit to adjust the backlight brightness, so using this pin can save a PWM pin.

Backlight circuit control pin PE13, PWM2.

Touch interface: IIC2 (PA8~9), reset: PA10, interrupt: PA11, hardware must be pulled up.

2.5 USB interface

D133 USB IO Protection Circuit

2.6 CSI camera

CSI camera, use 8-bit parallel port to collect images (PE0~10), D133 does not support MIPI-CSI, configure interface using IIC0 (PD0~1), reset pin: PA2, power pin: PA3, MCLK pin: PE11

Using V5640 autofocus camera module, STROBE foot is used to control the flash, can also be used as the lighting LED of the mobile phone, you need to use the IIC command control, so in order to reduce the occupation of the IO port, the camera needs to be turned on to control the lighting, which is why the mobile phone lighting APP needs camera permission.

OV5640 and 2640 power supply is slightly different, but the estimate is not a big problem, two 2.8V and one 1.2V are needed, only OV5640 with autofocus function needs an AF power supply, and a separate 2.8V can be given.

2.7 gyroscope

The V1.0 version of the gyroscope uses MPU6050, IIC1 (PD2~3), and the interrupt pin: PD4.

2.8 Ambient light

The V1.0 version uses LTR-553ALS-01 for ambient light, IIC1 (PD2~3) for gyroscope, and PB6 for interrupt pin.

2.9 Audio (digital) amplifier

The audio circuit uses digital audio DSPK1, PE12, uses a single gate to isolate the digital signal, uses the bandpass filter circuit to filter the audio signal of 330~3.3KHz, and uses the AB class power amplifier LM4871 to amplify the analog signal to the speaker.

2.10 Lithium battery charging circuit

Use the 1.25-2PWB interface to connect the 2500mAh polymer lithium battery.

The voltage acquisition circuit uses two x 10K voltage dividers and string 1K resistors to protect the IO port.

Lithium battery charging circuit, using TP4056, supports up to 1200mA, set to 800mA.

There is also a larger Huawei battery, but the size has caught up with the screen, almost can't be plugged, the PCB can only be broken into two and connected with FPC, worried that the strength may not be enough so give up.

2.11 V1 template

The first version of the hardware is probably like this, in strict accordance with the specifications to design the PCB size, in view of the complexity of the use of 4 layers of design, but the size of more than 10CM, so the first version of the use of 2 pieces of PCB to integrate (to ensure that within 10CM can be used coupons), so the power supply and USB and other signals need to be docked with pads.

Roof

Baseboard

 Test the size first, it's good, just hit the board.

The first version of welding, the first step of welding the power system, the board to the welding time and read the manual, 2.5 and 1.8 are the external output of the LDO, so the design of the 4-way dcdc power supply is really redundant, and then the power layer or the middle layer, fortunately did not put the hole on the pad, simply cut off the 2 wires to solve the power supply problem, the test results of the power supply is normal.

Test D133 download runs, works fine but doesn't show up.

In the end, it was found that MIPI's CLK differential docking was wrong, so Bai gave 6 6mil minimum spacing traces to fly 22R resistors, because the LVDS screen used by the official reference circuit, so the CLK differential pair is not the same as MIPI, the V2 version fixes this problem, it is indeed an negligence, thinking that the clock of the differential interface is the same pair.

Eventually, the flying lead modifies the CLK differential pair, lighting up the screen.

When the camera was still being verified, the board was inexplicably smoking, but the screen didn't burn out, but it didn't light up when it was connected to my board, but D133 can still work normally, and the backlight can also light up normally, which is outrageous.

Finally found that the IIC of the camera was not connected to the pull-up resistor,First to the IIC's SDA connected to the pull-up resistor (it's really not good to weld the resistor),But still can't read the ID,It's not a trick and it's not my welding problem.,I just had the mood to try it out and welded the pull-up resistor to the IIC's SCL.,Hey,It's really okay.,Anyway, the screen doesn't show it.,It's basically all verified.,Revision again.,After all, the first version didn't even have a button.

2.12 V2 Hardware Update (2024.06.21)

The V2 adds some features that are more in line with the phone, while also becoming more sophisticated, but it is still not the final version, as the goal is to be both streamlined and versatile, as well as aesthetically pleasing.

1. Redesigned the power supply system

The power topology is complex:

1. USB charges the lithium battery through the charging chip.

2. The battery supplies power to the system, and does not conflict with USB power supply.

3. USB power supply to the system, no conflict with battery power supply.

4. The battery provides 5V output to USB through boost, which does not conflict with the charging function.

5. Wireless charging function.

In order to solve the above needs, diodes can be used to prevent power supply conflicts, but the voltage will be low, and the small package diodes (for the size of the mobile phone motherboard) cannot operate with high current, so it was decided to use PMOS to control the current direction of each power supply separately.

At this time, there are two methods, the first is to use the logic gate to switch the current direction according to the presence or absence of voltage, such as turning on the lithium battery when there is a lithium battery, turning on the USB power supply when there is a USB, turning on the lithium battery power supply when there is a lithium battery and USB, turning off the USB power supply, turning on the USB charging, in order to add the 5V boost output and wireless charging function, and consider different power supply situations separately. Another way is to use an MCU to control the MOS everywhere.

Here I used the second method, using a piece of CH573 for system power flow control, Bluetooth peripherals and other functions, and because the power supply is handed over to CH573 control, the entire system can be completely powered off D133 to better do low power consumption and prolong the battery life of the mobile phone.

2. Redesigned the debugging system

The mobile phone has only one USB port, but D133 has a USB interface for downloading firmware and as a device side, and a serial port for outputting log, CH573 also needs a USB port to update the firmware, and also needs a log serial port, so in order to solve the debugging problem in one bite, a hub is placed on the mobile phone board, under normal circumstances, the mobile phone USB port is used as the HUB input port, and 4 USB ports are connected to D133's USB, USB serial chip, CH571's USB and serial port, In special cases, the USB port can be directly connected to D133 through the USB toggle switch as the OTG function.

 

It should also be noted that the mobile phone as a slave needs to pull down the CC pin to trigger the host power supply, and as a host, it needs to detect the CC pin level, so strictly speaking, it also needs a CC detection and control circuit.

3. Added vibration motor

4. Other

Infrared emission circuitry.

Virtual keys are independently backlit.

5V step-up DCDC.

5. PCB effect

3D preview effect

6. Welding situation (updated on 24.07.05)

Welding diagram

Battery

2.13 V3 Improvements (24.07.13)

Use the 1mm PCB + pot button as the side button (sinking plate welding) to reduce the volume occupation of the side.

By the way, the key model was designed together, and the button board was also made together.

The mobile phone screen has a transparent hole in the front window, so you can add a front camera, so you can add a front camera interface.

//

Two speaker ports are designed to play audio from the headphone jack (with attenuation) or from the normal external speaker.

//

ine-tune the SD card manipulation position so that the SD card protrusion is less noticeable when inserted.

3. Housing design

The shell design uses soildworks2022, 3D printing, and is divided into the following parts.

3.1 The middle frame of the mobile phone

Bottom: USB-TYPE-C PORT

Left: SD card slot

Right: Power and volume buttons

Top: Infrared hole

Top side

 PCB parts fit

Optimized mid-frame version (relieves the pressure on the graphics card and removes most of the resistor-capacitance models)

Verification of the structure of the first version of the frame.

3.2 Mobile phone buttons

Side buttons.

It is fixed to the frame by means of M1.2 screws.

The revised buttons, the first version of the buttons are thicker and occupy too much lateral space, so the new version of the buttons is used, and the pot button is equipped with the button to help reduce the space occupation, and the side button increases the logo embossing.

 

In order to reduce the number of prints and simplify the installation and side thickness occupation, the pot slice button is used, with the 1mm thick PCB, only the width of 1.2mm + 0.2mm of the key stroke is required, and the key is integrated.

 

3.3 Backplane

The shape is cut with an acrylic laser, deducting a relatively high component space, similar to CNC.

4. Installation steps

4.1 Mobile phone screen arrangement

First of all, you need to fix the touch screen cable of the mobile phone with high-temperature tape to facilitate installation on the PCB.

4.2. Button installation (key optimization)

To install the button into the button hole in the middle frame of the mobile phone, due to the overall symmetry of the structure, you need to pay attention to the direction of the button, "+" on the top, "-" on the bottom, and the direction of the power button.

4.3 PCB installation

Put the USB port of the PCB first, align the USB opening in the middle frame of the mobile phone, pay attention to the position of the PFC component in the upper left corner, and install 4 M1.2 screws to fix the PCB.

4.4 Battery, SD card installation

Install the lithium battery in the neutral position of the PCB, connect the plug, and attach the SD card from the left side of the front.

4.5 The back cover of the mobile phone is installed

Install the back panel of the phone, align the rear camera cutout, and install M1.2 screws from the bottom screw hole to fix the back cover.

5. Program development

5.1 DEVELOPMENT ENVIRONMENT (VSCODE)

D133 is compiled based on VSCODE, and AiBurn is used to connect to a computer through a USB interface to download the image (firmware).

5.2. Drive porting

1. Display Drive Porting:

Create an XH8379A driver in the following path: bsp/artinchip/drv/display/panel

According to the initialization sequence and screen parameters provided by the manufacturer, the parameters correspond to the display panel structure.

 

Screen initialization sequence.

2. Touch-driven porting

Create a new ft6306 driver, adapt the read/write interface according to the rtt driver framework, and the IIC address: 0x38, that is, the 0x70 is shifted to the right by 1 bit.

3. Virtual buttons

The virtual button at the bottom of the screen belongs to the touch screen, and when the finger presses and holds the virtual button, it will also trigger an interrupt, and a coordinate will be reported fixedly, which is beyond the height of the screen, so it needs to be specially processed as key information.

It is then passed to the UI by entering the key value of the struct.

5.3 Program Architecture

The program is written using the luban-lite-SDK and the RTT embedded operating system. The interface is written in the cool lvgl language.

Daily APP icons.

1. The system starts the UI

Added transition animations and transparency gradients.

2. Lock screen UI

Enter the password correctly and automatically jump to the desktop, the current password is written dead, the key is not the matrix key control, it can be convenient to change the button style of the map and solve the problem of abnormal display of symbol.

Added a background image displayed from the SD card, scaled the ratio of the digital buttons, and made it look better.

3. System desktop UI (desperately writing ing... 24.09.05 update

Verify the independent matrix layout.

Test multi-language and dynamically switch background images, top menus, battery lighting, etc

Drop-down menu.

4. Apply APP

There are a few official UIs that are still good,You can run it directly,But the resolution adaptation is not suitable for vertical screen,You still need to make adjustments or relayout.

Dashboard, coffee machine, pressure test

Controls, gif presentations, keyboard inputs.

Custom lists, custom tables.

Music player, video player.

Camera (camera), you also need to adjust the resolution, display position and other parameters, the official only OV5640 driver for the time being

5.4 CH571 Bluetooth Development (Environment: MournRiver)

The Bluetooth serial port interaction routine adds the initialization of the relevant pins of the D133 system power control.

TMOS's own task adds power status query and control.

 

Attachment Links:

Horn fittings:https://item.taobao.com/item.htm?_u=k27i5bfnea48&id=679745709745&spm=a1z09.2.0.0.4f242e8dF8FE9v

Screen accessories:https://item.taobao.com/item.htm?ft=t&id=859337794855&spm=a21dvs.23580594.0.0.1d292c1broBQ97&skuId=5842035571418

Vibrating motor:https://item.taobao.com/item.htm?_u=k27i5bfnea45&id=751614737521&spm=a1z09.2.0.0.4f242e8dF8FE9v

Camera:https://item.taobao.com/item.htm?abbucket=6&id=614238777052&ns=1&priceTId=2147805917346644515682943ed7ac&skuId=4748206874624&spm=a21n57.1.item.470.1c00523cw0HiDc&utparam=%7B%22aplus_abtest%22%3A%22f50dfffcc9a7c063a8f16fed2227369b%22%7D&xxc=taobaoSearch

Designed by lovelessing (from OSHWHub)

Link:https://oshwhub.com/lovelessing/d133-mobile-phone-development-bo

Design Drawing

Download File
The preview image was not generated, please save it again in the editor.

Attachments

OrderFile nameDownload times
1
11.25.mp4
205
2
Mechanical structural parts .zip
124
3
CH571_D133CBS.zip
71
4
Test-image.img
22
5
The screen driver .zip
31
6
Desktop UI-LVGL program .zip
41
7
SD card root file .zip
112
Add to Album
0
0
Share
Report

Comment

All Comments(1)
Sort by time|Sort by popularity
Followers0|Likes0
Related projects
Empty

Bottom Navigation