S08_12_Freescale_HCS08单片机SPI编程应用.pdf
《S08_12_Freescale_HCS08单片机SPI编程应用.pdf》由会员分享,可在线阅读,更多相关《S08_12_Freescale_HCS08单片机SPI编程应用.pdf(20页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaFreescale 单片机原理及应用单片机原理及应用 Freescale HCS08单片机单片机SPI编程应用编程应用Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong U
2、niversity of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSlide 1Slide 1Freescale HCS08单片机单片机SPI编程应用编程应用 Contents and ObjectivesContents and Objectives:理解HCS08的SPI模块原理SPI总线信号SPI总线时序SPI模块结构及功能学会SPI模块设计SPI模块寄存器功能利用SPI模块的串-并转换设计进一步认识“对MCU外部管脚/内部模块的控制正是通过Regs的控制来实现”Copyright Yang Ming.2011.Electron
3、ics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSlide 210.1 概述概述概况 MC9S08AW60系列MCU内部具有一个SPI模块,SPI的4个功能管脚SPSCK1、MOSI1、MISO1、SS1 分别和端口E的PTE7、PTE6、PTE5、PTE4管脚复用管脚描述SPSCK SPI串行时钟MOSI 主设备数据输出、从设备数据输入MISO 主设备数据输入、从设备数据输出SS1从设备选择Copyrig
4、ht Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.China10.2 SPI总线信号和时序总线信号和时序SPI总线信号 SPI,英文全称为Serial Peripheral Interface,串行外围设备接口的意思,是Motorola公司开发的一种全双工同步串行总线。目前有很多外围芯片,例如存储器、A/D或D/A变换器,LCD等均采用SPI接口。SPI使用4个信号来
5、收发数据。Slide 3Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.China10.2 SPI总线信号和时序总线信号和时序SPI总线时序Slide 4Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University o
6、f Science and TechnologyWuhan,Hubei 430074,P.R.China10.2 SPI总线信号和时序总线信号和时序SPI总线时序Slide 5Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.China10.3 功能描述功能描述内部结构Slide 6Copyright Yang Ming.2011.Electronics
7、 and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI波特率生成10.3 功能描述功能描述Slide 7Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI波
8、特率寄存器(SPI1BR)Slide 810.4 内部寄存器内部寄存器Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI控制寄存器1(SPI1C1)Slide 910.4 内部寄存器内部寄存器Copyright Yang Ming.2011.Electronics and Information Engineering Departmen
9、t of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI控制寄存器1(SPI1C1)Slide 1010.4 内部寄存器内部寄存器Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI控制寄存器2(SPI1C2)Slide 1110.4
10、内部寄存器内部寄存器Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University of Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI状态寄存器(SPI1S)Slide 1210.4 内部寄存器内部寄存器Copyright Yang Ming.2011.Electronics and Information Engineering Department of Huazhong University o
11、f Science and TechnologyWuhan,Hubei 430074,P.R.ChinaSPI数据寄存器(SPI1D)读此寄存器会返回接收数据缓冲器中的数据,写此寄存器会把数据写入到发送数据缓冲器。当SPI被配置为主设备时,写数据到发送数据缓冲器将启动一次SPI传送。只有SPI发送缓冲器空标志位SPTEF位为1,表示发送缓冲器为空准备接收新数据时,才能向发送数据缓冲器写入要发送数据。Slide 1310.4 内部寄存器内部寄存器Copyright Yang Ming.2011.Electronics and Information Engineering Department
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- S08_12_Freescale_HCS08 单片机 SPI 编程 应用
限制150内