Freescale HCS12 微控制器 MC9S12DP256

Slides:



Advertisements
Similar presentations
1 I/O 设备访问方式和类型. 2 Overview n The two main jobs of a computer: l I/O (Input/Output) l processing n The control of devices connneted to the computer is.
Advertisements

嵌入式系统与单片机 北京科技大学电子信息系.
CHAPTER 9 虛擬記憶體管理 9.2 分頁需求 9.3 寫入時複製 9.4 分頁替換 9.5 欄的配置法則 9.6 輾轉現象
Foundations of Computer Science
TMS320F2812串行外设接口 Serial Peripheral Interface (SPI)
微識科技股份有限公司 林育慶 / Andy RFID 介紹及應用 微識科技股份有限公司 林育慶 / Andy
操作系统结构.
CHAP 2 Computer-System Structures 计算机系统结构
Chapter 2: Computer-System Structures计算机系统结构
最新計算機概論 第3章 計算機組織.
一年16班 黃佳弘 硬 碟 機 Hard Disk Driver.
Android RISC Team Wendy Wang July,2017
加速度計 指導老師 : 洪正瑞 製作人 : 蔡昌佑.
TM Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective.
單晶片原理與應用 魏兆煌 整理 南台科技大學 電機系 Sep
Hardware Chen Ching-Jung
CH.2 Introduction to Microprocessor-Based Control
Chapter 5 電腦元件 目標---- 研讀完本章後,你應該可以: 閱讀有關電腦的廣告以及了解它的專業用語(行話)。
臺北市立大學 資訊科學系(含碩士班) 賴阿福 CS TEAM
项目成果展示 ——深圳凯吉尔科技—— 凯吉尔全线代理无锡研奥产品 说明:
17bit Smart Absolute Encoder
触发器和时序电路分析 刘鹏 浙江大学信息与电子工程学院 March 30, 2017 ZDMC.
PIC16F1827介紹 以微控器為基礎之電路設計實務-微處理器實驗室.
第4章 处理器(CPU) 4.1 引言 4.2 逻辑设计的一般方法 4.3 建立数据通路 4.4 一个简单的实现机制 4.5 多周期实现机制.
沈阳辽通自动控制装备厂 电牵引采煤机变频器培训课程.
Timer & KEYPAD 11/24.
Chapter 5 Verilog硬體描述語言
不断变迁的闪存行业形势 Memory has changed, especially serial - from a low cost, low pin count, slow memory to an advanced, high performance memory solution to save.
指令集架構 計算機也跟人類一樣,需要提供一套完整的語言讓人們跟它充分溝通,以完成正確的計算工作。
C H A P T E R 10 存储器层次.
1-1 微電腦系統單元 1-2 微電腦系統架構 1-3 微控制器(單晶片微電腦) 1-4 類比與數位訊號介面
1-1 微電腦系統單元 1-2 微電腦系統架構 1-3 微控制器(單晶片微電腦) 1-4 類比與數位訊號介面
memory array (2n words by m bits)
5 Computer Organization (計算機組織).
C H A P T E R 8 体系结构对系统开发的支持.
Block diagram BB —逻辑 —音频 —电源管理 HW interface. Block diagram BB —逻辑 —音频 —电源管理 HW interface.
HOLTEK 产品 在小家电的应用.
memory array (2n words by m bits)
微程序控制器 刘鹏 Dept. ISEE Zhejiang University
第5章 智能汽车设计基础—微控制器.
Module 8:IC卡安全 8-1.
微处理器设计2 刘鹏 College of ISEE Zhejiang University
Freescale HCS12 微控制器.
组合逻辑3 Combinational Logic
第15章 串行通信及接口电路.
第14章 其它DSP设计库 14.1 总线控制库 14.2 复数信号库 14.3 Gates库 14.4 状态机函数库
JTAG INTERFACE SRAM TESTER WITH C-LCM
陳慶瀚 機器智慧與自動化技術(MIAT)實驗室 國立中央大學資工系 2013年5月28日
Ch9 Communicating with Hardware
Freescale HCS12 微控制器.
第3章 認識處理元.
資料庫 靜宜大學資管系 楊子青.
成品检查报告 Inspection Report
(第2版).
通訊實驗 實驗三 遙控車程式流程圖 姓名:顏得洋 學號:B
The Processor: Datapath and Control (Multi-cycle implementation)
中国科学技术大学计算机系 陈香兰 2013Fall 第七讲 存储器管理 中国科学技术大学计算机系 陈香兰 2013Fall.
虚 拟 仪 器 virtual instrument
计算机系统结构(2012年春) ----存储层次: Cache基本概念
通訊實驗 實驗三 遙控車程式流程圖 姓名:顏得洋 學號:B
Lightweight Data-flow Analysis for Execution-driven Constraint Solving
第10章 存储器接口 罗文坚 中国科大 计算机学院
第六章 記憶體.
BiCuts: A fast packet classification algorithm using bit-level cutting
第四章 MSP430數位I/O原理與實驗.
FPPA 程式設計 這一章開始正式進入FPPA程式設計的世界,我會從一個簡單的程式開始解說,一邊介紹專案開發時最常應用的技巧還有程式控制的手段,一邊把系統規畫的概念導入給大家,讓大家對專案的規畫能有一個初步的概念。
通訊實驗 實驗三 遙控車程式流程圖 姓名:顏得洋 學號:B
Gaussian Process Ruohua Shi Meeting
第十一章 Flash存储器的在线编程 主要内容 Flash存储器概述与编程模式 MC68HC908GP32单片机Flash存储器编程方法
Chapter 8 – Memory Basics
Presentation transcript:

Freescale HCS12 微控制器 MC9S12DP256 2005年8月

Freescale Corporate Template User Guide 使用 HCS12的第一步 March 2005 1) HCS12 技术概述 2) Operating Modes工作模式 3) Resource Mapping资源映射 4) External Bus Interface外部总线接口 5) Port Integration Module端口集成模块 6) Background Debug Mode背景调试模块 © Freescale Semiconductor, Inc. 2005

工作模式 HCS12 Mode Pins are sampled and latched on rising edge of Reset . CLOCK /RESET MODA MODB MODC MODA MODB MODC/BKGD RESET HCS12 Mode Pins are sampled and latched on rising edge of Reset . Sample Latch Mode Register Special Single Chip Emulation Exp Narrow Special Test Emulation Exp Wide Normal Single Chip Normal Exp Narrow Peripheral Normal Exp Wide $_0B

Freescale Corporate Template User Guide March 2005 Modes of Operation MODC MODB MODA MODE ADDR DATA BDM Special Single Chip Active 1 Special Expanded Narrow 16 8 Allowed 1 Special Test 16 16 Allowed 1 1 Emulation Expanded Wide 16 16 Allowed 1 Normal Single Chip Allowed 1 1 Expanded Narrow 16 8 Allowed 1 1 Peripheral Mode --- --- --- Normal Operating Modes: These modes provide three operating configurations. Background Debug is available in all three modes, but must first be enabled for some operations by means of a BDM background command, then activated. Normal Single-Chip Mode — There is no external expansion bus in this mode. All pins of Ports A, B and E are configured as general purpose I/O pins Port E bits 1 and 0 are available as general purpose input only pins with internal pullups enabled. All other pins of Port E are bidirectional I/O pins that are initially configured as high-impedance inputs with internal pullups enabled. Ports A and B are configured as high-impedance inputs with their internal pullups disabled. Normal Expanded Wide Mode Normal Expanded Narrow Mode Special Operating Modes: There are two special operating modes that correspond to normal operating modes. These operating modes are commonly used in factory testing and system development. Special Single-Chip Mode — When the MCU is reset in this mode, the background debug mode is enabled and “active”. The MCU does not fetch the reset vector and execute application code as it would in other modes. Instead the active background mode is in control of CPU execution and BDM firmware is waiting for additional serial commands through the BKGD pin. When a serial command instructs the MCU to return to normal execution, the system will be configured as described below unless the reset states of internal control registers have been changed through background commands after the MCU was reset. Special Test Mode — In expanded wide modes, Ports A and B are configured as a 16-bit multiplexed address and data bus and Port E provides bus control and status signals. In special test Mode, the write protection of many control bits is lifted so that they can be thoroughly tested without needing to go through reset. 1 1 1 Expanded Wide 16 16 Allowed MODA and MODB have active pulldowns during reset. MODC has the pull-up on the pin enabled after reset. Mode Pins are sampled and latched on rising edge of Reset © Freescale Semiconductor, Inc. 2005

MODC, MODB, MODA Write Capability MODE MODx Write Capability MODC, B, A write anytime but not to 110 Special Single Chip 1 Special Expanded Narrow no write MODC, B, A write anytime but not to 110 1 Special Test 1 1 Emulation Expanded Wide no write MODB, A write once but not to 110 1 Normal Single Chip 1 Expanded Narrow Peripheral Mode Expanded Wide no write

Freescale Corporate Template User Guide March 2005 内部存储器映射-寄存器 寄存器,RAM,EEPROM可以通过设置INITRG,INITRM,INITEE来重新分配他们的位置。 这些寄存器只能写一次,建议在初始化分配寄存器,RAM,EEPROM的位置。对每个INITxx赋值后,在其指令后需插入一空指令。 如果映射有冲突,寄存器具有最高优先级,与其重叠的RAM和EEPROM此时无效。 复位后,寄存器从0x0000开始,但可以被映射到64K空间内的前32K的范围内,而且映射的地址必须是2K的整数倍。 内部寄存器位置初始化寄存器 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0x1000 © Freescale Semiconductor, Inc. 2005

内部存储器映射-RAM 1、复位后RAM区从0x1000开始,但可以被映射到64K字节空间内的任何16K字节块内。 比如从$0000-$3FFF,$4000-$7FFF. 2、RAM15-14用来决定RAM区映射到哪个16K的字节块中。RAM13-11不起作用 3、RAMHAL用来决定12KRAM是放在16K的后12K区域还是前12K区域 比如INITRM=9,则RAM从$9000到$BFFF共12K 内部RAM位置初始化寄存器

内部存储器映射-EEPROM DP256有4K的EEPROM,通过INITEE的EEON位来使能 复位后,EEPROM区域从$0000开始,但可被映射任意64K空间中的4K字节块内。 EE15-12决定16位EEPROM区域地址的前4位 比如:INITEE=0x11,则地址是从$1000开始 内部EEPROM位置初始化寄存器 EEON 1 = EEPROM IS ENABLED 0 = EEPROM IS DISABLED

如果资源映射时,发生重叠,则优先级高的资源有效 映射优先级 如果资源映射时,发生重叠,则优先级高的资源有效 BDM space (Internal) when BDM is active this 256 byte block of registers and ROM appear at $FF00 – $FFFF 最高 Register Space (Internal) – 1K bytes fully blocked for registers RAM (Internal) – 12K bytes EEPROM – 4K bytes On-Chip Flash EEPROM – 256K bytes Remaining external 资 源 优先级 最低 ... 在扩展模式下,所有没有被内部资源用到的地址空间将被默认为外部存储器

强烈建议! 尽量使用默认的资源映射设置! 需要对资源映射时,注意不要使地址重叠,导致异常错误

Freescale Corporate Template User Guide 存储器映射 & 工作模式 March 2005 $0000 $0400 $1000 $4000 $FF00 $FFFF Registers Registers Registers $0000 Registers $03FF Mappable to any 2K Block within the first 32K. Mappable to any 4K Block 12K Mappable to any 16K Block and alignable to top or bottom 4K EEPROM 4K EEPROM 4K EEPROM $0000 EEPROM $0FFF $1000 $3FFF 12K RAM 12K RAM 12K RAM Page $3E $4000 Flash $7FFF 16K Flash (Fixed) 16K Flash (Fixed) 16K Flash (Fixed) 16Kx16 internal Flash Pages (Windowed) 16Kx16 Flash Pages (Windowed) 16Kx16 Flash Pages (Windowed) $8000 Flash $BFFF 16Kx48 external Flash Pages (Windowed) Page $3F $C000 Flash (Page 63) $FFFF 16K Flash (Fixed) 16K Flash (Fixed) 16K Flash (Fixed) BDM (If Active) VECTORS 扩展 VECTORS 单 片 $FF00 $FFFF 特殊单片模式 © Freescale Semiconductor, Inc. 2005

FLASH $4000–$FFFF间的存储数据是可以访问的。 由于Flash 模块的地址范围超出了 HCS12 的64K (16-bit)地址空间,所以从 $8000–$BFFF被映射到若干16K字节大小的页框中。 由PPAGE寄存器决定在当前访问的是哪一页。 $8000 - $BFFF间共有64个可访问的页。 使用PPAGE寄存器可以访问到地址在$8000–$BFFF间的所有共16页的16K字节。 Flash模块中每个块包含许多行控制和状态寄存器,它们都位于的相同地址空间 INITRG + $100 - INITRG + $10F。通过Flash 配置寄存器选择有效的某行寄存器。 MC9S12DP256 有7个引脚端口, 端口K,用来仿真或者作为通用 I/O。其余六个端口用来决定哪一个Flash页正在被访问。 其余的地址位放在 PPAGE 寄存器中。

FLASH 除了硬件的分页机制外,另外增加了两条指令,用来调用页内函数。 CALL指令类似于JSR,除了把分页窗返回地址放到堆栈中,它还会在CALL指令把新的8位的数据写到PPAGE之前,把PPAGE的当前值放到堆栈中。 调用CALL指令,需要用RTC指令返回 程序继续执行时,把PPAGE的值和分页窗口的地从堆栈中调出 MC9S12DP256的PPAGE有6位,可以有1M的寻址范围 低地址范围的768K通过PPAGE $00到$2F来访问,它被保留用作外部存储器(当使用扩展模式时) 高地址范围的256K由PPAGE的$30到$3F来访问,用作内部FLASH存储区

FLASH分页机制 所有的256K的FLASH可以通过16K的PPAGE窗口来访问,其中两个16K的页也可以通过固定地址($4000-7FFF, $C000-FFFF)来访问。 $4000-$7FFF与$3E相对应,$C000-$FFFF与$3F相对应 这两个固定页克服了内存分页机制的一些缺点 采用分页机制,在某一页中的函数无法直接访问访问另一页中的数据 需要被其它页的函数访问的数据应该放在固定页中,或只有固定页的函数才能访问其他页的数据 因为复位和中断向量表只有16位,所以所有的中断服务程序和复位初始化程序必须从固定页中开始执行。 大部分中断服务程序可以放在非固定页中,部分的中断服务程序尤其起始部分要放在固定页中。通过CALL来调用非固定页中的函数,最后用RTI指令返回

FLASH-Codewarrior Codewarrior引入两个关键字:near, far Near函数用JSR或BSR来调用 Far函数用CALL来调用 比如:void far func1(void); //func1函数放在非固定页中,可以被其他页的函数调用 const int *far ptr; //指向常量的指针放在非固定页中,这个指针可以用来指向非固定页中的变量

MC9S12DP256最常用的是BANKED内存模型 Codewarrior内存模型 Codewarrior支持3种不同的内存模型: SMALL(默认),平面的64K的地址空间。所有的函数都是near BANKED,即采用分页地址。所有的用户的函数都被默认为far far类型的数据指针可以在SMALL和BANKED中使用 LARGE, 默认为数据和代码均为分页模式。所有的函数和数据指针都是far类型。这种内存模型运行时间比较长,因此很少使用 MC9S12DP256最常用的是BANKED内存模型

Codewarrior分段 代码和数据可以被分组被Linker放在特定的存储区中 #pragma用来给代码段或数据段命名并分配属性 #pragma CODE_SEG定义一个代码段。 NEAR规定本段中的函数用JSR来调用,即只能被本页函数调用,除非把它放在固定页中 FAR规定本段中的函数用CALL来调用 如果没有规定NEAR或FAR,函数的类型由内存模型来决定 如果没有规定段,则代码放在DEFAULT_ROM中 所有跟在#pragma CODE_SEG后面的函数回放在该段中,直到下一个#pragma CODE_SEG出现,因此在头文件中,声明函数原型时,必须使用#pragma CODE_SEG #pragma CODE_SEG [NEAR|FAR] <segment_name> #include "functions.h" #pragma CODE_SEG FUNCTIONS void func1(void) { /* code */ }; void func2(void) #pragma CODE_SEG DEFAULT #pragma CODE_SEG FUNCTIONS void func1(void); void func2(void); #pragma CODE_SEG DEFAULT

Codewarrior-数据段 #pragma DATA_SEG把全局变量发到一个特定的段中 SHORT规定本段中的全局变量采用直接寻址方式。但是这段变量必须放在$0000到$00FF中 如果没有#pragma DATA_SEG,全局变量将会被放到DEFAULT_RAM段中 所有跟在#pragma DATA_SEG后面的函数回放在该段中,直到下一个#pragma DATA_SEG出现 如果全局变量被其他文件使用,则在其他文件中声明变量时,必须重复使用相同的#pragma DATA_SEG #pragma DATA_SEG [SHORT] <segment_name>

#pragma CONST_SEG [PPAGE] <segment_name> Codewarrior-常数段 #pragma CONST_SEG定义了一个常数段 PPAGE规定常数的访问要通过PPAGE, 常数可以放在非固定页 如果没有PPAGE,变量应该放在固定页 如果没有#pragma CONST_SEG,常数会被放在ROM_VAR 所有跟在#pragma CONST_SEG后面的函数回放在该段中,直到下一个#pragma CONST_SEG出现 如果全局变量被其他文件使用,则在其他文件中声明变量时,必须重复使用相同的#pragma CONST_SEG #pragma CONST_SEG [PPAGE] <segment_name> #pragma CONST_SEG B extern const int var2; #pragma CONST_SEG DEFAULT

Codewarrior-中断函数 中断函数需要放在固定页 #pragma TRAP_PROC表示以下的函数将用RTI指令返回 如果使用interrupt关键字,则不必再写#pragma TRAP_PROC __NEAR_SEG显性地表示这段代码放在固定页 #pragma CODE_SEG __NEAR_SEG NON_BANKED #pragma TRAP_PROC void interrupt_func1(void) { /* code */ }; #pragma CODE_SEG DEFAULT #pragma CODE_SEG __NEAR_SEG NON_BANKED void interrupt interrupt_func1(void) { /* code */ }; #pragma CODE_SEG DEFAULT

Freescale Corporate Template User Guide Memory Map March 2005 $0000 $0400 $1000 $4000 $8000 $C000 $FF00 $FFFF $0000 $0400 $1000 $4000 $8000 $C000 $FF00 $FFFF $0000 $0400 $1000 $4000 $8000 $C000 $FF00 $FFFF Registers- Mappable to any 2k Block within the first 32kByte. EEPROM- Mappable to any 4k Block RAM- 12k Mappable to any 16k Block and alignable to top or bottom. Registers Registers Registers EEPROM EEPROM EEPROM RAM RAM RAM 16kByte fixed Flash 16kByte fixed Flash External Memory 16kByte paged Flash 16kByte paged Flash 16kByte fixed Flash 16kByte fixed Flash Vectors Vectors BDM Expanded Mode Normal Single Chip Mode Special Single Chip Mode © Freescale Semiconductor, Inc. 2005

External Bus Interface Freescale Corporate Template User Guide March 2005 External Bus Interface A/D[15:0] R/W ECLK LSTRB HCS12 AD[15:0] - Address/Data Bus ECLK - E clock 1/2 Xtal Frequency -> used for demultiplexing and external bus timing LSTRB - Low byte strobe signal -> used to enable data on the low byte of the address bus R/W - Read=1, Write= 0 -> used to determine the data bus direction Normal Expanded Wide Mode — In expanded wide modes, Ports A and B are configured as a 16-bit multiplexed address and Data bus and Port E bit 4 is configured as the E clock output signal. These signals allow external memory and peripheral devices to be interfaced to the MCU. Normal Expanded Narrow Mode — This mode is used for lower cost production systems that use 8-bit wide external EPROMs or RAMs. Such systems take extra bus cycles to access 16-bit locations but this may be preferred over the extra cost of additional external memory devices. Ports A and B are configured as a 16-bit address bus and Port A is multiplexed with data. Internal visibility is not available in this mode because the internal cycles would need to be split into two 8-bit cycles. Since the PEAR register can only be written one time in this mode, use care to set all bits to the desired states during the single allowed write. © Freescale Semiconductor, Inc. 2005

Freescale Corporate Template User Guide Read/Write Bus Cycle Freescale Corporate Template User Guide March 2005 Latch Address © Freescale Semiconductor, Inc. 2005

Memory Interface Example Freescale Corporate Template User Guide Memory Interface Example March 2005 TO OTHER DEVICES ECLK R/W CE OE [D15:8] CE OE [D7:0] Address Latch & Decode Logic 8Kx8 RAM 8Kx8 RAM LSTRB HCS12 AD [15:0 ] WE WE ADDR [A12:1] DATA [15:0] ADDRESS B15 B8 B7 B0 0000 - FFFE 0001 - FFFF MUXED_BUS WIDE_MODE . D15 - D8 D7 - D0 © Freescale Semiconductor, Inc. 2005

Freescale Corporate Template User Guide March 2005 Byte Select Logic ADDR_BUS CS LOGIC CE CE OE OE A0 LSTRB R/W ECLK EVEN ODD WE WE MEM INT. D15-8 D7-0 DATA BUS © Freescale Semiconductor, Inc. 2005

资源映射 MISC - Miscellaneous Mapping Control Register 综合映射控制寄存器 Address Offset $0013 EXSTR BIT DEFINITION FOR EXTERNAL ADDRESS SPACE ROMON 1 = Enable Flash in memory map 0 =Disable Flash in memory map EXSTR1 EXSTR0 NUMBER OF CLKS 0 0 0 0 1 1 1 0 2 1 1 3 ROMHM 1 = Disable 16K Flash Direct Access @$4000 - $7FFF 0 = 16K Flash page $3E accessible @$4000 - $7FFF (Note: This page can still be accessed through the Program Page Window) EBICTL - External Bus Interface Control Address Offset $000E ESTR - E CLK Stretch Enable 1 = E Clock Stretches High High on External Accesses 0 = E Clock Stretches Disabled

External RAM at MC9S12DP256

Freescale Corporate Template User Guide March 2005 GP I/O PORTS Mux Ports Multiplexed Address/Data Bus DDRA DDRB PORT A PORT B DDRx 1 = PIN IS OUTPUT 0 = PINIS INPUT DDRA - Port A Data Direction Register DDRB - Port B Data Direction Register 7.......………………....................................................0 7............………..............................................0 Address Offset $0003 Address Offset $0002 Read/write Read/write RST: 0……..……………………………………………………..0 RST: 0..................………..........................................0 PORTA - Port A Data Register PORTB - Port B Data Register 7..…………………........................................................0 7..........……………..................................................0 $0000 Read/write Read/write $0001 RST: U…….…………………………………………………..….U RST: U…….…………………………………………………..….U Expanded ADDR15/ ADDR14/ ADDR13/ ADDR12 /ADDR11/ ADDR10/ ADDR9/ ADDR8/ & Periph: DATA15 DATA14 DATA13 DATA12 DATA11 DATA10 DATA9 DATA8 Expanded ADDR15/ ADDR14/ ADDR13/ ADDR12/ ADDR11/ ADDR10/ ADDR9/ ADDR8/ Narrow DATA15/ DATA14/ DATA13/ DATA12/ DATA11/ DATA10/ DATA9/ DATA8/ DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0 Expanded ADDR7/ ADDR6/ ADDR5/ ADDR4 /ADDR3/ ADDR2/ ADDR1/ ADDR0/ & Periph: DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DAT1 DATA0 Expanded ADDR7/ ADDR6/ ADDR5/ ADDR4 /ADDR3/ ADDR2/ ADDR1/ ADDR0/ Narrow © Freescale Semiconductor, Inc. 2005

Freescale Corporate Template User Guide PORTE Registers March 2005 PORTE - PORTE Register Address Offset $0008 Reset: Unaffected Alt. Pin Function XCLKS/ MODB/ MODA LSTRB R/W IRQ XIRQ NOACC IPIPE1/ IPIE0 ECLK TAGLO SCGTO RCRTO XCLKS - External Clock This pin is sampled on the rising edge of Reset to select the device clock source. NOACC - No Access This output signal indicates the current access is unused or free cycle. TAGLO - Instruction Low Byte Tagging This output signal may be used to tag the low byte of the instruction. DDRE - PORTE Data Direction Register Address Offset $0009 Reset: 0 0 0 0 0 0 0 0 DDREx =0 pin is input =1 pin is output © Freescale Semiconductor, Inc. 2005

Freescale Corporate Template User Guide March 2005 PORTE Assignments PEAR - PORTE Assignment Register Address Offset $000A Reset: 0 0 0 0 0 0 0 0 Special single chip Reset: 0 0 1 0 1 1 0 0 Special Test Reset: 0 0 0 0 0 0 0 0 Peripheral Reset: 1 0 1 0 1 1 0 0 Emulation Exp Nar Reset: 1 0 1 0 1 1 0 0 Emulation Exp Wide Reset: 0 0 0 1 0 0 0 0 Normal Single Chip Reset: 0 0 0 0 0 0 0 0 Normal Exp Nar Reset: 0 0 0 0 0 0 0 0 Normal Exp Wide PORTE Assignment Register may be used to choose between bus control or GPI/O functions. NOACCE - CPU no Access Output Enable (Write once) 1 = Port E Pin 7 is output which indicates CPU free cycle 0 = Port E Pin 7 is GPI/O PIPOE - Pipe Status Signal Output Enable (Write once) 1 = Port E Pins[6:5] are used as IPIPE1 and IPIPE0 for instruction queue tracking 0 = Port E Pins[6:5] are used as GPI/O NECLK - No External E Clock (Write anytime) 1 = Port E Pin 4 used as GPI/O 0 = Port E Pin 4 is E Clock output pin LSTRE - Low Strobe(LSTRB) Enable (Write once) 1 = Port E Pin 3 is used as LSTRB bus control signal 0 = Port E Pin 3 is used as GPI/O RDWE - Read/Write Enable (Write once) 1 = Port E Pin 2 is configured as R/W bus control signal 0 = Port E Pin 2 Is configured as GPI/O © Freescale Semiconductor, Inc. 2005

HCS12 Device Identification Freescale Corporate Template User Guide March 2005 HCS12 Device Identification The part ID is located in two 8-bit registers PARTIDH and PARTIDL. The read-only value is a unique part ID for each revision of the die. The coding is as follows: Bit 15-12: Major family identifier Bit 11-8: Minor family identifier Bit 7-4: Major mask set revision number including FAB transfers Bit 3-0: Minor - non full - mask set revision © Freescale Semiconductor, Inc. 2005

HCS12 Memory Identification Freescale Corporate Template User Guide HCS12 Memory Identification March 2005 The device memory sizes are located in two 8-bit registers MEMSIZ0 and MEMSIZ1. Also reference - EB386 “Family Compatibility Considerations” for information on how to configure a larger derivative to act as a smaller part. © Freescale Semiconductor, Inc. 2005

如何设置系统 - 选择工作模式 (硬件 / 软件) - 资源映射 (内部 / 外部) - 设置时钟 - 设置PIM - 初始化外设… 配置举例 如何设置系统 - 选择工作模式 (硬件 / 软件) - 资源映射 (内部 / 外部) - 设置时钟 - 设置PIM - 初始化外设…

配置举例 创建一个带全局变量的工程文件 编译后,打开调试界面 在component菜单中打开一个新的Memory窗口 Memory:1窗口中修改0x0010:INITRM 09  49  40 89  80 Memory:2窗口中显示不同地址中的内容 1000  5000  4000 9000  8000 当INITRM的值改变时,变量在RAM中的位置也会改变

在component菜单中打开一个Memory窗口

Memory:1窗口中 修改0x0010:INITRM 09  49  40 89  80 Memory:2窗口中 显示不同地址中的内容 1000  5000  4000 9000  8000 Memory:1窗口中 修改0x0010:INITRM 09  49  40 89  80