1587 views|4 replies

1452

Posts

1

Resources
The OP
 

【AT-START-F425 Review】Reading USB files to achieve image reproduction [Copy link]

 This post was last edited by jinglixixi on 2022-4-21 13:39

Since the core chip used by AT-START-F425 is a USB-oriented microcontroller and provides corresponding USB flash drive reading and writing functions, it can realize two applications, namely, one is to use the file reading function to build a picture library or character library to expand the storage space, and the other is to use the file storage function to act as a data recording device.

Here we will first introduce its reading function to realize image reproduction. Of course, the premise is that the prepared image file has been stored in the U disk, and secondly, there is the support of a color display. The display used here is a 0.96-inch OLED color display.

For testing purposes, a monochrome image file is first stored in the file, and its display effect is shown in Figure 1.

Figure 1 Test effect

The statement to determine whether the specified file is opened is:

if(f_open(&file, "0: zsh.bmp", FA_READ) != FR_OK)

When the specified file is opened successfully, the display program is:

for(i=0;i<N;i++)
{
	res = f_read(&file, read_datp, sizeof(read_datp), &len);
	// 绘制一行彩线
	for(j=0;j<80;j++)
	{
		  LCD_WR_DATA8(gImage_cgq[j*2]);
          LCD_WR_DATA8(gImage_cgq[j*2+1]);
	}
}

From the test results, we can see that there is no problem in opening the *.BMP file, and its data can be read and displayed.

Next, a parameter picture display can be generated, and the effect is shown in Figure 2.

Figure 2 Display image

The program to display this effect is:

if(f_open(&file, "0:YX32.bin", FA_READ) != FR_OK)
{
       USBH_DEBUG("Open AT32.txt failed");
}
else
{
      for(i=0;i<80;i++)
	  {
			res = f_read(&file, read_datp, sizeof(read_datp), &len);
		    for(j=0;j<160;j++)
		    {
		        LCD_WR_DATA8(read_datp[j*2]);
                LCD_WR_DATA8(read_datp[j*2+1]); 
		    }
	  }
      if(res != FR_OK || len == 0)
      {
         USBH_DEBUG("Read AT32.txt failed");
      }
      else
      {
         USBH_DEBUG("Read AT32.txt Success");
      }
      f_close(&file);
    }
    f_mount(NULL, "", 0); 
}

After completing the above basic tests, we can explore the reading of multiple files to realize the function of digital photo frame. The display effect is shown in Figures 3 and 4.

Figure 3 Digital photo frame effect 1

Figure 4 Digital photo frame effect 2

The program to implement this function is:

static usb_sts_type usbh_user_application(void)
{
  usb_sts_type status = USB_OK;
  FRESULT res;
  int i,j,z;
  uint32_t len;
  res = f_mount(&fs, "", 0);
  if(res == FR_OK)
  {
	for(z=0;z<3;z++)
	{
		if(z==0) f_open(&file, "0:YX32.bin", FA_READ);
		if(z==1) f_open(&file, "0:HKTK.bin", FA_READ);
		if(z==2) f_open(&file, "0:HY32.bin", FA_READ);
		for(i=0;i<80;i++)
		{
			    res = f_read(&file, read_datp, sizeof(read_datp), &len);
			    for(j=0;j<160;j++)
			    {
			        LCD_WR_DATA8(read_datp[j*2]);
                    LCD_WR_DATA8(read_datp[j*2+1]);
			    }
		}
        f_close(&file);
        delay_ms(2000);
	}
    f_mount(NULL, "", 0); 
  }
  return status;  
}

From this we can see that the file reading function of the AT-START-F425 development board is still very powerful.

This post is from Domestic Chip Exchange

Latest reply

USB and LCD are connected   Details Published on 2022-4-21 22:33
 
 

6818

Posts

11

Resources
2
 
This is an interesting idea. I feel that this chip is still very powerful. If the price is affordable, it should have great prospects!
This post is from Domestic Chip Exchange

Comments

It is still better to use.  Details Published on 2022-4-21 23:00
 
 
 

7422

Posts

2

Resources
3
 

USB and LCD are connected

This post is from Domestic Chip Exchange

Comments

Haha, give it a try.  Details Published on 2022-4-21 23:00
Personal signature

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

 
 
 

1452

Posts

1

Resources
4
 
lugl4313820 posted on 2022-4-21 14:58 This is an idea. I feel that this chip is still very powerful. If the price is affordable, it should have a bright future!

It is still better to use.

This post is from Domestic Chip Exchange
 
 
 

1452

Posts

1

Resources
5
 
freebsder posted on 2022-4-21 22:33 USB and LCD are connected

Haha, give it a try.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

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