ATmega128 (961843), страница 55
Текст из файла (страница 55)
ATmega128 Boundary-scan Order (Continued)272Bit NumberSignal NameModule67PG0.ControlPort G66PG0.Pullup_Enable65PG1.Data64PG1.Control63PG1.Pullup_Enable62PC0.Data61PC0.Control60PC0.Pullup_Enable59PC1.Data58PC1.Control57PC1.Pullup_Enable56PC2.Data55PC2.Control54PC2.Pullup_Enable53PC3.Data52PC3.Control51PC3.Pullup_Enable50PC4.Data49PC4.Control48PC4.Pullup_Enable47PC5.Data46PC5.Control45PC5.Pullup_Enable44PC6.Data43PC6.Control42PC6.Pullup_Enable41PC7.Data40PC7.Control39PC7.Pullup_Enable38PG2.Data37PG2.Control36PG2.Pullup_Enable35PA7.Data34PA7.Control33PA7.Pullup_Enable32PA6.DataPort CPort GPort AATmega1282467M–AVR–11/04ATmega128Table 106.
ATmega128 Boundary-scan Order (Continued)Bit NumberSignal NameModule31PA6.ControlPort A30PA6.Pullup_Enable29PA5.Data28PA5.Control27PA5.Pullup_Enable26PA4.Data25PA4.Control24PA4.Pullup_Enable23PA3.Data22PA3.Control21PA3.Pullup_Enable20PA2.Data19PA2.Control18PA2.Pullup_Enable17PA1.Data16PA1.Control15PA1.Pullup_Enable14PA0.Data13PA0.Control12PA0.Pullup_Enable11PF3.Data10PF3.Control9PF3.Pullup_Enable8PF2.Data7PF2.Control6PF2.Pullup_Enable5PF1.Data4PF1.Control3PF1.Pullup_Enable2PF0.Data1PF0.Control0Notes:Port FPF0.Pullup_Enable1. PRIVATE_SIGNAL1 should always scanned in as zero.2.
PRIVATE_SIGNAL2 should always scanned in as zero.2732467M–AVR–11/04Boundary-scanDescription LanguageFiles274Boundary-scan Description Language (BSDL) files describe Boundary-scan capabledevices in a standard format used by automated test-generation software. The orderand function of bits in the Boundary-scan Data Register are included in this description.ATmega1282467M–AVR–11/04ATmega128Boot Loader Support– Read-While-WriteSelf-ProgrammingThe Boot Loader Support provides a real Read-While-Write Self-Programming mechanism for downloading and uploading program code by the MCU itself. This featureallows flexible application software updates controlled by the MCU using a Flash-resident Boot Loader program.
The Boot Loader program can use any available datainterface and associated protocol to read code and write (program) that code into theFlash memory, or read the code from the program memory. The program code withinthe Boot Loader section has the capability to write into the entire Flash, including theBoot Loader memory. The Boot Loader can thus even modify itself, and it can alsoerase itself from the code if the feature is not needed anymore.
The size of the BootLoader memory is configurable with fuses and the Boot Loader has two separate sets ofBoot Lock bits which can be set independently. This gives the user a unique flexibility toselect different levels of protection.Boot Loader Features•••••••Read-While-Write Self-ProgrammingFlexible Boot Memory SizeHigh Security (Separate Boot Lock Bits for a Flexible Protection)Separate Fuse to Select Reset VectorOptimized Page(1) SizeCode Efficient AlgorithmEfficient Read-Modify-Write SupportNote:1.
A page is a section in the flash consisting of several bytes (see Table 123 on page293) used during programming. The page organization does not affect normaloperation.Application and BootLoader Flash SectionsThe Flash memory is organized in two main sections, the Application section and theBoot Loader section (see Figure 133). The size of the different sections is configured bythe BOOTSZ fuses as shown in Table on page 286 and Figure 133. These two sectionscan have different level of protection since they have different sets of Lock bits.Application SectionThe application section is the section of the Flash that is used for storing the applicationcode.
The protection level for the application section can be selected by the applicationBoot Lock bits (Boot Lock bits 0), see Table on page 277. The application section cannever store any Boot Loader code since the SPM instruction is disabled when executedfrom the application section.Boot Loader Section – BLSWhile the application section is used for storing the application code, the The BootLoader software must be located in the BLS since the SPM instruction can initiate a programming when executing from the BLS only.
The SPM instruction can access theentire Flash, including the BLS itself. The protection level for the Boot Loader sectioncan be selected by the Boot Loader Lock bits (Boot Lock bits 1), see Table 109 on page278.Read-While-Write and No Whether the CPU supports Read-While-Write or if the CPU is halted during a BootLoader software update is dependent on which address that is being programmed. InRead-While-Write Flashaddition to the two sections that are configurable by the BOOTSZ fuses as describedSectionsabove, the Flash is also divided into two fixed sections, the Read-While-Write (RWW)section and the No Read-While-Write (NRWW) section.
The limit between the RWWand NRWW sections is given in Table Note: on page 286 and Figure 133 on page 277.The main difference between the two sections is:•When erasing or writing a page located inside the RWW section, the NRWW sectioncan be read during the operation.•When erasing or writing a page located inside the NRWW section, the CPU is haltedduring the entire operation.2752467M–AVR–11/04Note that the user software can never read any code that is located inside the RWWsection during a Boot Loader software operation. The syntax “Read-While-Write section” refers to which section that is being programmed (erased or written), not whichsection that actually is being read during a Boot Loader software update.Read-While-Write Section –RWWIf a Boot Loader software update is programming a page inside the RWW section, it ispossible to read code from the Flash, but only code that is located in the NRWW section.
During an on-going programming, the software must ensure that the RWW sectionnever is being read. If the user software is trying to read code that is located inside theRWW section (i.e., by a call/jmp/lpm or an interrupt) during programming, the softwaremight end up in an unknown state. To avoid this, the interrupts should either be disabledor moved to the Boot Loader Section. The Boot Loader section is always located in theNRWW section. The RWW Section Busy bit (RWWSB) in the Store Program MemoryControl and Status Register (SPMCSR) will be read as logical one as long as the RWWsection is blocked for reading.
After a programming is completed, the RWWSB must becleared by software before reading code located in the RWW section. See “Store Program Memory Control and Status Register – SPMCSR” on page 279. for details on howto clear RWWSB.No Read-While-Write Section– NRWWThe code located in the NRWW section can be read when the Boot Loader software isupdating a page in the RWW section. When the Boot Loader code updates the NRWWsection, the CPU is halted during the entire page erase or page write operation.Table 107. Read-While-Write FeaturesWhich Section does the Zpointer Address During theProgramming?Which Section can beRead DuringProgramming?Is the CPUHalted?Read-WhileWriteSupported?RWW sectionNRWW sectionNoYesNRWW sectionNoneYesNoFigure 132.
Read-While-Write vs. No Read-While-WriteRead-While-Write(RWW) SectionZ-pointerAddresses RWWSectionZ-pointerAddresses NRWWSectionNo Read-While-Write(NRWW) SectionCPU is HaltedDuring the OperationCode Located inNRWW SectionCan be Read Duringthe Operation276ATmega1282467M–AVR–11/04ATmega128Figure 133. Memory Sections(1)Program MemoryBOOTSZ = '10'Program MemoryBOOTSZ = '11'$0000No Read-While-Write SectionRead-While-Write SectionApplication Flash SectionEnd RWWStart NRWWApplication Flash SectionBoot Loader Flash SectionEnd ApplicationStart Boot LoaderFlashendNo Read-While-Write SectionRead-While-Write Section$0000Program MemoryBOOTSZ = '01'Application Flash SectionEnd RWWStart NRWWApplication Flash SectionEnd ApplicationStart Boot LoaderBoot Loader Flash SectionFlashendProgram MemoryBOOTSZ = '00'No Read-While-Write SectionBoot Loader Lock BitsRead-While-Write SectionApplication Flash SectionEnd RWWStart NRWWApplication Flash SectionEnd ApplicationStart Boot LoaderBoot Loader Flash SectionFlashendNote:$0000No Read-While-Write SectionRead-While-Write Section$0000Application flash SectionEnd RWW, End ApplicationStart NRWW, Start Boot LoaderBoot Loader Flash SectionFlashend1.















