3039 views|7 replies

1452

Posts

1

Resources
The OP
 

【CH579M-R1】+Love for CH579M [Copy link]

 This post was last edited by jinglixixi on 2020-10-19 16:26

Ever since I got my first CH554 development board, I have been looking forward to having a development board that can read USB flash drives. Later, the CH579M EVT development board came out, but unfortunately it did not work as I wished, so I focused my efforts on the CH579M- R1 development board.

Although the peripherals of CH579M-R1 are much different from those of CH579M EVT , it is still possible to use it to read and write data on a USB flash drive.

Since the functions provided by the routine are not very complete, I invested a lot of time and energy in this aspect, but there was not much progress. It was not until recent days that I finally completed the expected goal, combining the color OLED screen with the USB flash drive reading and writing functions to realize a mini version of the digital photo frame.

During this period, the following experiences were experienced:

1. Read the information in the USB flash drive and display its contents on the OLED screen

1 ) First create a new file " CH579HFT.TXT ", and then write the string " CH579M-R1 OK " and other information into it as shown in Figure 1 .

Figure 1 Create a new file

2 ) The read content is displayed through serial communication, as shown in Figure 2. The statement TotalCount = 12; is used to limit the length of the bytes read.

Figure 2 shows the read content

3 ) Add OLED screen display program, through the statement OLED_ShowString(0,0,mCmdParam.ByteRead.mByteBuffer,16);

To display the read content, see Figure 3 .

Figure 3 OLED screen display

2. Read the fonts in the USB flash drive and display Chinese characters on the OLED screen

Based on the previous character reading and writing, we can transform it to read byte data, so as to build a soft character library with a USB flash drive, and realize the display of Chinese characters through the OLED screen and display function.

1 ) Taking the 10 Chinese characters of "海存挚友天涯若比邻" as an example, first use font extraction software to extract its fonts, as shown in Figure 4 .

Figure 4 Extracting fonts

2 ) Arrange the files generated by the font template into the format required by the conversion software, and then convert them to obtain the binary file storing the font template, as shown in Figure 5 .

Figure 5 Data format conversion

3 ) The data was reviewed through the tool software, as shown in Figure 6. After review, the contents of the two were consistent, but the data types were different.

Figure 6 Review BIN file

4 ) The character mold is read in batches through serial communication, 32 bytes each time. The result is shown in Figure 7. It is determined that the reading is correct.

Figure 7 Reading the font

5 ) Configure the corresponding Chinese character display function to realize the reading and writing of the font and the reproduction of Chinese characters, as shown in Figure 8 .

Figure 8 Chinese characters reproduced by soft font library

3. Read the BMP file in the USB flash drive and display the image on the OLED color screen

We can regard each Chinese character as a black and white picture. With the foundation of Chinese character display, we can try to display pictures with a color OLED screen.

  1. The tool software is used to prepare an image file for display on the OLED screen. The length and width of the image are 160*80 pixels, and its content is shown in FIG9 .

Figure 9 Image processing

  1. Modify the image display function and split it up to integrate it into the data reading process. The effect after running is shown in Figure 10 .

Figure 10 Image display

4. Realization of digital photo frame functions

With the image display function, we can use the large capacity of the USB flash drive to manage a large number of files to realize the function of a digital photo frame. The basic implementation is that after displaying each picture, another picture file is opened after a delay to read and display it. The effect is shown in Figures 11 to 13 .

Figure 11 Cartoon picture

Figure 12 Landscape picture

Figure 13 shows the details

The goal of reading USB flash disk on CH579M-R1 development board has been achieved, and it has the function of digital photo frame. CH579M is a very powerful chip. I sincerely hope to get a CH579M EVT development board to further explore the SD card reading and writing functions to unleash its greater potential.

This post is from Domestic Chip Exchange

Latest reply

I wrote my own delay   Details Published on 2024-5-3 10:02
 
 

931

Posts

3

Resources
2
 

Very good, it would be better if the screen is a little bigger.

This post is from Domestic Chip Exchange

Comments

I'll try the 2.2' screen.  Details Published on 2020-10-19 17:15
 
 
 

1w

Posts

25

Resources
3
 

The static effect is good, I don't know how the animation effect is.

This post is from Domestic Chip Exchange

Comments

To add animation, you need to understand the animation driver, which is not yet possible!  Details Published on 2020-10-19 17:18
 
 
 

1452

Posts

1

Resources
4
 
hujj posted on 2020-10-19 16:37 Very good, it would be better if the screen was a little bigger.

I'll try the 2.2' screen.

This post is from Domestic Chip Exchange
 
 
 

1452

Posts

1

Resources
5
 
This post was last edited by jinglixixi on 2020-10-19 17:21
dcexpert published on 2020-10-19 16:46 The static effect is good, I don’t know how the animation effect is.

To add animation, you need to understand the animation driver, which is not yet possible!

If it is a fast switching effect of multiple screens, it is still possible.

This post is from Domestic Chip Exchange

Comments

I wrote my own delay   Details Published on 2024-5-3 10:02
 
 
 

7422

Posts

2

Resources
6
 

After all, it is not mainly used for display, and the dynamic effect is estimated to be barely

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

1942

Posts

2

Resources
7
 

Oops, I didn’t see it. I’m so sorry. I will read this article carefully.

This post is from Domestic Chip Exchange
 
 
 

110

Posts

0

Resources
8
 
jinglixixi posted on 2020-10-19 17:18 To play animation, you need to understand the animation driver, which is not available yet! If it is a fast switching effect of multiple screens, it is still OK. ...

I wrote my own delay

This post is from Domestic Chip Exchange
Personal signature欲穷千里目 更上一层楼
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list