| 数据搜索系统,热门电子元器件搜索 |
|
AN2792 数据表(PDF) 9 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2792 数据表(HTML) 9 Page - STMicroelectronics |
|
9 / 12 page ![]() AN2792 Software and hardware requirements 9/12 5 Software and hardware requirements 5.1 Batch file The STxx boot loader tester tool, used to load files into the application board, manages .s19 files in a standard format. There are 16 bytes for single string and increase addresses options (option -m16 and -s respectively). To produce a .s19 file with both these options, the following check option must be added: Es. "%COS_PATH%\chex" -m16 -s ".\%PRJ_PATH%\%PRJ_NAME%.st7" > ".\PRJ_PATH\%PRJ_NAME%.s19" COS_PATH is the COSMIC compiler path PRJ_NAME is the name of the project 5.2 Application software To program the application board of the STM8A, the device must be in boot mode (see Section 4: Transfering the .s19 file to the STM8A application board on page 8). If the device is not in boot mode, the easy programmer must write two option bytes (487Eh and 487Fh). This is done by the easy programmer sending a pulse on the PH4 pin which is connected to the external interrupt pin of the application board (PORTx/pin). This external interrupt forces the application code to execute the interrupt routine that writes the option bytes and resets the device (the option bytes are updated with the new values only after reset). The interrupt routine code is as follows: @interrupt void EXTI_PORTx_IRQHandler (void) { volatile u8 opt @0x487E; volatile u8 nopt @0x487F; if ( GPIOx.IDR & 0xPin ) { /* Enable write to EEProm Data */ FLASH.DUNPR = 0xAE; FLASH.DUNPR = 0x56; /* Enable write to option byte */ FLASH.CR2 |= 0x80; FLASH.NCR2 &= 0x7F; /* Write option byte */ opt = 0x55; nopt = 0xAA; /* Reset micro with LSWDG */ IWDG.KR = 0xCC; IWDG.KR = 0x55; } return; } ‘PORTx’ and ‘pin’ indicate any pin of PORTx with external interrupts. Pins can be chosen from any available I/0 pin of the application board. |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |