
AT32F403 Application note
2020.8.20 10
1.1.4. How to quickly replace SXX
Step 1: De-solder SXX32F103 and replace it with the corresponding AT32F403 part
according to the peripheral specifications, Flash size, SRAM size, etc.
Step 2:Add at least 2ms of delay after reading RCC->CR.HSERDY, and add at least 200us
of delay after reading RCC->CR.PLLRDY
Step 3: Download SXX32F103 HEX file or BIN file using Artery ICP, ISP or KEIL/ IAR
Step 4: If necessary, download information other than SXX32F103HEX file or BIN file or
perform system calibration
Step 5: Check if the program can run normally
Step 6: For other issues, please refer to Migration guide from SXX32F103 to AT32F403
Step 7: If the program still cannot work normally after following the above steps, please refer
to other chapters in this document, or contact your agent for assistance.
Note: Since AT32F403 applies a flexible memory extension design, the internal Flash
memory has a non-zero wait area, which will cause some SXX32F103 programs to run poorly
on AT32F403.
For how to improve operating efficiency, please refer to AN0004_Performance_Optimization_
Optimization V1.0.x.pdf.
1.2. Enhanced functions of AT32F403
1.2.1 PLL setting when the clock is greater than 72 MHz
AT32F403 embeds a PLL that can output up to 200 MHz clock, the setting is slightly different.
Thus the PLLRANGE register must be configured depending on the output frequency, that is,
PLLRANGE=1 when greater than 72 MHz, and PLLRANGE=0 when less than or equal to 72
MHz.
SXX32F103 PLL setting example: (HSE=8MHz, PLL=72MHz)
RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL9);
AT32F403 PLL setting example: (HSE=8MHz)
#define RCC_CFG_PLLRANGE_LE72MHZ ((uint32_t)0x00000000)
/*!< When PLL frequency is less than or equal to 72MHz */
#define RCC_CFG_PLLRANGE_GT72MHZ ((uint32_t)0x80000000)
/*!< When PLL frequency is greater than 72MHz */
PLL=72MHz:
RCC->CFG|=(uint32_t)(RCC_CFG_PLLRC_HSE| RCC_CFG_PLLMULT9 |
RCC_CFG_PLLRANGE_LE72MHZ);
PLL=200MHz:
RCC->CFG|=(uint32_t)(RCC_CFG_PLLRC_HSE|RCC_CFG_PLLMULT25
|RCC_CFG_PLLRANGE_GT72MHZ);
Rev 1.02
www.arterytek.com