1267 views|2 replies

1454

Posts

1

Resources
The OP
 

[Xiaohua HC32F448 Review] +W25Q64 reading, writing and application [Copy link]

 

HC32F448 is equipped with 256KB Flash memory, which can support image data storage of TFT screen. However, to realize multiple image storage like digital photo frame, it needs the cooperation of board W25Q64.

The circuit of W25Q64 is shown in Figure 1, which occupies 6 pins in total.

Figure 1 W25Q64 circuit

The connection relationship between the pins of W25Q64 is:

SCK---PB14

NSS---PC7 (pin overlap)

IO0---P B13

IO1---PD9

IO2---PD10

IO3---PD11

In order to use the read and write functions of W25Q64, the configured TFT display screen is shown in Figure 2. It is directly connected using the LCD screen interface on the development board, so it can save the trouble of wiring and effectively improve the reliability of the display.

Figure 2 Display screen connected to development board

The connection relationship of each pin of the TFT screen is:

BLK:PB10

SCK:PA12

DSI:PC4

DC:PE12

RST:PE14

CS: PC7

Through observation, it can be found that there are cases where pins are overlapped, but after actual testing it will not affect normal use.

The main program to realize W25Q64 image storage and image reproduction is:

int32_t main(void)
{
	int32_t i,j,w;
    LL_PERIPH_WE(EXAMPLE_PERIPH_WE);
    Init_TFT();
	tft_Init();
    BACK_COLOR=RED;
    POINT_COLOR=WHITE;
    LCD_Clear(RED);//YELLOW
    LCD_ShowString(80,10,"HC32F448");
	LCD_ShowString(80,40,"2.2' TFT");
	LCD_DrawLine(0,60, 239, 60);
	LCD_DrawLine(0,290, 239, 290);
	LCD_ShowString(80,295,"jinglixixi");
    BSP_CLK_Init();
    BSP_W25QXX_Init();
    LL_PERIPH_WP(EXAMPLE_PERIPH_WP);
    LoadData();
    w=0;
	for(j=0;j<7;j++)
	{
          w=j*4096;
		  (void)BSP_W25QXX_EraseSector(w);
	}
	for(j=0;j<7;j++)
	{
		  w=j*4096;
		  (void)BSP_W25QXX_Write(w+SPI_FLASH_ADDR, gImage_fj+w, SPI_FLASH_DATA_SIZE);
		  (void)BSP_W25QXX_Write(w+SPI_FLASH_ADDR+2048,gImage_fj+2048+w, SPI_FLASH_DATA_SIZE);
   	}
	Address_set(40,150,199,229);
	for(j=0;j<6;j++)
	{
		   w=j*4096;
           (void)BSP_W25QXX_Read(w+SPI_FLASH_ADDR, m_au8ReadData, SPI_FLASH_DATA_SIZE);
		   for(i=0;i<1024;i++)
	       {
			   LCD_WR_DATA8(m_au8ReadData[+i*2]);
               LCD_WR_DATA8(m_au8ReadData[i*2+1]);
	       }
	       (void)BSP_W25QXX_Read(w+SPI_FLASH_ADDR+2048, m_au8ReadData, SPI_FLASH_DATA_SIZE);
		   for(i=0;i<1024;i++)
	       {
			   LCD_WR_DATA8(m_au8ReadData[i*2]);
               LCD_WR_DATA8(m_au8ReadData[i*2+1]);
	       }
	}
	w=6*4096;
    (void)BSP_W25QXX_Read(w+SPI_FLASH_ADDR, m_au8ReadData, SPI_FLASH_DATA_SIZE);
	for(i=0;i<512;i++)
	{
		  LCD_WR_DATA8(m_au8ReadData[+i*2]);
          LCD_WR_DATA8(m_au8ReadData[i*2+1]);
    }
	LCD_ShowString(80,70,"W25Q16");
	while(1);
}

After the program is compiled and downloaded, the display effect is shown in Figure 3, indicating that the functional design is normal and effective.

Similarly, the construction of the photo gallery and the realization of the digital photo frame function can be realized.

Figure 3 Image reproduction

This post is from Domestic Chip Exchange

Latest reply

Thanks for sharing the read and write test of W25Q64   Details Published on 2023-8-30 07:32
 
 

1663

Posts

0

Resources
2
 

Thanks for sharing the read and write test of W25Q64

This post is from Domestic Chip Exchange

Comments

Thanks for your support!!!  Details Published on 2023-8-30 13:01
 
 
 

1454

Posts

1

Resources
3
 
Hot Ximi Show posted on 2023-8-30 07:32 Thank you for sharing the read and write test of W25Q64

Thanks for the support!!!

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