ÔÄ 3175|»Ø 2

447

Ìû×Ó

3

TAµÄ×ÊÔ´

¹ÜÀíÔ±

Â¥Ö÷
 

MPLAB® Harmony ֮ѧϰƪ(Ê® ËÄ )--ÏÔʾ´æ´¢ÔÚÍⲿ FlashÖеÄͼƬºÍ×ÖÌå [¸´ÖÆÁ´½Ó]

±¾ÎÄת×ÔMicrochipÂóÌïÂÛ̳

Ò»¡¢  ¼ò½é£º
Harmony ¿ò¼ÜÏ嵀 MHGC ΪÓû§ÌṩÁ˷dz£·½±ãµÄͼÐοª·¢»·¾³ £¬ ÔÚÇ°ÃæµÄÕ½ÚÀïÃ棬
ÎÒÃǽéÉÜÁËÈçºÎ»ùÓÚ Harmony ƽ̨½¨Á¢Í¼Ðοª·¢µÄÏîÄ¿£¬´Ó¶øÈÃÎÒÃǷdz£ÈÝÒ×½øÈëµ½
¿ª·¢Í¼ÐÎÏîÄ¿µÄ¿ª·¢¡£
ÔÚͼÐÎÏîÄ¿¿ª·¢µÄ¹ý³ÌÖУ¬ÎÒÃǻᷢÏÖ£¬ÓÐʱºòÎÒÃÇÐèÒªÏÔʾµÄͼƬ£¬×ÖÌåµÈÊý¾ÝÍùÍù
³¬¹ýÁË MCU ÄÚ²¿ Flash µÄ´óС£¬Õâ¸öʱºòÎÒÃÇÐèÒª½«ÕâЩÊý¾Ý´æ´¢ÔÚÍⲿ Flash ÖС£±¾
ÎĽéÉÜÈçºÎÔÚ Harmony µÄ¼Ü¹¹Ï£¬ÏÔʾ´æ´¢ÔÚÍⲿ SPI Flash µÄ×ÖÌåºÍͼƬ¡£
¶þ¡¢  Ó²¼þ ¹¤¾ßºÍ Èí¼þ ƽ̨£º
Ó²¼þ £º
1.  PIC32 USB Starter Kit II


2.  LCC Graphic Pictail daughter Board

3. Graphic Display Truly 240X320 Board

Èí¼þ £º
MPLAB X:£ºv3.25 »òÕ߸üÐÂ
XC32£ºv1.40 »òÕ߸üÐÂ
Harmony£ºv1.07 »òÕ߸üÐÂ

Èý¡¢  ²½Öè £º
(Ò») £¬ ½¨Á¢»ùÓÚ Harmony  µÄͼÐÎÏÔʾ¹¤³Ì£¬²Î¿¼¡¶MPLAB® Harmony  Ö®Ñ§Ï°Æª£¨¾Å£©´´
½¨Ò»¸öͼÐοª·¢ÏîÄ¿ ¡·
¼ÇµÃÑ¡ÔñºÏÊʵÄÆÁÄ»·½Ïò¡£

( ¶þ) £¬ÔÚ ÔÚ MHGC  Öй´Ñ¡ÔÊÐíʹÓôÓÍⲿ Flash  ÖÐÏÔʾͼƬºÍ×ÖÌå

( Èý) £¬ Ôö¼Ó SPI Flash  Çý¶¯

( ËÄ) £¬ÔÚ ÔÚ void App_Task(void) µ÷Óà SPI Flash  µÄ³õʼ»¯º¯Êý
void APP_Tasks ( void )
{
/* Check the application's current state. */
switch ( appData.state )
{
/* Application's initial state. */
case APP_STATE_INIT:
{
SST25Init((DRV_SPI_INIT_DATA *)&SPI_Init_Data);
appData.state = APP_STATE_RUN;
break;
}
case APP_STATE_RUN:
{
break;
}
/* TODO: implement your application state machine.*/
/* The default state should never be executed. */
default:
{

/* TODO: Handle error in application's state machine. */
break;
}
}
}
( Îå) £¬  ÔÚApp.c Ìí¼ÓÍⲿFlash ÏÔʾµÄ»Øµ÷º¯ÊýGFX_STATUS GFX_ExternalResourceCallback £¬
²¢Ôڻص÷º¯ÊýÖе÷Óà SPI Flash  µÄ¶ÁÈ¡Çý¶¯¡£
GFX_STATUS GFX_ExternalResourceCallback(
GFX_RESOURCE_HDR *pResource,
uint32_t offset,
uint16_t nCount,
void *pBuffer)
{
uint32_t flashAddress = 0;
uint32_t fontType;
fontType = pResource->type;
if ( fontType == GFX_RESOURCE_JPEG_EXTERNAL_NONE ) {
// Image
flashAddress = pResource->resource.image.location.extAddress;
} else if (fontType == GFX_RESOURCE_FONT_EXTERNAL_NONE) {
// Font
flashAddress = pResource->resource.font.location.extAddress;
} else if (fontType == GFX_RESOURCE_PALETTE_EXTERNAL_NONE) {
// Palette
flashAddress = pResource->resource.palette.location.extAddress;
} else if (fontType == GFX_RESOURCE_BINARY_EXTERNAL_NONE) {
// Binary
flashAddress = pResource->resource.binary.location.extAddress;
} else if (fontType == GFX_RESOURCE_MCHP_MBITMAP_EXTERNAL_NONE) {
// Microchip BMP
flashAddress = pResource->resource.binary.location.extAddress;
}else {
// some error message here ?
// Nop added for debug
Nop();

}
// the request comes with an offset for the resource flash address,
// some resources contain more than one piece of information,
// for example and image 8bpp contains a palette inside
flashAddress += offset;
SST25ReadArray(flashAddress,pBuffer,nCount);
return;
}
( Áù) £¬ÔÚ ÔÚ MHGC  ÖÐÔö¼Ó´æ´¢ÔÚÍⲿ Flash  ÖеÄ×ÖÌå ºÍͼƬ ¡£

( Æß) £¬ ¶¨ÒåÒ»ÖÖ Scheme £¬Ñ¡Óà ÕâÖÖ´æ´¢ÔÚÍⲿ Flash  ÖеÄ×ÖÌ壬ÕâÑùµ±ÄãÑ¡ÔñÕâ¸öÏÔʾ
·ç¸ñµÄʱºò£¬¾Í»á´ÓÍⲿ Flash  ÏÔʾ×ÖÌåÁË ¡£


( °Ë) £¬ Ôö¼ÓÏà¹Ø °´¼ü¿Ø¼þ £¬Ñ¡Ôñ ÏàÓ¦ µÄ·ç¸ñ¡£

( ¾Å) £¬ Ôö¼ÓͼÐοؼþ£¬Ñ¡ÔñÏàÓ¦µÄͼƬ¡£

( Ê®)  £¬²úÉú´æ´¢ÔÚÍⲿ Flash  ÖеÄ×ÊÔ´Îļþ
µ±ÄãÌí¼ÓÐèÒªÏÔʾµÄÄÚÈÝÒÔºó£¬ÔÚ Harmony ÖС°Generate Code¡±£¬ÕâÑù¾Í»á½«´æ´¢
ÔÚÍⲿ Flash ÖеÄ×ÊÔ´Îļþ²úÉúÒ»¸ö gfx_resources_ext.hex¡£Õâ¸öÎļþ²úÉúÔÚ
C:\microchip\harmony\v1_07\apps\mhgc_spiflash\firmware\src\system_config\default¡£
( ʮһ)  £¬½«×ÊÔ´Îļþ gfx_resources_ext.hex  ÏÂÔص½Íⲿ Flash
ÄãÐèÒªÓõ½Á½¸öÎļþ£¬ÒѾ­·ÅÔÚ±¾Îĵĸ½¼þÖС£
1£¬ ÏÂÔØÔËÐÐ: External Memory.hex£¬Õâ¸öÎļþÐèÒªÉÕ¼µ½ MCU ÖÐÔËÐС£
2£¬ ÔÚ PC ÉÏÔËÐÐ USB ÉÕ¼¹¤¾ß: memory_programmer.exe¡£

½« External Memory.hex ÉÕ¼µ½ MCU ÒÔºó £¬ ÐèÒªÓà USB ÏßÁ¬½Ó PC ºÍ PIC32 USB Starter Kit
II µÄ USB ¿Ú£¬ÔËÐÐ memory_programmer.exe ¾Í¿ÉÒÔÏÂÔØ×ÊÔ´ÎļþÁË¡£




( Ê®¶þ)  £¬ÔËÐÐ Harmony  ¹¤³Ì
ÖÁ´Ë£¬ÄãÒѾ­¿ÉÒÔ´ÓÍⲿ Flash ÖÐÏÔʾ×ÖÌåºÍͼÐÎÁË¡£

ËÄ¡¢  ×ܽ᣺
ͨ¹ý±¾ÎÄ£¬Ïò´ó¼Ò½éÉÜÁËÈçºÎÔÚ Harmony ÖÐÏÔʾ´æ´¢ÔÚÍⲿ SPI Flash ÖеÄ×ÖÌå¡£ÆäÖÐ
×îÖ÷ÒªµÄÊÇÌí¼Ó´ÓÍⲿ Flash ÖÐÏÔʾµÄ»Øµ÷º¯Êý£¬ÔÚÕâ¸öº¯ÊýÖпÉÒÔµ÷Óò»Í¬ Flash µÄ
Çý¶¯£¬ÒÔʵÏÖ²»Í¬Íⲿ Flash µÄÏÔʾ¡£

´ËÌû³ö×ÔMicrochip MCUÂÛ̳
¼ÓEEСÖúÊÖºÃÓÑ£¬
Èë¼¼Êõ½»Á÷Ⱥ
EE·þÎñºÅ
¾«²Ê»î¶¯eÊÖÕÆÎÕ
EE¶©ÔĺÅ
ÈÈÃÅ×ÊѶeÍø´ò¾¡
¾Û½¹Æû³µµç×ÓÈíÓ²¼þ¿ª·¢
ÈÏÕæ¹Ø×¢¼¼Êõ±¾Éí

×îлظ´

ʹÓÃMPLAB Harmony´úÂëÏòµ¼£¬Í¨¹ýÓû§¼òµ¥µÄ½øÐÐÉèÖþÍÄܹ»×Ô¶¯ÅäÖò¢Éú³ÉÍⲿFLASH´æ´¢Æ÷µÄÇý¶¯´úÂ룬ͬʱÉú³ÉÍⲿFLASH´æ´¢Æ÷ÖеÄÎÄ×ÖºÍͼƬµÄHEXÎļþ£¬¼òµ¥·½±ã£¬Óû§²»ÓÃΪÍⲿFLASHµÄÇý¶¯ºÍÎļþÒýÓõÄAPI²ÙÐÄ¡£ÕæÕý½â¾öÁËÍⲿFLASHÇý¶¯Ö§³ÖºÍÎļþµ÷Óõıà³ÌÎÊÌâ¡£¼òµ¥ºÃÓᣠ ÏêÇé »Ø¸´ ·¢±íÓÚ 2016-12-8 14:15
µãÔÞ ¹Ø×¢
 

»Ø¸´
¾Ù±¨

142

Ìû×Ó

0

TAµÄ×ÊÔ´

Ò»Á£½ðÉ°£¨Öм¶£©

ɳ·¢
 
MPLAB Harmony¿ò¼ÜϵÄMHGCΪÎÒÃÇÓû§ÌṩÁ˷dz£·½±ãµÄͼÐοª·¢»·¾³¡£ ÓÉÓÚ¿ª·¢Ê±»áÃæÁÙMCUÄÚ²¿FlashµÄ´óСÏÞÖÆ£¬Òò´Ë£¬Harmony µÄ¼Ü¹¹ÏÂÄÜÏÔʾ´æ´¢ÔÚÍⲿ FlashÖеÄͼƬºÍ×ÖÌåÊǷdz£ÓбØÒªµÄ¡£
ÔÚHarmony¿ò¼ÜÏÂÏÔʾ´æ´¢ÔÚÍⲿSPI FlashÖеÄ×ÖÌå¡£ËüÐèÒªPIC32 USB Starter Kit II¡¢LCC Graphic Pictail daughter BoardºÍGraphic Display Truly 240X320 BoardÓ²¼þ¹¤¾ß£¬»¹ÓÐMPLAB X v3.25¡¢XC32 v1.40¼°Harmony v1.07Èí¼þƽ̨¡£È»ºó¾ÍÊǽ¨Á¢»ùÓÚ Harmony  µÄͼÐÎÏÔʾ¹¤³Ì£¬°´ÕÕÏêϸ²½Öè×ö£¬ÔÚ MHGC  ÖÐÑ¡ÔñÔÊÐíʹÓôÓÍⲿFlashÖÐÏÔʾͼƬºÍ×ÖÌ壬Ôö¼ÓSPI FlashÇý¶¯£¬µ÷ÓÃSPI FlashµÄ³õʼ»¯º¯Êý£¬ÆäÖÐ
×îÖ÷ÒªµÄÊÇÌí¼Ó´ÓÍⲿ Flash ÖÐÏÔʾµÄ»Øµ÷º¯Êý£¬ÔÚÕâ¸öº¯ÊýÖпÉÒÔµ÷Óò»Í¬ Flash µÄÇý¶¯£¬ÒÔʵÏÖ²»Í¬Íⲿ Flash µÄÏÔʾ¡£
ÔÚ MHGC  ÖÐÔö¼Ó´æ´¢ÔÚÍⲿ Flash  ÖеÄ×ÖÌåºÍͼƬ£¬¶¨ÒåScheme£¬Ñ¡Óô洢ÔÚÍⲿ FlashÖеÄ×ÖÌå¡£ÏÔʾ¿ÉÒÔÔö¼ÓÏà¹Ø°´¼ü¿Ø¼þºÍͼÐοؼþ¡£
MPLAB Harmony¿ò¼ÜÏÔʾ´æ´¢ÔÚÍⲿ FlashÖеÄͼƬºÍ×ÖÌåÈÃÎÒÃÇÓû§·Ç³£ÈÝÒ×µØ×öͼÐÎÏîÄ¿µÄ¿ª·¢£¬¼Ó¿ìÁËÑз¢ÖÜÆÚ£¬¼òµ¥Ò××ö£¬´ó´óµØÌá¸ßÁË¿ª·¢Ð§ÂÊ¡£


´ËÌû³ö×ÔMicrochip MCUÂÛ̳
 
¸öÈËÇ©Ãû¾²×øµÃÓÄȤ£¬ÇåÓοì´ËÉú¡£
 
 

»Ø¸´

363

Ìû×Ó

3

TAµÄ×ÊÔ´

´¿¾»µÄ¹è£¨³õ¼¶£©

°åµÊ
 
ʹÓÃMPLAB Harmony´úÂëÏòµ¼£¬Í¨¹ýÓû§¼òµ¥µÄ½øÐÐÉèÖþÍÄܹ»×Ô¶¯ÅäÖò¢Éú³ÉÍⲿFLASH´æ´¢Æ÷µÄÇý¶¯´úÂ룬ͬʱÉú³ÉÍⲿFLASH´æ´¢Æ÷ÖеÄÎÄ×ÖºÍͼƬµÄHEXÎļþ£¬¼òµ¥·½±ã£¬Óû§²»ÓÃΪÍⲿFLASHµÄÇý¶¯ºÍÎļþÒýÓõÄAPI²ÙÐÄ¡£ÕæÕý½â¾öÁËÍⲿFLASHÇý¶¯Ö§³ÖºÍÎļþµ÷Óõıà³ÌÎÊÌâ¡£¼òµ¥ºÃÓá£
´ËÌû³ö×ÔMicrochip MCUÂÛ̳
 
 
 

»Ø¸´
ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔ»ØÌû µÇ¼ | ×¢²á

Ëæ±ã¿´¿´
²éÕÒÊý¾ÝÊÖ²á?

EEWorld Datasheet ¼¼ÊõÖ§³Ö

Ïà¹ØÎÄÕ ¸ü¶à>>
¹Ø±Õ
Õ¾³¤ÍƼöÉÏÒ»Ìõ 1/9 ÏÂÒ»Ìõ

 
EEWorld¶©ÔĺÅ

 
EEWorld·þÎñºÅ

 
Æû³µ¿ª·¢È¦

µç×Ó¹¤³ÌÊÀ½ç°æȨËùÓÐ ¾©B2-20211791 ¾©ICP±¸10001474ºÅ-1 µçÐÅÒµÎñÉóÅú[2006]×ÖµÚ258ºÅº¯ ¾©¹«Íø°²±¸ 11010802033920ºÅ Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí