SSD1963驱动板原理图
固态硬盘工作原理
固态硬盘工作原理固态硬盘(Solid State Drives)简称 SSD,是用固态电子存储芯片阵列而制成的硬盘,由控制单元和存储单元组成。
分类固态硬盘的存储介质分为两种:一种是闪存(FLASH 芯片),另外一种是DRAM。
基于闪存的固态硬盘是固态硬盘的主要类别,主要由控制芯片,缓存芯片和闪存芯片构成。
其中控制芯片主要承担数据调配、数据中转以及连接闪存芯片和外部 SATA 接口。
缓存芯片主要用于辅助控制芯片进行数据处理。
而闪存芯片则是用于数据读写。
此外,基于闪存的固态硬盘中存储单元又分:SLC(Single Level Cell)单层存储单元、MLC(Multi Leveled Cell)多层存储单元以及 TLC( Triple-cell- per-bit)三层存储单元等。
在 SLC 架构中,每 Cell 可存储 1bit 数据, MLC 架构中每 Cell 可以存储2bit 数据,而 TLC 架构每 Cell 可以存储 3 bit 数据。
存储原理Flash 的最小存储单元是晶浮栅晶体管,对应于磁盘中的一个 bit 的存储单元。
SSD 中,在存储单元晶体管的栅(Gate)中,注入不同数量的电子,通过改变栅的导电性能,来改变晶体管的导通效果,从而实现对不同状态的记录和识别。
在 SLC 架构中,栅中的电子数目多与少,带来的只有两种导通状态,对应读出的数据就只有 0/1;MLC 架构中,栅中电子数目不同时,可以读出多种状态,能够对应出 00/01/10/11 等不同数据。
因此,SSD 数据处理都要进行加电处理,加电的过程等同于 HDD 硬盘的数据写入操作,断电的过程电位恢复,相当于 HDD 硬盘的擦除。
数据完整的一次 P/E 循环就是 NAND 的写入循环。
因为 P/E 循环次数是有限的,这也就直接影响到 SSD 的寿命。
但是根据存储架构的不同,SDD 的寿命也是有差别的。
由于 SLC 结构简单,在写入数据时电压变化的区间小,所以寿命较长,传统的 SLC NAND 闪存可以经受 10 万次的读写。
SSD1963开发板使用手册
电源选择开关(USB:选择 USB 供电,E_POWER:选择 DC 电源输入)
2.LCD 背光电压(CON3)
PIN NO. 1 2 3 4 描述 背光负级输入 背光正级输入 GND 电源地 5.0V
如果被测产品背光电压为 5V 直接将 1 和 3,2 和 4 短接即可;否则,分别有 1 和 2 单独给 背光供电。
VSS VDDLCD LDATA17 BPIO0 GPIO1 GPIO2 GPIO3 VDDD VSS VDDLCD LFRAME LLINE LSHIFT VDDD VSS VDDLCD LDEN TE PWM GAMAS0 GAMAS1 VDDLCD VSS VDDD VSS VDDLCD LDATA16 LDATA15 LDATA14 LDATA13 LDATA12 VDDD
1 3 5 7 9
2 4 6 8 10
VDDD VSS VSS VDDIO VSS VDDD D0 D1 D2 D3 D4 VDDIO VSS VDDD CLK VDDIO VSS VDDPLL VSSPLL VSS VDDD XTAL_IN VSS STAL_OUT VDDD VSS VDDLCD LDATA23 LDATA22 LDATA21 LDATA20 VDDD
此开发板支持 SD 卡读写,读写方式采用 C8051 自带的 SPI,速度可高达 (25M) ;支持 USB 驱动,通过 PC 端软件,可直接将需要现实的图片数据下载 到 SD 卡中;陪送底层软件(C8051)源代码,不同的 TFT LCD 只需要修改部分 初始化参数即刻。 三.产品应用介绍 1.电源参数:输入电压 5V。如果工作电流小于 500mA,可 3.3V RSTC2CK 13 C2D 14 D7 15 D6 16 D5 17 D4 18 D3 19 D2 20 D1 21 22 D0 KEY3 23 KEY2 24
驱动桥原理图
驱动桥原理图驱动桥是一种用于控制电机或其他电动设备的电路,它可以实现电机的正转、反转以及制动等功能。
在电动车、工业机械等领域广泛应用,是现代电气控制领域的重要组成部分。
本文将介绍驱动桥的原理图及其工作原理。
驱动桥原理图主要由功率电路和控制电路两部分组成。
功率电路包括电源模块、MOS管和电机,控制电路包括驱动芯片、电流传感器、电压传感器等。
下面我们将对这两部分进行详细介绍。
首先是功率电路部分。
电源模块为整个电路提供电源,MOS管是功率开关管,可以控制电机的正转和反转。
电机是驱动桥的输出部分,根据MOS管的导通与截止状态,实现电机的正转、反转和制动。
功率电路的设计需要考虑电机的功率、电压、电流等参数,以确保电路能够正常工作。
其次是控制电路部分。
驱动芯片是控制电路的核心部分,它接收外部控制信号,并通过内部逻辑电路控制MOS管的导通与截止。
电流传感器和电压传感器用于监测电机的电流和电压,以实现对电机的闭环控制。
控制电路的设计需要考虑信号的精确度、抗干扰能力以及系统的稳定性。
驱动桥的工作原理是通过控制MOS管的导通与截止状态,实现对电机的控制。
在正转状态下,控制芯片输出相应的信号,使得MOS管导通,电机正转;在反转状态下,控制芯片输出相应的信号,使得MOS管导通,电机反转;在制动状态下,通过控制MOS管的导通与截止,实现对电机的制动。
同时,通过电流传感器和电压传感器监测电机的电流和电压,实现对电机的闭环控制,提高系统的稳定性和精度。
总之,驱动桥是一种重要的电机控制电路,它通过功率电路和控制电路实现对电机的控制。
在实际应用中,需要根据具体的要求设计合适的驱动桥原理图,并考虑功率、电压、电流、稳定性等因素,以确保电路能够正常、稳定地工作。
希望本文对驱动桥的原理图及工作原理有所帮助,谢谢阅读!。
SSD1963_1.2 彩屏TFT液晶驱动芯片 最新原版
6 7
PIN DESCRIPTIONS ................................................................................................................ 13 FUNCTIONAL BLOCK DESCRIPTIONS ............................................................................ 16
7.1 MCU INTERFACE .................................................................................................................................................16 7.1.1 6800 Mode ..................................................................................................................................................16 7.1.2 8080 Mode ..................................................................................................................................................16 7.1.3 Register Pin Mapping .................................................................................................................................16 7.1.4 Pixel Data Format ......................................................................................................................................16 7.1.5 Tearing Effect Signal (TE) ..........................................................................................................................17 7.2 SYSTEM CLOCK GENERATION .............................................................................................................................18 7.3 FRAME BUFFER....................................................................................................................................................19 7.4 SYSTEM CLOCK AND RESET MANAGER ...............................................................................................................19 7.5 LCD CONTROLLER ..............................................................................................................................................20 7.5.1 Display Format ...........................................................................................................................................20 7.5.2 General Purpose Input/Output (GPIO) ......................................................................................................20
SSD简介及其基本工作原理
SSD基本工作原理SSD(Solid State Disk),即固态存储,它用固态电子存储芯片阵列而制成的硬盘,由控制单元和存储单元组成,其一般可以分为两种方式:基于闪存的SSD (采用FLASH芯片作为存储介质)和基于DRAM的SSD(采用DRAM作为存储介质)。
传统硬盘的机械特性严重限制了数据读取、写入的速度及性能;SSD采用FLASH存储介质,它内部没有机械结构,因此没有数据查找时间、延迟时间和寻道时间。
对SSD而言,其读取数据的过程就是一个解析地址的过程,因此,其数据读取的速度非常快。
SSD的写操作比较特殊,其最小写入单元为4KB,称为页(page),当写入空白位置时可以按照4KB的单位写入,但是如果需要改写某个单元时,则需要一个额外的擦除动作,擦除的单位(块block)一般是128个page,如果向一个空白的page写入信息时,可以直接写入而无需擦除,但是如果需要改写某个存储单元的数据,必须首先将整个block读入缓存,然后修改数据,并擦除整个block的数据,最后将整个block写入,很显然,SSD改写数据的代价很高,SSD的这个特性,称之为erase-before-write。
HOST是通过逻辑地址块(LBA)访问SSD的,每个LBA代表着一个Sector (一般为512B大小),操作系统一般以4K为单位访问SSD,把HOST访问SSD 的基本单元称作用户页(Host Page)。
而在SSD内部,SSD主控与FLASH之间是以FLASH Page为基本单元访问FLASH的,称FLASH Page为物理页(Physical Page)。
HOST每写入一个Host Page,SSD主控会找Physical Page把Host数据写入,SSD内部同时记录了这样一条映射(Map)。
有了这样一个映射关系后,下次HOST需要读某个Host Page 时,SSD就知道从FLASH的哪个位置把数据读取上来。
基于SSD1963控制器的液晶显示模块设计
基于SSD1963控制器的液晶显示模块设计赵彩虹;刘凯;尹涓【摘要】为了满足嵌入式工业控制系统终端显示的需要,提出了一种基于微处理器R1610和LCD控制器SSD1963的液晶显示模块的设计方法;详细阐述了硬件接口电路的设计和控制软件的编程,重点介绍了R1610、SSD1963以及TFT液晶屏AT070TN83之间的硬件连接方法,分析了SSD1963液晶控制的使用方法以及针对液晶屏显示时序的系统设置;进行了显示控制测试,通过该显示模块实现了图像在液晶屏上的显示;测试结果表明,硬件设计和控制软件设计能够满足显示要求,显示效果良好;文章提出的显示模块设计方法同样适用于其他液晶屏的显示控制,具有一定的应用前景和参考价值.【期刊名称】《计算机测量与控制》【年(卷),期】2015(023)011【总页数】3页(P3797-3799)【关键词】SSD1963;液晶显示模块;R1610;AT070TN83【作者】赵彩虹;刘凯;尹涓【作者单位】南京航空航天大学金城学院机电工程系,南京211156;南京航空航天大学机电学院,南京210016;南京航空航天大学金城学院机电工程系,南京211156【正文语种】中文【中图分类】TN141.9液晶显示模块应用于人机交互过程中的文本及图形信息的显示[1]。
嵌入式工业控制系统中要求实时显示运行状态、系统参数以及相关图表图形等信息,采用液晶屏显示模块作为终端显示设备,显示内容丰富,直观性强[2]。
本文基于金丽科技公司(RDC)的X86系列的微处理器R1610和晶门科技公司(SolomonSystech)的SSD1963液晶显示控制器,采用群创公司(Innolux)的AT070TN83液晶屏,进行相关硬件电路和控制软件的设计,实现液晶屏的图形显示功能。
液晶显示模块结构框图如图1所示。
系统控制器采用微处理器控制,把系统信息以文本、图表的形式发送至LCD控制器;LCD控制器根据接收到的显示指令,通过LCD驱动器,以一定的扫描时序将需要显示的内容传输给液晶屏实时地进行显示。
SSD1963驱动
首页阅览室馆友我的图书馆来自:mcu_mouse > 嵌入式C语言配色:字号SSD1963的样例程序2010-12-01 | 阅:1803 转:28 | 分享//===============================typedef union {unsigned char UByte[2];unsigned int UInt;} UWORD;void SSD1963Data_16(uchar sdataH,uchar sdataL);void SSD1963Data1_16(uint dat);void SSD1963Command_16(uint cmd);void SetPixel(uint Col,uint Page,uint color); //显示一个相素点uint GetPixel(uint Col,uint Page);//得到一个像素点/******************************************************SSD1963的Conf脚,用来控制读写的方式,如果为0 则为6800总线MODE如果位1 ,则为8080总线。
下面的定义是8080 MODE(默认情况下为8080),可以通过修改Conf 跳点来修改读写式。
******************************************************/void SSD1963Command_8(uchar cmd);void SSD1963Data_8(uchar sdata);uchar GetSSD1963Data_8();uint GetSSD1963Data_16();void ReadSSD1963Set();#define SetSSD1963RD() SetBit(P4,4) #define SetSSD1963WR() SetBit(P4,5)#define SetSSD1963CS() SetBit(P4,2)#define SetSSD1963DC() SetBit(P4,3) #define SetSSD1963Reset() SetBit(P4,1) #define SetSSD1963Wait() SetBit(p4,0) #define ClrSSD1963RD() ClrBit(P4,4)#define ClrSSD1963CS() ClrBit(P4,2)#define ClrSSD1963DC() ClrBit(P4,3)#define ClrSSD1963Reset() ClrBit(P4,1)#define ClrSSD1963Wait() ClrBit(p4,0)#define DataPortL P1#define DataPortH P2//UWORD 是一个结构体//注意在给1963写命令时,只能用数据线的低8位来传输数据。
SSD固态硬盘的结构和基本工作原理概述
SSD固态硬盘的结构和基本工作原理概述我们都知道,早期的电脑CPU是可以直接从硬盘上面读取数据进行处理的,随着科技的进步,时代的发展,计算机硬件的发展速度也是极其迅猛。
CPU主频的不断提升,从单核到双核,再到多核;CPU 的处理速度越来越快,而硬盘的的读写速度已经远远跟不上CPU的读写速度,后来增加了内存这个读写速度相对较快的缓存,而内存也是蓬勃到发展,从SDRAM到DDR,从DDR到DDR2再到DDR3,但是无论怎样,内存缓存速度还是跟不上CPU的运算处理速度,后来便在CPU中增加了快速缓存机制!而硬盘这个持久化存储器呢?之前的文章,聊到了机械硬盘的结构和工作原理,今天就来聊一聊SSD固态硬盘的结构和基本工作原理,如理解有所变差,或文章有所不足,皆因水平所限!硬盘的发展在不断的科技进步中快速提升,从容量以及速度再到接口方面。
从早期的PATA变成SATA,SCSI变到SAS,以及垂直记录技术在容量上的突破,但这些进步亦未能改变磁盘的记录方式。
随着人们对数据需求增多,存储系统的瓶颈越来越明显。
而在嵌入式领域移动设备和工业自动化控制等恶劣环境下,传统硬盘机械结构已经无法满足要求,而所有这一切随着固态存储(SSD)的到来而发生了改变。
传统的机械硬盘(HDD)运行主要是靠机械驱动头,包括马达、盘片、磁头摇臂等必需的机械部件,它必须在快速旋转的磁盘上移动至访问位置,至少95%的时间都消耗在机械部件的动作上。
SSD却不同机械构造,无需移动的部件,主要由主控与闪存芯片组成的SSD可以以更快速度和准确性访问驱动器到任何位置。
传统机械硬盘必须得依靠主轴主机、磁头和磁头臂来找到位置,而SSD用集成的电路代替了物理旋转磁盘,访问数据的时间及延迟远远超过了机械硬盘。
SSD有如此的“神速”,完全得益于内部的组成部件:主控--闪存--固件算法。
主控、闪存及固件算法三者的关系:SSD最重要的三个组件就是NAND闪存,控制器及固件。
SSD工作原理傻瓜教程
NAND工作原理由于本人之前的C300测试贴中的部分原理解释不是最“傻瓜”式,造成很多朋友的困惑,在群里在论坛里讨论时,发现很多朋友的理解都还是有问题,故此特地开一个帖子解释的更“傻瓜”点。
首先我们来看下,作为L63B颗粒,Intel/Micron的34nm 4KB page的颗粒,内部结构是这样的。
1个page为4KB,1个Block为256个page组成,1个Plane由2048个Block组成,2个Plane组成1个Die,也就是最小的芯片(4GB),X25-M 80G Gen2 SSD上面我们看到10个颗粒,每个颗粒是8GB的,就是由2个Die封装起来的。
Page为最小的读写单位,Block为最小的擦除/编程单位。
(我知道这些很多人都知道,重复重复再重复我也很烦)。
接下来,我来假设一个主控和颗粒环境:1个8通道8位的主控连接到8个Die上,为了解释方便,我这里就画了每个Die里的第一个Block。
(实际当然要复杂很多)好了,接下来我们要进行读写了,看清楚,这下面的东西才是你们最想知道的。
1. 现在我先对主机发送一条命令,要求写入4KB。
主控接到主机发来的指令后,往颗粒1的Block1里写入了1个4KB(占1Page)。
2.继续写入8KB。
主控接到主机发来的指令后,往颗粒2的Block1里和颗粒3的Block1里各写入4KB。
好了,我们来举一反三,如果写入的是32KB,那么主控就会一下子往每个颗粒的Block1里写入4KB,这样就能发挥出这个SSD主控理论最大的写入带宽,相对4KB来说最好情况下我们可以得到8倍的速度(取决于主控对通道的优化,颗粒当前的文件状况等等)。
这样你们就会知道为啥4KB的写入慢,而持续写入SSD并不慢的道理了吧,实际情况下当然不会都写Block1,我这里只是想解释的简单点。
这个类似RAID 0的操作模式就是大部分的SSD内部操作情况。
上面是写入的情况,对于读取自然也是如此,4KB的读取就从一个Block里读,而32KB的话就从8个Block里拿,速度是不是8倍提升取决于要读取的数据是不是平均分布在每个颗粒的Block里,如果32KB数据是存储在图中颗粒1~4的Block1里的(每个Block假设8KB),那么读取就最多只有4倍的提升了,这也是为啥文件越小传输率越低的道理。
SSD1963初始化
SSD1963初始化/**************************************************************** mili开发板** LCD驱动代码** 版本:V1.0** 论坛:/doc/9fa31eb11a37f111f1855bd2.html** 淘宝:/doc/9fa31eb11a37f111f1855bd2.html /** 技术⽀持群:105339839***************************************************************//* Includes ------------------------------------------------------------------*/#include "stm32f10x.h"#include "hardware.h"#include "ili932x.h"#include "font.h"#includeunsigned int HDP=479;unsigned int HT=531;unsigned int HPS=43;unsigned int LPS=8;unsigned char HPW=10;unsigned int VDP=271;unsigned int VT=288;unsigned int VPS=12;unsigned int FPS=4;unsigned char VPW=10;u32 POINT_COLOR = BLUE,BACK_COLOR = WHITE; /* 分别设置点的颜⾊和底⾊ *//******************************************** 函数名:LCD_GPIO_Config* 描述:根据FSMC配置LCD的I/O*********************************************/void LCD_GPIO_Config(void){GPIO_InitTypeDef GPIO_InitStructure;/* 使能FSMC时钟*/RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);/* 使能FSMC对应相应管脚时钟 D E */RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD|RCC_APB2Periph_GPIOE,ENABLE); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;/* 配置LCD背光控制管脚*/GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;GPIO_Init(GPIOC, &GPIO_InitStructure);/* 配置FSMC相对应的数据线,FSMC-D0~D15: PD 14 15 0 1,PE 7 8 9 10 11 12 13 14 15,PD 8 9 10*/GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9 |GPIO_Pin_10 | GPIO_Pin_14 | GPIO_Pin_15;GPIO_Init(GPIOD, &GPIO_InitStructure);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 |GPIO_Pin_15;GPIO_Init(GPIOE, &GPIO_InitStructure);/* 配置FSMC相对应的控制线* PD4-FSMC_NOE :LCD-RD* PD5-FSMC_NWE :LCD-WR* PD7-FSMC_NE1 :LCD-CS* PD11-FSMC_A16 :LCD-DC*/GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;GPIO_Init(GPIOD, &GPIO_InitStructure);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;GPIO_Init(GPIOD, &GPIO_InitStructure);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;GPIO_Init(GPIOD, &GPIO_InitStructure);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 ;GPIO_Init(GPIOD, &GPIO_InitStructure);/* TFT control gpio init *///GPIO_SetBits(GPIOC, GPIO_Pin_10); // 背光打开GPIO_SetBits(GPIOD, GPIO_Pin_4); // RD = 1GPIO_SetBits(GPIOD, GPIO_Pin_5); // WR = 1GPIO_SetBits(GPIOD, GPIO_Pin_7); // CS = 1}/******************************************** 函数名:LCD_FSMC_Config* 描述:LCD FSMC 模式配置*********************************************/void LCD_FSMC_Config(void){FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;FSMC_NORSRAMTimingInitTypeDef p;p.FSMC_AddressSetupTime = 0x02; //地址建⽴时间p.FSMC_AddressHoldTime = 0x00; //地址保持时间p.FSMC_DataSetupTime = 0x05; //数据建⽴时间p.FSMC_BusTurnAroundDuration = 0x00;p.FSMC_CLKDivision = 0x00;p.FSMC_DataLatency = 0x00;p.FSMC_AccessMode = FSMC_AccessMode_B;// ⼀般使⽤模式B来控制LCDFSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR;FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable; FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState; FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);/* 使能 FSMC Bank1_SRAM Bank */FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);}/******************************************************************************* 函数名称: LCD_Write_Reg** 功能描述: 写指令及数据** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/void LCD_WriteReg(uint16_t LCD_Reg,uint16_t LCD_Dat){Write_Cmd(LCD_Reg);Write_Dat(LCD_Dat);}/******************************************************************************* 函数名称: Write_Cmd** 功能描述: 写指令** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/void Write_Cmd(uint16_t LCD_Reg){// LCD_CS = 0;// LCD_RS = 0;// GPIOC->ODR = (GPIOC->ODR&0xff00)|(LCD_Reg&0x00ff);// GPIOB->ODR = (GPIOB->ODR&0x00ff)|(LCD_Reg&0xff00);// LCD_WR = 0;// LCD_WR = 1;// LCD_CS = 1;((*(__IO u16 *) (Bank1_LCD_C)) = ((u16) LCD_Reg));}/******************************************************************************* 函数名称: Write_Dat**功能描述: 写数据** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/void Write_Dat(uint16_t LCD_Dat){// LCD_CS = 0;// LCD_RS = 1;// GPIOC->ODR = (GPIOC->ODR&0xff00)|(LCD_Dat&0x00ff);// GPIOB->ODR = (GPIOB->ODR&0x00ff)|(LCD_Dat&0xff00);// LCD_WR = 0;// LCD_WR = 1;// LCD_CS = 1;((*(__IO u16 *) (Bank1_LCD_D)) = ((u16)(LCD_Dat)));}/******************************************************************************* 函数名称: LCD_ReadReg** 功能描述: 读指令** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/uint16_t LCD_ReadReg(uint16_t LCD_Reg){// uint16_t temp;// Write_Cmd(LCD_Reg); //写⼊要读的寄存器号//// GPIOB->CRH = (GPIOB->CRH & 0x00000000) | 0x44444444; //将端⼝⾼8位配置成输⼊// GPIOC->CRL = (GPIOC->CRL & 0x00000000) | 0x44444444; //将端⼝低8位配置成输⼊// LCD_CS = 0;// LCD_RS = 1;// LCD_RD = 0;// temp = ((GPIOB->IDR&0xff00)|(GPIOC->IDR&0x00ff)); //读取数据(读寄存器时,并不需要读2次) // LCD_RD = 1;// LCD_CS = 1;// GPIOB->CRH = (GPIOB->CRH & 0x00000000) | 0x33333333; //释放端⼝⾼8位为输出// GPIOC->CRL = (GPIOC->CRL & 0x00000000) | 0x33333333; //释放端⼝低8位为输出// return temp;/* Write 16-bit Index (then Read Reg) */LCD->LCD_REG = LCD_Reg;/* Read 16-bit Reg */return (LCD->LCD_RAM);}/******************************************************************************* 函数名称: LCD_ReadDat** 功能描述: 读数据** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/uint16_t LCD_ReadDat(){// uint16_t temp;//// GPIOE->CRH = (GPIOE->CRH & 0x00000000) | 0x44444444; //将端⼝⾼8位配置成输⼊// GPIOE->CRL = (GPIOE->CRL & 0x00000000) | 0x44444444; //将端⼝低8位配置成输⼊// LCD_CS = 0;// LCD_RS = 1;// LCD_RD = 0;// temp = ((GPIOB->IDR&0xff00)|(GPIOC->IDR&0x00ff)); //读取数据(读寄存器时,并不需要读2次) // LCD_RD = 1;// LCD_CS = 1;// GPIOE->CRH = (GPIOE->CRH & 0x00000000) | 0x33333333; //释放端⼝⾼8位为输出// GPIOE->CRL = (GPIOE->CRL & 0x00000000) | 0x33333333; //释放端⼝低8位为输出//// return temp;u16 tmp_color = 0;u8 Green = 0,Red=0,Black=0;Green = *((__IO u8 *)(Bank1_LCD_D)); /*第⼀个数据⽆效*/Green = *((__IO u8 *)(Bank1_LCD_D));Red = *((__IO u8 *)(Bank1_LCD_D));Black = *((__IO u8 *)(Bank1_LCD_D));tmp_color = (u16)((((u16)Red>>3)<<11)|(((u16)Green>>2)<<5)|((u16)Black>>3));return(tmp_color);}/******************************************************************************* 函数名称: LCD_Configuration** 功能描述: LCD_IO⼝配置** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/void LCD_Configuration(){GPIO_InitTypeDef GPIO_InitStructure;RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC,ENABLE); /* 配置数据IO 连接到GPIOB *********************/GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11| GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // 推挽输出⽅式GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; // 输出IO⼝最⼤最速为50MHZ GPIO_Init(GPIOB, &GPIO_InitStructure);/* 配置控制IO 连接到PD12.PD13.PD14.PD15 *********************/GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7| GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // 推挽输出⽅式GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; // 输出IO⼝最⼤最速为50MHZ GPIO_Init(GPIOC, &GPIO_InitStructure);}/******************************************************************************* 函数名称: LCD_Init** 功能描述: LCD初始化** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/void LCD_Init(void){static uint16_t DeviceCode;//LCD_Configuration();LCD_GPIO_Config();LCD_FSMC_Config();LCD_WriteReg(0x0000,0x0001);LCD_Delay(5); // LCD_Delay 50 msDeviceCode = LCD_ReadReg(0x0000);printf(" ID=0x%x\n",DeviceCode);///////////////////////////////////LCD_Delay(5); // delay 50 msWrite_Dat(0x0023); //N=0x36 for 6.5M, 0x23 for 10M crystalWrite_Dat(0x0002);Write_Dat(0x0004);Write_Cmd(0x00E0); // PLL enableWrite_Dat(0x0001);LCD_Delay(1);Write_Cmd(0x00E0);Write_Dat(0x0003);LCD_Delay(5);Write_Cmd(0x0001); // software resetLCD_Delay(5);Write_Cmd(0x00E6); //PLL setting for PCLK, depends on resolutionWrite_Dat(0x0001);Write_Dat(0x0033);Write_Dat(0x0032);Write_Cmd(0x00B0); //LCD SPECIFICATIONWrite_Dat(0x0020);Write_Dat(0x0000);Write_Dat((HDP>>8)&0X00FF); //Set HDPWrite_Dat(HDP&0X00FF);Write_Dat((VDP>>8)&0X00FF); //Set VDPWrite_Dat(VDP&0X00FF);Write_Dat(0x0000);Write_Cmd(0x00B4); //HSYNCWrite_Dat((HT>>8)&0X00FF); //Set HTWrite_Dat(HT&0X00FF);Write_Dat((HPS>>8)&0X00FF); //Set HPSWrite_Dat(HPS&0X00FF);Write_Dat(HPW); //Set HPWWrite_Dat((LPS>>8)&0X00FF); //Set HPSWrite_Dat(LPS&0X00FF);Write_Dat(0x0000);Write_Cmd(0x00B6); //VSYNCWrite_Dat((VT>>8)&0X00FF); //Set VTWrite_Dat(VT&0X00FF);Write_Dat((VPS>>8)&0X00FF); //Set VPSWrite_Dat(VPS&0X00FF);Write_Dat(VPW); //Set VPWWrite_Dat((FPS>>8)&0X00FF); //Set FPSWrite_Dat(FPS&0X00FF);// Write_Cmd(0x00BA);// Write_Dat(0x000F); //GPIO[3:0] out 1// Write_Cmd(0x00B8);// Write_Dat(0x0007); //GPIO3=input, GPIO[2:0]=output// Write_Dat(0x0001); //GPIO0 normalWrite_Cmd(0x0036); //rotationWrite_Dat(0x0000);Write_Dat(0x0010);//============================================ //============================================ // LCD_WR_REG(0x003A); //rotation// Write_Dat(0x0050);// Write_Cmd(0x0026); //rotation// Write_Dat(0x0003);// Write_Cmd(0x0030); //rotation// Write_Dat(0x0000);//============================================= //============================================= Write_Cmd(0x00F0);//pixel data interfaceWrite_Dat(0x0003);//16位模式//Write_Cmd(0x0021);//进⼊图形颜⾊翻转模式Write_Cmd(0x00BC);//重要Write_Dat(0x0040);//对⽐度Write_Dat(0x0070);//亮度Write_Dat(0x0040);//饱和度值 //// Write_Dat(0x0080);//对⽐度// Write_Dat(0x0080);//亮度// Write_Dat(0x0080);//饱和度值 //Write_Dat(0x0001);//处理机允许Write_Cmd(0x0029); //display on//---------------------------------------------// Write_Cmd(0x0037);//重要// Write_Dat(0x000);// Write_Dat(0);LCD_Clear(WHITE);}//void WR_DATA_Prepare(void)//{// Write_Cmd(0x002c);//}/***************************************************************************** ** 函数名称: LCD_DrawPoint** 功能描述: 写⼀个点** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/ void LCD_DrawPoint(uint16_t x, uint16_t y, uint16_t color){// LCD_SetCursor(x,y); //设置光标位置// LCD_WriteRAM_Prepare(); //开始写⼊GRAM// Write_Dat(color);u32 point = color;unsigned char rcode,gcode,bcode;rcode = (unsigned char)(point >> 16);gcode = (unsigned char)(point >> 8);bcode = (unsigned char)point;Write_Cmd(0x002A);Write_Dat(x>>8);Write_Dat(x&0x00ff);Write_Dat(479>>8);Write_Dat(479&0x00ff);Write_Cmd(0x002b);Write_Dat(y>>8);Write_Dat(y&0x00ff);Write_Dat(271>>8);Write_Dat(271&0x00ff);Write_Cmd(0x002c);Write_Dat(color);// Write_Dat((rcode << 8) | (gcode));// Write_Dat((bcode << 8) | (rcode));// Write_Dat((gcode << 8) | (bcode));}/***************************************************************************** ** 函数名称: LCD_WriteRAM_Prepare** 功能描述: 些准备** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/ void LCD_WriteRAM_Prepare(){Write_Cmd(0x002c);}/***************************************************************************** ** 函数名称: LCD_SetCursor** 功能描述: 设置光标函数** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/ void LCD_SetCursor(uint8_t Xpos,uint16_t Ypos){// Write_Cmd(0x002A);// Write_Dat(Xpos>>8);// Write_Dat(Xpos&0x00ff);// Write_Dat(479>>8);// Write_Dat(479&0x00ff);// Write_Cmd(0x002b);// Write_Dat(Ypos>>8);// Write_Dat(Ypos&0x00ff);// Write_Dat(271>>8);// Write_Dat(271&0x00ff);Write_Cmd(0x002A);Write_Dat(Xpos>>8);Write_Dat(Xpos&0x00ff);Write_Dat(479>>8);Write_Dat(479&0x00ff);Write_Cmd(0x002b);Write_Dat(Ypos>>8);Write_Dat(Ypos&0x00ff);Write_Dat(271>>8);Write_Dat(271&0x00ff);}/***************************************************************************** ** 函数名称: LCD_Clear** 功能描述: 清屏幕函数** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/ //清屏函数//Color:要清屏的填充⾊void LCD_Clear(u32 color){unsigned int l=480,w;Write_Cmd(0x002a);Write_Dat(0);Write_Dat(0);Write_Dat(HDP>>8);Write_Dat(HDP&0x00ff);Write_Cmd(0x002b);Write_Dat(0);Write_Dat(0);Write_Dat(VDP>>8);Write_Dat(VDP&0x00ff);Write_Cmd(0x002c);while(l--){for(w=0;w<272;w++){Write_Dat(color);}}}/***************************************************************************** ** 函数名称: LCD_Delay** 功能描述: ⽤于LCD驱动延时** 作者: Dream** ⽇期: 2010年12⽉06⽇*****************************************************************************/ void LCD_Delay (uint32_t nCount){__IO uint16_t i;for (i=0;i}/***名称:void LCD_WindowMax()*参数:*返回:⽆*功能:设置窗⼝**/void LCD_WindowMax (unsigned int xsta,unsigned int ysta,unsigned int xend,unsigned int yend) {Write_Cmd(0X002A);Write_Dat(xsta>>8);Write_Dat(xsta&0X00FF);Write_Dat(xend>>8);Write_Dat(xend&0X00FF);Write_Cmd(0X002B);Write_Dat(ysta>>8);Write_Dat(ysta&0X00FF);Write_Dat(yend>>8);Write_Dat(yend&0X00FF);}/***名称:void LCD_Fill(uint8_t xsta, uint16_t ysta, uint8_t xend, uint16_t yend, uint16_t colour)*参数:xsta 起始X坐标ysta 起始Y坐标xend 结束X坐标yend 结束Y坐标color 待填充颜⾊*返回:⽆*功能:在指定矩形区域填充指定颜⾊,区域⼤⼩(xend-xsta)*(yend-ysta)*备注:部分区域少⼀⾏像素点**/void LCD_Fill(uint8_t xsta, uint16_t ysta, uint8_t xend, uint16_t yend, uint16_t colour){u32 n;/*设置窗⼝ */LCD_WindowMax (xsta, ysta, xend, yend);LCD_WriteRAM_Prepare(); /*开始写⼊GRAM*/n=(u32)(yend-ysta+1)*(xend-xsta+1);while(n--){Write_Dat(colour);} /*显⽰所填充的颜⾊*/}/***名称:void LCD_DrawLine(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend)*参数:xsta X起始坐标ysta Y起始坐标xend X终点坐标yend Y终点坐标*返回:⽆*功能:指定坐表(两点),画线*备注:需要添加颜⾊参数**/void LCD_DrawLine(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t color){u16 x, y, t;if((xsta==xend)&&(ysta==yend))LCD_DrawPoint(xsta, ysta, color);elseif(abs(yend-ysta)>abs(xend-xsta))/*斜率⼤于1 */{if(ysta>yend){t=ysta;yend=t;t=xsta;xsta=xend;xend=t;}for(y=ysta;y{x=(u32)(y-ysta)*(xend-xsta)/(yend-ysta)+xsta;LCD_DrawPoint(x, y, color);}}else /*斜率⼩于等于1 */{if(xsta>xend){t=ysta;ysta=yend;yend=t;t=xsta;xsta=xend;xend=t;}for(x=xsta;x<=xend;x++) /*以x轴为基准*/{y =(u32)(x-xsta)*(yend-ysta)/(xend-xsta)+ysta;LCD_DrawPoint(x, y, color);}}}/***名称:void Draw_Circle(uint16_t x0, uint16_t y0, uint8_t r)*参数:x0 中⼼点横坐标y0 中⼼点纵坐标r 半径*返回:⽆*功能:在指定位置画⼀个指定⼤⼩的圆*备注:加⼊颜⾊参数,是否填充等**/void Draw_Circle(uint16_t x0, uint16_t y0, uint8_t r, uint16_t color) {int a,b;int di;a=0;b=r;di=3-(r<<1); /*判断下个点位置的标志*/while(a<=b){LCD_DrawPoint(x0-b, y0-a, color); //3LCD_DrawPoint(x0+b, y0-a, color); //0LCD_DrawPoint(x0-a, y0+b, color); //1LCD_DrawPoint(x0-b, y0-a, color); //7LCD_DrawPoint(x0-a, y0-b, color); //2LCD_DrawPoint(x0+b, y0+a, color); //4LCD_DrawPoint(x0+a, y0-b, color); //5LCD_DrawPoint(x0+a, y0+b, color); //6LCD_DrawPoint(x0-b, y0+a, color);a++;/*使⽤Bresenham算法画圆*/if(di<0)di +=4*a+6;else{di+=10+4*(a-b);b--;}LCD_DrawPoint(x0+a, y0+b, color);}}/***名称:void LCD_DrawRectangle(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend)*参数:xsta X起始坐标ysta Y起始坐标xend X结束坐标yend Y结束坐标*返回:⽆*功能:在指定区域画矩形*备注:**/void LCD_DrawRectangle(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t color) {LCD_DrawLine(xsta, ysta, xend, ysta, color);LCD_DrawLine(xsta, ysta, xsta, yend, color);LCD_DrawLine(xsta, yend, xend, yend, color);LCD_DrawLine(xend, ysta, xend, yend, color);}/***名称:void LCD_ShowChar(u8 x, u16 y, u8 num, u8 size, u16 PenColor, u16 BackColor)*参数:x,y 起始坐标(x:0~234 y:0~308)num 字符ASCII码值size字符⼤⼩,使⽤默认8*16PenColor 字体颜⾊BackColor 字体背景颜⾊*功能:*备注:注意屏幕⼤⼩**/void LCD_ShowChar(u8 x, u16 y, u8 num, u8 size, u16 PenColor, u16 BackColor){#define MAX_CHAR_POSX 232#define MAX_CHAR_POSY 304u8 temp;u8 pos,t;if(x>MAX_CHAR_POSX||y>MAX_CHAR_POSY)return;num=num-' '; /*得到偏移后的值 */for(pos=0;pos{temp=asc2_1608[num][pos]; /*调⽤1608字体 */for(t=0;t{if(temp&0x01) /*从低位开始*/{LCD_DrawPoint(x+t, y+pos, PenColor); /*画字体颜⾊⼀个点*/}elseLCD_DrawPoint(x+t, y+pos, BackColor); /*画背景颜⾊⼀个点*/temp>>=1;}}}//m^n函数u32 mypow(u8 m,u8 n){u32 result=1;while(n--)result*=m;return result;}//显⽰2个数字//x,y :起点坐标//len :数字的位数//size:字体⼤⼩//color:颜⾊//num:数值(0~4294967295);void LCD_ShowNum(u8 x,u8 y,u32 num,u8 len, u16 PenColor, u16 BackColor){u8 size = 16; /* 这⾥使⽤默认的16*8 */u8 t,temp;u8 enshow=0;for(t=0;t{temp=(num/mypow(10,len-t-1))%10;if(enshow==0&&t<(len-1)){if(temp==0){LCD_ShowChar(x+(size/2)*t,y,' ',size, PenColor, BackColor);continue;}else enshow=1;}LCD_ShowChar(x+(size/2)*t,y,temp+'0',size, PenColor, BackColor);}}/**名称:void LCD_ShowCharString(uint16_t x, uint16_t y, const uint8_t *p, uint16_t PenColor, uint16_t BackColor)参数:x,y 起始坐标p 指向字符串起始地址PenColor 字符颜⾊BackColor 背景颜⾊功能:备注:⽤16字体,可以调节此函数不能单独调⽤**/void LCD_ShowCharString(uint16_t x, uint16_t y, const uint8_t *p, uint16_t PenColor, uint16_t BackColor){uint8_t size = 16; /*---字符⼤⼩默认16*8---*/if(x>MAX_CHAR_POSX){x=0;y+=size;} /*超出X轴字体最⼩单位,换⾏*/if(y>MAX_CHAR_POSY){y=x=0;LCD_Clear(WHITE);} /*超出Y轴字体最⼩单位,回到原点,并且清屏*/LCD_ShowChar(x, y, *p, size, PenColor, BackColor); /*0表⽰⾮叠加⽅式*/}/***名称: u16 findHzIndex(u8 *hz)*参数:hz*功能:索引汉字存储的内存地址*备注:**/u16 findHzIndex(u8 *hz) /* 在⾃定义汉字库在查找所要显⽰ *//* 的汉字的位置 */{u16 i=0;FNT_GB16 *ptGb16 = (FNT_GB16 *)GBHZ_16; /*ptGb16指向GBHZ_16*/while(ptGb16[i].Index[0] > 0x80){if ((*hz == ptGb16[i].Index[0]) && (*(hz+1) == ptGb16[i].Index[1])) /*汉字⽤两位来表⽰地址码*/{return i;}i++;if(i > (sizeof((FNT_GB16 *)GBHZ_16) / sizeof(FNT_GB16) - 1)) /* 搜索下标约束 */{break;}}return 0;}/***名称:void WriteOneHz(uint16_t x0, uint16_t y0, uint8_t *pucMsk, uint16_t PenColor, uint16_t BackColor) *参数:x0,y0 起始坐标*pucMsk 指向PenColor 字符颜⾊BackColor 背景颜⾊*功能:*备注:此函数不能单独作为汉字字符显⽰**/void WriteOneHz(u16 x0, u16 y0, u8 *pucMsk, u16 PenColor, u16 BackColor){u16 i,j;u16 mod[16]; /* 当前字模 16*16 */u16 *pusMsk; /* 当前字库地址 */u16 y;pusMsk = (u16 *)pucMsk;for(i=0; i<16; i++) /* 保存当前汉字点阵式字模 */{mod[i] = *pusMsk; /* 取得当前字模,半字对齐访问 */mod[i] = ((mod[i] & 0xff00) >> 8) | ((mod[i] & 0x00ff) << 8);/* 字模交换⾼低字节*/pusMsk = pusMsk+1;}y = y0;for(i=0; i<16; i++) /* 16⾏ */{for(j=0; j<16; j++) /* 16列 */{if((mod[i] << j) & 0x8000) /* 显⽰第i⾏共16个点 */{LCD_DrawPoint(x0+j, y0+i, PenColor);}else{LCD_DrawPoint(x0+j, y0+i, BackColor);}}y++;}}/***名称:void LCD_ShowHzString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor)*参数:x0,y0 起始坐标pcStr 指向PenColor 字体颜⾊BackColor 字体背景*功能:显⽰汉字字符串*备注:这个函数不能单独调⽤**/void LCD_ShowHzString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor){#define MAX_HZ_POSX 224#define MAX_HZ_POSY 304u16 usIndex;u8 size = 16;FNT_GB16 *ptGb16 = 0;ptGb16 = (FNT_GB16 *)GBHZ_16;if(x0>MAX_HZ_POSX){x0=0;y0+=size;} /*超出X轴字体最⼩单位,换⾏*/if(y0>MAX_HZ_POSY){y0=x0=0;LCD_Clear(WHITE);} /*超出Y轴字体最⼩单位,回到原点,并且清屏*/ usIndex = findHzIndex(pcStr);WriteOneHz(x0, y0, (u8 *)&(ptGb16[usIndex].Msk[0]), PenColor, BackColor); /* 显⽰字符 */}/***名称:void LCD_ShowString(u16 x0, u16 y0, u8 *pcstr, u16 PenColor, u16 BackColor)*参数:x0 y0 起始坐标pcstr 字符串指针PenColor 字体颜⾊BackColor 字体背景⾊*功能:调⽤字符和汉字显⽰函数,实现字符串显⽰*备注:**/void LCD_ShowString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor){while(*pcStr!='\0'){if(*pcStr>0x80) /*显⽰汉字*/{LCD_ShowHzString(x0, y0, pcStr, PenColor, BackColor);pcStr += 2;x0 += 16;}else /*显⽰字符*/{LCD_ShowCharString(x0, y0, pcStr, PenColor, BackColor);pcStr +=1;x0+= 8;}}}/***************************************************************************** 名称:u16 ili9320_BGRtoRGB(u16 Color)* 功能:RRRRRGGGGGGBBBBB 改为 BBBBBGGGGGGRRRRR 格式* ⼊⼝参数:Color BRG 颜⾊值* 出⼝参数:RGB 颜⾊值* 说明:内部函数调⽤* 调⽤⽅法:****************************************************************************/u16 LCD_RGBtoBGR(u16 Color){u16 r, g, b, bgr;b = (Color>>0) & 0x1f; /* 提取B */g = (Color>>5) & 0x3f; /* 中间六位 */r = (Color>>11) & 0x1f; /* 提取R */bgr = (b<<11) + (g<<5) + (r<<0);return( bgr );}/***************************************************************************** 名称:void LCD_DrawPicture(u16 StartX,u16 StartY,u16 EndX,u16 EndY,u16 *pic) * 功能:在指定座标范围显⽰⼀副图⽚* ⼊⼝参数:StartX ⾏起始座标* StartY 列起始座标* EndX ⾏结束座标* EndY 列结束座标pic 图⽚头指针* 出⼝参数:⽆* 说明:图⽚取模格式为⽔平扫描,16位颜⾊模式* 调⽤⽅法:LCD_DrawPicture(0,0,100,100,(u16*)demo);****************************************************************************/void LCD_DrawPicture(u16 StartX,u16 StartY,u16 Xend,u16 Yend,u8 *pic){static u16 i=0,j=0;u16 *bitmap = (u16 *)pic;for(j=0; j{for(i=0; iLCD_DrawPoint(StartX+i, StartY+j, *bitmap++);}}//快速ALPHA BLENDING算法.//src:源颜⾊//dst:⽬标颜⾊//alpha:透明程度(0~32)//返回值:混合后的颜⾊.u16 gui_alpha_blend565(u16 src,u16 dst,u8 alpha){u32 src2;u32 dst2;//Convert to 32bit |-----GGGGGG-----RRRRR------BBBBB|src2=((src<<16)|src)&0x07E0F81F;dst2=((dst<<16)|dst)&0x07E0F81F;//Perform blending R:G:B with alpha in range 0..32//Note that the reason that alpha may not exceed 32 is that there are only//5bits of space between each R:G:B value, any higher value will overflow//into the next component and deliver ugly result.dst2=((((dst2-src2)*alpha)>>5)+src2)&0x07E0F81F;return (dst2>>16)|dst2;}。
ssd固态硬盘的原理深层透视
SSD固态硬盘的原理深层透视2012-08-07 10:23:18 来源: 作者: 【大中小】浏览:501次评论:0条目前市场是流通的SSD固态硬盘的工作原理都是大家很好奇的,这里就对SSD的工作原理进行讲解,让大家能更好的进行购买和使用。
SSD固态硬盘的接口规范和定义、功能及使用方法上与普通硬盘的相同,在产品外形和尺寸上也与普通硬盘一致。
由于固态硬盘没有普通硬盘的旋转介质,因而抗震性极佳。
其芯片的工作温度范围很宽(-40~85摄氏度)。
SSD固态硬盘工作原理下面是一个关于NAND闪盘的原理图。
从下图我们可以看到,每一个“单元”就是由一个这样的晶体管组成的。
在单级单元(SLC,single level cell)闪存设备中,一个晶体管可容纳1比特数据。
您通过电子通道将数据写入单元;将足够高的电压加于两端,创造一个足够强大的电场,电子将穿透氧化物进入浮动门。
消除电压,电子将继续停留在浮动门。
将电压穿越通道而不施加到门上,扭转偏压,电子将向另一个方向移动。
简单的说,这就是闪盘的工作原理-你有两种状态,0和1,即使单元没有电了,状态也会维持住,因此对存储设备来说是非常理想的。
编程闪存是一个反复的过程。
该控制器将电压施于门(或通道)上,允许一些电子穿过并检查单元的临界电压。
当临界电压已达到一些预定的值时,就开始编程并储存数据了。
MLC与SLC的区别目前SSD固态硬盘硬盘使用两种形式的NAND闪存:单级单元(SLC)和多级单元(MLC)。
两者之间的差别是每单元存储的数据量,SLC每单元存储1比特而MLC每单元存储2比特。
关键在于,SLC和MLC占据了相同大小的芯片面积。
因此,在同样的价格下,MLC可以有两倍容量的效果。
英特尔的SLC和MLC闪存实际上使用了相同的晶体管,不同之处在于怎样读/写这两个闪存。
SLC只有两个电压符,因为它只有两个状态(0或1)。
MLC却有四个状态(00,01,10 ,11),因此需要花费较长的时间来访问,因为你不想意外写入错误的数据;您已有了相同的最大、最小电压,您现在仅仅有它们两者之间更多的刻度:SLC (left) vs. MLC (right)SLC和MLC的擦除性能是一样的,MLC闪存的读取性能需花费两倍长的时间,写入性能需花费四倍长的时间。
SSD1303T8R1资料
SOLOMON SYSTECHSEMICONDUCTOR TECHNICAL DATAThis document contains information on a new product. Specifications and information herein are subject to change without notice. SSD1303 Rev 1.7 P 1/56 May 2005 Copyright 2005 Solomon Systech LimitedAdvance Information132 x 64 Dot MatrixOLED/PLED Segment/Common Driver with ControllerSSD1303TABLE OF CONTENTS1GENERAL INFORMATION (5)2FEATURES (5)3ORDERING INFORMATION (6)4BLOCK DIAGRAM (7)5DIE PAD FLOOR PLAN (8)6PIN DESCRIPTION (12)7FUNCTIONAL BLOCK DESCRIPTIONS (15)7.1O SCILLATOR C IRCUIT AND D ISPLAY T IME G ENERATOR (15)7.2R ESET C IRCUIT (15)7.3C OMMAND D ECODER AND C OMMAND I NTERFACE (15)7.4MPU P ARALLEL 6800-SERIES I NTERFACE (16)7.5MPU P ARALLEL 8080-SERIES I NTERFACE (16)7.6MPU S ERIAL I NTERFACE (17)7.7G RAPHIC D ISPLAY D ATA RAM (GDDRAM) (17)7.8C URRENT C ONTROL AND V OLTAGE C ONTROL (17)7.9S EGMENT D RIVERS / C OMMON D RIVERS (18)7.10A REA C OLOUR D ECODER (18)7.11DC-DC V OLTAGE C ONVERTER (19)8COMMAND TABLE (21)8.1D ATA R EAD / W RITE (24)9COMMAND DESCRIPTIONS (25)10MAXIMUM RATINGS (32)11DC CHARACTERISTICS (33)12AC CHARACTERISTICS (34)13APPLICATION EXAMPLE (38)14SSD1303T3R1 PACKAGE DETAILS (39)SSD1303T3R1 P IN A SSIGNMENT (39)15SSD1303T6R1 PACKAGE DETAILS (43)SSD1303T6R1 P IN A SSIGNMENT (43)SSD1303T6R1 TAB P ACKAGE D IMENSIONS (45)16SSD1303T8R1 PACKAGE DETAILS (47)SSD1303T8R1 P IN A SSIGNMENT (47)SSD1303T8R1 TAB P ACKAGE D IMENSIONS (49)17SSD1303T9R1 PACKAGE DETAILS (51)SSD1303T9R1 P IN A SSIGNMENT (51)SSD1303T9R1 TAB P ACKAGE D IMENSIONS (53)Solomon Systech May 2005 P 2/56 Rev 1.7 SSD130318SSD1303Z PACKAGE DETAILS (55)SSD1303Rev 1.7 P 3/56 May 2005 Solomon SystechTABLE OF FIGURESFigure 1 - Block Diagram (7)Figure 2 - SSD1303Z Pin Assignment (8)Figure 3 - SSD1303Z Alignment mark dimensions (11)Figure 4 - Oscillator Circuit (15)Figure 5 - Display data read back procedure - insertion of dummy read (16)Figure 6 – Display data write procedure in SPI mode (17)Figure 7 - DC-DC voltage converter circuit (19)Figure 8 - Horizontal scroll direction (25)Figure 9 - Segment current vs Contrast setting (26)Figure 10 - 6800-series MPU parallel interface characteristics (35)Figure 11 - 8080-series MPU parallel interface characteristics (36)Figure 12 - Serial interface characteristics (37)Figure 13 - Application Example (Block Diagram of SSD1303T3) (38)Figure 14 - SSD1303T3R1 pin assignment (Copper view, Normal TAB design) (39)Figure 15 - SSD1303T6R1 pin assignment (Copper view) (43)Figure 16 - SSD1303T9R1 pin assignment (Copper view) (51)LIST OF TABLESTable 1 - Ordering Information (6)Table 2 - SSD1303Z Die Pad Coordinates (9)Table 3 - Passive component selection: (20)Table 4 - Command table (21)Table 5 - Read command table (23)Table 6 - Address increment table (Automatic) (24)Table 7 - Maximum Ratings (32)Table 8 - DC Characteristics (33)Table 9 - AC Characteristics (34)Table 10 - 6800-Series MPU Parallel Interface Timing Characteristics (35)Table 11 - 8080-Series MPU Parallel Interface Timing Characteristics (36)Table 12 - Serial Interface Timing Characteristics (37)Table 13 - SSD1303T3R1 pin assignment (40)Table 14 - SSD1303T6R1 pin assignment (44)Table 15 - SSD1303T8R1 pin assignment (48)Table 16 - SSD1303T9R1 pin assignment (52)Solomon Systech May 2005 P 4/56 Rev 1.7 SSD13031 GENERAL INFORMATIONThe SSD1303 is a single-chip CMOS OLED/PLED driver with controller for organic/polymer light emitting diode dot-matrix graphic display system. It consists of 132 segments, 64 commons that can support a maximum display resolution of 132x64. Besides, there are 4-colour selections to support monochrome or area colour OLED/PLED. This IC is designed for Common Cathode type OLED panel.The SSD1303 embeds with contrast control, display RAM and oscillator, which reduces the number of external components and power consumption. It is suitable for many compact portable applications, such as mobile phone sub-display, calculator and MP3 player, etc.2 FEATURES- Support maximum 132 x 64 dot matrix panel- Area colour support with 4 Colour Selection and 64 steps per colour- Logic voltage supply: V DD = 2.4V - 3.5V- High voltage supply: V CC = 7.0V - 16.0V- Maximum segment output current: 320uA- Maximum common sink current: 45mA- Embedded 132 x 64 bit SRAM display buffer- 256-step Contrast Control on monochrome passive OLED panel- On-ChipOscillator- Programmable Frame Frequency and Multiplexing Ratio- 8-bit 6800-series Parallel Interface, 8-bit 8080-series Parallel Interface, Serial Peripheral Interface- Row Re-mapping and Column Re-mappingScrolling- Vertical- Automatic horizontal scrolling function- Low power consumption- Wide range of operating temperatures: -40 to 90 °CSSD1303Rev 1.7 P 5/56 May 2005 Solomon SystechSolomon SystechMay 2005P 6/56Rev 1.7SSD13033 ORDERING INFORMATIONTable 1 - Ordering InformationOrdering Part NumberSEG COM Package Form Reference RemarkSSD1303Z13264Gold Bump DiePage 8Die size: 9.22mm x 1.55mmPad pitch: COM 51.8µm SEG 52.2µmSSD1303T3R1 96 64 TABPage 39 •35mm film•4 sprocket hole •Folding TAB• 80 / 68 / SPI interface• Output lead pitch 0.12974mm SSD1303T6R1 132 64 TABPage 43 • 35mm film•4 sprocket hole •Folding TAB• 80 / 68 / SPI interface • Output lead pitch 0.11976 SSD1303T8R1 96 64 TABPage 47 • 35mm film•4 sprocket hole •Folding TAB• 80 / 68 / SPI interface• Output lead pitch 0.12974mm SSD1303T9R1 96 64 TABPage 51• 35mm film• 4 sprocket hole •Folding TAB• 80 / 68 / SPI interface• Output lead pitch 0.12974mm4 BLOCK DIAGRAMFigure 1 - Block DiagramSSD1303Rev 1.7 P 7/56 May 2005 Solomon SystechTable 2 - SSD1303Z Die Pad CoordinatesSSD1303Rev 1.7 P 9/56 May 2005 Solomon SystechSolomon SystechMay 2005P 10/56 Rev 1.7SSD1303Figure 3 - SSD1303Z Alignment mark dimensions6 PIN DESCRIPTIONCLThis pin is the system clock input. When internal clock is enabled, this pin should be left open. The internal clock is output from this pin. When internal oscillator is disabled, this pin receives display clock signal from external clock source. CLSThis is the internal clock enable pin. When it is pulled HIGH, internal clock is enabled. When it is pulled LOW, the internal clock is disabled, an external clock source must be connected to the CL pin for normal operation .BS0, BS1, BS2These are MCU interface input selection pins. See the following table for selecting different interfaces:6800-parallel interface 8080-parallel interface SerialinterfaceBS0 0 0 0 BS1 0 1 0 BS2 11CS#This pin is the chip select input. The chip is enabled for MCU communication only when CS# had been pulled low.RES#This is a reset signal input pin. When it is pulled LOW, initialization of the chip is executed.D/CThis is the Data/Command control pin. When it is pulled HIGH, the input at D 7-D 0 is treated as display data. When it is pulled LOW, the input at D 7-D 0 is transferred to the command registers. For detail relationship to MCU interface signals, please refer to the Timing Characteristics Diagrams.R/W (WR#)This is a MCU interface input pin. When 6800-series Parallel Interface mode is selected, this pin is used as Read/Write (R/W) selection input. Pull this pin to HIGH for read mode and pull it to LOW for write mode.When 8080-series Parallel Interface mode is selected, this pin is used as Write (WR#) selection input. Pull this pin to LOW for write mode. Data write operation is initiated when this pin is pulled LOW and the CS# is pulled LOW.E (RD#)This is a MCU interface input pin. When 6800-series Parallel Interface is selected, this pin is used as Enable (E) signal. Read/Write operation is initiated when this pin is pulled HIGH and the CS# pin is pulled LOW. When 8080-series Parallel Interface is selected, this pin is used to receive the Read Data (RD#) signal. Data read operation is initiated when this pin is pulled LOW and CS# pin is pulled LOW.D 7-D 0These are 8-bit bi-directional data bus to be connected to the microprocessor’s data bus. When serial interface mode is selected, D 1 will be the serial data input, SDIN, D 0 will be the serial clock input, SCLK, and D 2 should be left opened.VDDThis is a voltage supply pin. It must be connected to external source.VSSThis is a ground pin. It also acts as a reference for the logic pins and the OLED driving voltages. It must be connected to external ground.BGGNDThis is a ground pin for analog circuits. It must be connected to external groundVCCThis is the most positive voltage supply pin of the chip. It should be supplied externally.VREFThis is a voltage reference pin for pre-charge voltage in driving OLED device. Voltage should be set to match with the OLED driving voltage in current drive phase. It can either be supplied externally or by connecting to VCC.IREFThis is a segment current reference pin. A resistor should be connected between this pin and V SS. Set the current at 10uA.VCOMHThis is an input pin for the voltage output high level for COM signals. A capacitor should be connected between this pin and VSS.VDDB This is a power supply pin for the internal buffer of the DC-DC voltage converter. It must be connected to V DD when the converter is used.VSSBThis is a ground pin for the internal buffer of the DC-DC voltage converter. It must be connected to V SS when the converter is used.GDRThis is an output pin drives the gate of the external NMOS of the booster circuit.RESEThis is a source current pin of the external NMOS of the booster circuit.VB REFThis is an internal voltage reference pin for booster circuit. A stabilization capacitor, typ. 1uF, should be connected to Vss.FBThis is a feedback resistor input pin for the booster circuit. It is used to adjust the booster output voltage level, Vcc.COM0-COM63These are pins provided the Common switch signals to the OLED panel. They are in high impedance state when display is OFF.SEG0-SEG131These are pins provided the Segment switch signals to the OLED panal. They are in high impedance stage when display is OFF.TR0-TR8, GPIO0, GPIO1, ICAS, M and DOF#These are reserved pins. No connection necessary and should be left open individually.VSLThis is a segment voltage reference pin. This pin should be connected to VSS externally.VCLThis is a common voltage reference pin. This pin should be connected to VSS externally.M/SThis pin must be connected to VDD to enable the chip.NCDummy pad. Do not group or short NC pins together.7 FUNCTIONAL BLOCK DESCRIPTIONS7.1 Oscillator Circuit and Display Time GeneratorFigure 4 - Oscillator CircuitThis module is an On-Chip low power RC oscillator circuitry (Figure 4). The oscillator generates the clockfor the Display Timing Generator.7.2 Reset CircuitWhen RES# pin is pulled LOW, the chip is initialized with the following status:1. Display is OFF2. 132 x 64 Display Mode3. Normal segment and display data column address and row address mapping (SEG0 is mapped tocolumn address 00H and COM0 is mapped to row address 00H)4. Shift register data clear in serial interface5. Display start line is set at display RAM address 06. Column address counter is set at 07. Normal scan direction of the COM outputs8. Contrast control register is set at 80H9. DC/DC enable7.3 Command Decoder and Command InterfaceThis module determines whether the input data is interpreted as data or command. When the D/C# pin is pulled HIGH, the inputs at D7-D0 are interpreted as data and be written to Graphic Display Data RAM (GDDRAM). When it is pulled LOW, the inputs at D7-D0 are interpreted as command, they will be decoded and be written to the corresponding command registers.7.4 MPU Parallel 6800-series InterfaceThe parallel interface consists of 8 bi-directional data pins (D7-D0), R/W (WR#), E (RD#), D/C, CS#. When the R/W (WR#) pin is pulled HIGH, Read operation from the Graphic Display Data RAM (GDDRAM) or the status register occurs. When the R/W (WR#) pin is pulled LOW, Write operation to Display Data RAM or Internal Command Registers occurs, depending on the status of D/C input. The E (RD#) input serves as data latch signal (clock) when HIGH provided that CS# is LOW. Refer to Parallel Interface Timing Diagram of 6800-series microprocessors.In order to match the operating frequency of display RAM with that of the microprocessor, some pipeline processing is internally performed, which requires the insertion of a dummy read before the first actual display data read. This is shown in Figure 5 below.Figure 5 - Display data read back procedure - insertion of dummy read7.5 MPU Parallel 8080-series InterfaceThe parallel interface consists of 8 bi-directional data pins (D7-D0), R/W (WR#), E (RD#), D/C, CS#. The E (RD#) input serves as data read latch signal (clock) when it is LOW provided that CS# is LOW. Display data or status register read is controlled by D/C signal.R/W (WR#) input serves as data write latch signal (clock) when it is HIGH and provided that CS# is LOW. Display data or command register write is controlled by D/C. Refer to Parallel Interface Timing Diagram of 8080-series microprocessor. Similar to 6800-series interface, a dummy read is also required before the first actual display data read.7.6 MPU Serial InterfaceThe serial interface consists of serial clock SCLK, serial data SDIN, D/C#, CS#. In SPI mode, D0 acts as SCLK, D1 acts as SDIN. For the unused data pins, D2 should be left open. D3 to D7, E and R/W pins can be connected to external ground.SDIN is shifted into an 8-bit shift register on every rising edge of SCLK in the order of D 7, D 6, ... D 0. D/C# is sampled on every eighth clock and the data byte in the shift register is written to the Display Data RAM or command register in the same clock.During data writing, an additional NOP command should be inserted before the CS# goes high (Refer to Figure 6.Figure 6 – Display data write procedure in SPI modeSCLK(D0)SDIN(D1)CS#D/CSDIN/SCLK7.7 Graphic Display Data RAM (GDDRAM)The GDDRAM is a bit mapped static RAM holding the bit pattern to be displayed. The size of the RAM is 132 x 64 bits. For mechanical flexibility, re-mapping on both Segment and Common outputs can be selected by software.For vertical scrolling of the display, an internal register storing display start line can be set to control the portion of the RAM data to be mapped to the display.7.8 Current Control and Voltage ControlThis block is used to derive the incoming power sources into different levels of internal use voltage and current. VCC and VDD are external power supplies. VREF is reference voltage, which is used to derive the driving voltage for segments and commons. IREF is a reference current source for segment current drivers.7.9 Segment Drivers / Common DriversSegment drivers deliver 132 current sources to drive OLED panel. The driving current can be adjusted from 0 to 300uA with 256 steps. Common drivers generate voltage scanning pulses.7.10 Area Colour DecoderPage 0 and Page 1 of the display are divided into 32 banks. Bank16 and Bank32 comprise of a display area of 12 x 8 pixels. Other banks (0~15 & 17~31) have matrices of 8 x 8 pixels. Each bank can be programmed to any one of the four colours (colour A, B, C, D). Detailed operation can be referred to the Command Table.7.11 D C-DC Voltage ConverterIt is a switching voltage generator circuit, designed for handheld applications. In SSD1303, internal DC-DC voltage converter accompanying with an external application circuit (shown in below figure) can generate a high voltage supply V CC from a low voltage supply input V DD. V CC is the voltage supply to the OLED driver block. Below application circuit is an example for the input voltage of 3V VDD to generate V CC of 12V @0mA ~ 20mA application.Figure 7 - DC-DC voltage converter circuitL1Remark:1. VSSB is tied to VSS on SSD1303T3 package.2. L1, D1, Q1, C5 should be grouped closed together on PCB layout.3. R1, R2, C1, C4 should be grouped closed together on PCB layout.4. The VCC output voltage level can be adjusted by R1and R2, the reference formula is:VCC = 1.2 x (R1+R2) / R2The value of (R1+R2) should be between 500k to 1M Ohm.Table 3 - Passive component selection:Components Typical Value Remark10µH 1AL1 Inductor,D1 Schottky diode 1A, 25V e.g. 1N5822, BAT54 [PhilipsSemiconductors]Q1 MOSFET N-FET with low R DS(on) and low Vth voltage.e.g. MGSF1N02LT1 [ON SEMI]R1, R2 Resistor 1%,1/10WR3 Resistor, 1.2Ω1%, 1/2W1µF 16VC1 Capacitor,C2 Capacitor, 6.8µF Low ESR, 25V1µF 16VC3 Capacitor,16V10nFC4 Capacitor,C5 Capacitor, 1 ~ 10 µF 16VC6 Capacitor, 0.1 ~ 1µF 16V16V15nFC7 Capacitor,8 COMMAND TABLETable 4 - Command table(D/C =0, R/W (WR#)=0, E (RD#)=1)Note: commands marked with “**” are compatible to SSD1301D/C Hex D7 D6 D5 D4 D3 D2 D1 D0Command Description0 0 0 0 0 X 3 X 2 X 1 X 000~0FSet Lower ColumnAddress **Set the lower nibble of the column address register using X 3X 2X 1X 0 as data bits. The initial display line register is reset to 0000b after POR.0 10~1F 0 0 0 1 X 3 X 2 X 1 X 0 Set Higher ColumnAddress ** Set the higher nibble of the column address register using X 3X 2X 1X 0 as data bits. The initial display line register is reset to 0000b after POR.261110 Horizontal scroll setupA[2:0] Set the number of column scroll per step 0 A[2:0] * * * * * A 2 A 1 A 0 Valid value: 001b, 010b, 011b, 100b 0 B[2:0] * * * * * B 2 B 1 B 0 B[2:0] Define start page address0 C[1:0] * * * * * * C 1 C 0 C[1:0] Set time interval between each scroll step in terms of frame frequency 0 D[2:0] * * * * * D 2 D 1 D 000b – 12 frame01b – 64 frames10b – 128 frames 11b – 256 framesD[2:0] Define end page addressSet the value of D[2:0] larger or equal to B[2:0]0 0 0 1 0 1 1 1 12FActivate horizontal scroll Start horizontal scrolling 0 0 0 1 0 1 1 1 02EDeactivate horizontal scrollStop horizontal scrolling0 40-7F 0 1 X 5 X 4 X 3 X 2 X 1 X 0 Set Display Start LineSet display TAM display start line register from 0-63 using X 5X 3X 2X 1X 0.Display start line register is reset to 000000 during POR0 81 1 0 0 0 0 0 0 10 A[7:0] A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 Set Contrast Control Register **Double byte command to select 1 out of 256 contrast steps. Contrast increases as the value increases. (POR = 80h)0 82 1 0 0 0 0 0 1 00 A[7:0] A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0Brightness for color banksDouble byte command to select 1 out of 256brightness steps. Brightness increases as the value increases. (POR = 80h)0 91 1 0 0 1 0 0 01 Set current drive pulse width of Bank 0, Colour A, B and C.0 X[5:0] * * X 5 X 4 X 3 X 2 X 1 X 0 Bank 0: X[5:0] = 0… 63; for pulse width set to 1 ~ 64 clocks (POR = 110001b)0 A[5:0] * * A 5 A 4 A 3 A 2 A 1 A 0 Colour A: A[5:0] same as above (POR = 111111b) 0 B[5:0] * * B 5 B 4 B 3 B 2 B 1 B 0 Colour B: B[5:0] same as above (POR = 111111b) 0 C[5:0] * * C 5 C 4 C 3 C 2 C 1 C 0 Colour C: C[5:0] same as above (POR = 111111b)Set Look Up Table(LUT) for area colourNote: colour D pulse width is fixed at 64 clocks pulse .D/C Hex D7 D6 D5 D4 D3 D2 D1 D0Command Description921110 A[1:0] : 00, 01, 10, or 11 for Colour = A, B, C or D of bank 10 A[7:0] A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0A[3:2] : 00, 01, 10, or 11 for Colour = A, B, C or D of bank 20 B[7:0] B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0 : 0 C[7:0] C 7 C 6 C 5 C 4 C 3 C 2 C 1 C 0 :0 D[7:0] D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 D[7:6]: 00, 01, 10, or 11 for Colour = A, B, C or D of bank 16Set bank colour of forbank 1-16 (Page 0)931 0 0 1 0 0 1 1 A[1:0] : 00, 01, 10, or 11 for Colour = A, B, C or D of bank 170 A[7:0] A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0A[3:2] : 00, 01, 10, or 11 for Colour = A, B, C or D of bank 180 B[7:0] B 7 B 6 B 5 B 4 B 3 B 2 B 1 B 0 : 0 C[7:0] C 7 C 6 C 5 C 4 C 3 C 2 C 1 C 0 :0 D[7:0] D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 D[7:6]: 00, 01, 10, or 11 for Colour = A, B, C or D ofbank 32Set bank colour of forbank 17-32 (Page 1)X 0=0: column address 0 is mapped to SEG0 (POR)0 A0~ A1 1 0 1 0 0 0 0 X 0 Set Segment Re-map **X 0=1: column address 131 is mapped to SEG0X 0=0: normal display (POR) X 0=1: entire display ON 0 A4~A5 1 0 1 0 0 1 0 X 0 Set Entire DisplayON/OFF **X 0=0: normal display (POR) 0 A6~A7 1 0 1 0 0 1 1 X 0 Set Normal/InverseDisplay ** X 0=1: inverse display0 A8 1 0 1 0 1 0 0 0 0 A[5:0] * * A 5 A 4 A 3 A 2 A 1 A 0Set Multiplex Ratio ** The next command, A[5:0] determines multiplex ratio N from 16MUX-64MUX, POR= 64MUX 0 AA 1 0 1 0 1 0 1 0 NOP Reserved, do not use 0AB10 1 0 1 01 1NOPReserved, do not use0 0AD 1 1 0 0 1 0 0 0 1 1 1 0 0 1 1 X 0 Set DC-DC on/offX 0 : 1 DC-DC will be turned on when display on (POR)0 DC-DC is disableX 0=0: turns OFF OLED panel (POR)0 AE~AF 1 0 1 0 1 1 1 X 0 Set Display ON/OFF ** X 0=1: turns ON OLED panel0 B0~BF 1 0 1 1 X 3 X 2 X 1 X 0 Set Page Address ** Set GDDRAM Page Address (0~7) for read/write using X 3X 2X 1X 00 C0/C8 1 1 0 0 X 3 * * * Set COM Output ScanDirection ** X 3=0: normal mode (POR) Scan from COM 0 to COM [N –1]X 3=1: remapped mode. Scan from COM [N-1] to COM0Where N is the Multiplex ratio. 0 D0-D1 1 1 0 1 0 0 0 X 0 ReservedReserved, do not useD/C Hex D7 D6 D5 D4 D3 D2 D1 D0Command Description0 D3 1 1 0 1 0 0 1 1 Set vertical scroll by COM from 0-63.0 A[5:0] * * A 5 A 4 A 3 A 2 A 1 A 0Set Display Offset **The value is reset to 00H after POR.0 D5 1 1 0 1 0 1 0 1 Set Display ClockDivide Ratio/Oscillator Frequency A[3:0] Define the divide ratio of the display clocks (DCLK):0 A[7:0] A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 Divide ratio= A[3:0] + 1, POR is 0000b (divide ratio = 1)A[7:4] Set the Oscillator Frequency. OscillatorFrequency increases with the value of A[7:4] and vice versa. POR is 0111b0 D8 1 1 0 1 1 0 0 0X 5X 4= 00 (POR) : mono mode0 0 0 X 5 X 4 0 X 2 0 X 0Set area colour mode on/off & low powerdisplay modeX 5X 4= 11 Area Colour enableX 2=0 and X 0=0: Normal (POR) power mode X 2=1 and X 0=1: Set low power save modeD911111 Set Pre-charge period** A[3:0] Phase 1 period of up to 15 dclk clocks[POR=2h]; 0 is invalid entry0 A[7:0] A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0A[7:4] Phase 2 period of up to 15 dclk clocks [POR=2h]; 0 is invalid entry0 DA 1 1 0 1 1 0 1 0 X 4=0, Sequential COM pin configuration0 0 0 0 X 4 0 0 1 0 (i.e. COM31, 30, 29….0 ; SEG0-132;COM31,32….62,63) X 4=1(POR), Alternative COM pin configurationSet COM pins hardware configuration(i.e. COM62,60,58,…2,0; SEG0-132; COM1,3,5…61,63)0 DB 1 1 0 1 1 0 1 1 Set VCOM Deselect Level A[6:0] 0000000 low VCOM deselect level (~ 0.43Vref) 0 A[6:0] * A 6 A 5 A 4 A 3 A 2 A 1 A 0 0110101 normal VCOM deselect level (~ 0.77*Vref(POR))1111111 high VCOM deselect level (equal Vref)0 E2 1 1 1 0 0 0 1 0 Reserved Reserved0 E3 1 1 1 0 0 0 1 1 NOP ** Command for No Operation0 F* 1 1 1 1 * * * * Reserved Reserved, do not useNote: Remark “*” stands for “Don’t Care”Table 5 - Read command table(D/C=0, R/W (WR#)=1, E (RD#)=1 for 6800 or E (RD#)=0 for 8080)Bit Pattern Command DescriptionD7D6D5D4D3D2D1D0Status Register Read * D7 : ReserveD6 : “1” for display OFF / “0” for display OND5 : ReserveD4 : ReserveD3 : ReserveD2 : ReserveD1 : ReserveD0 : ReserveNote: Patterns other than that given in Command Table are prohibited to enter to the chip as a command; otherwise, unexpected result will occur.8.1 Data Read / WriteTo read data from the GDDRAM, input HIGH to R/W (WR#) pin and D/C pin for 6800-series parallel mode, LOW to E (RD#) pin and HIGH to D/C# pin for 8080-series parallel mode. No data read is provided in serial mode operation.In normal data read mode, GDDRAM column address pointer will be increased by one automatically after each data read.Also, a dummy read is required before the first data read. See Figure 5 in Functional Block Description.To write data to the GDDRAM, input LOW to R/W (WR#) pin and HIGH to D/C pin for 6800-series parallel mode AND 8080-series parallel mode. For serial interface mode, it is always in write mode. GDDRAM column address pointer will be increased by one automatically after each data write.Table 6 - Address increment table (Automatic)D/C R/W (WR#) Comment Address IncrementCommand NoWrite0 0Status No0 1 ReadData Yes1 0 Write1 1 ReadData Yes*1*1. If read-data command is issued in read-modify-write mode, address increase is not applied.9 COMMAND DESCRIPTIONSSet Lower Column AddressThis command specifies the lower nibble of the 8-bit column address of the display data RAM. The column address will be incremented by each data access after it is pre-set by the MCU.Set Higher Column AddressThis command specifies the higher nibble of the 8-bit column address of the display data RAM. The column address will be incremented by each data access after it is pre-set by the MCU.Activate Horizontal ScrollStart motion of horizontal scrolling. This command should only be issued after Horizontal scroll setup parameters are defined.The following actions are prohibited after the horizontal scroll is activated1. RAM access (Data write or read)2. Changing horizontal scroll setup parametersThe SSD1303 horizontal scroll is designed for 128 columns scrolling only. 4 remaining columns are reserved for computation and should be left open.With column address 0 mapped to SEG0 (Segment remap setting = A0h), the 4 unused columns will be SEG128, SEG129, SEG130, SEG131.With column address 0 mapped to SEG131 (Segment remap setting = A1h), the 4 unused columns will be SEG0, SEG1, SEG2, SEG3.Figure 8 - Horizontal scroll directionREMAP SETTINGS E G 0S E G 1S E G 2S E G 3S E G 4S E G 5…… … S E G 126S E G 127S E G 128S E G 129S E G 130 S E G 131 A0 A B C D E F ! ! ! Y Z Invalid data A1 Invalid dataZY"""FEDCBAScroll directionDeactivate Horizontal ScrollStop motion of horizontal scrolling.Horizontal Scroll SetupThis command consists of 5 consecutive bytes to set up the horizontal scroll parameters. It determined the scrolling start page, end page and the scrolling speed.Before issuing this command, the horizontal scroll must be deactivated (2Eh). Otherwise, ram content may be corrupted.Set Display Start LineThis command is to set Display Start Line register to determine starting address of display RAM to be displayed by selecting a value from 0 to 63. With value equals to 0, D 0 of Page 0 is mapped to COM0. With value equals to 1, D 1 of Page0 is mapped to COM0. The display start line values of 0 to 63 are assigned to Page 0 to 7.Set Contrast Control RegisterThis command is to set Contrast Setting of the display. The chip has 256 contrast steps from 00 to FF. The segment output current increases as the contrast step value increases. See Figure 9.Figure 9 - Segment current vs Contrast settingSegment current vs Contrast setting50100150200250300350000F 1F 2F3F 4F 5F 6F 7F 8F 9F AF BF CF DF EF FFContrast settingCurrent (uA)Set Brightness for Color BanksThis command is to set Brightness Setting of the display for area colors banks (except bank 0). The chip has 256 brightness steps from 00 to FF. The segment output current increases as the brightness step value increases。
ssd 固态硬盘 结构原理
ssd 固态硬盘结构原理Solid state drives (SSDs) are a type of storage device that uses flash memory to store data. They are considered to be faster, more reliable, and more energy-efficient than traditional hard disk drives (HDDs). 固态硬盘(SSD)是一种使用闪存存储数据的存储设备。
相对传统硬盘驱动器(HDD)来说,SSD具有更快、更可靠和更节能的特点。
The structure of an SSD consists of controller, NAND flash memory, and a cache. The controller is the brain of the SSD, responsible for managing data storage and retrieval. NAND flash memory is where the data is actually stored, and the cache is used to temporarily store frequently accessed data for faster retrieval. 固态硬盘的结构由控制器、NAND闪存以及缓存组成。
控制器是SSD的大脑,负责管理数据存储和检索。
NAND闪存是实际存储数据的地方,而缓存用于临时存储频繁访问的数据,以加快检索速度。
One of the key advantages of SSDs is their speed. Because they have no moving parts, SSDs are able to access and retrieve data much faster than HDDs. This makes them ideal for tasks that require quick access to large amounts of data, such as gaming, video editing, andrunning multiple applications simultaneously. 固态硬盘的一个主要优势是速度。
SSD1963中文资料介绍
“set_pll_mn”命令0xe2配置锁相环频率。当配置好锁相环频率和启用的锁相环由 “set_pll”命令0xE0的0位,用 户仍要等待100ms,待锁相环锁定。然后,锁相环准备好了,可以通过“set_pll”命令0xE0的位1,配置为系统时 钟。
1、ssd1963是1215k字节帧缓冲显示控制器,支持864 x 480 x 24位图形内容。它也配有不同宽度并行接口总 线来接收图形数据和命令从单片机。它的显示界面,支持常见的内存更少的LCD驱动器, 每—像素的颜色深度 可达24比特。 2、特点 −建于1215k字节帧缓冲。支持864 x 480到24BPP显示 −支持8位串行RGB接口 −0,90,180的硬件旋转,270度 −硬件显示镜像 −硬件窗口 −可编程的亮度,对比度和饱和度控制 −动态背光控制(DBC)通过脉宽调制信号 单片机的连接 −8 / 9 / 16 / 18 / 24位单片机的接口 −撕裂效应信号 I / O的连接 4个GPIO引脚− 内置时钟发生器 深睡眠
3、订购须知,
4、结构图
5、引脚排列 5.1 80 balls TFBGA
5.2 pins LQFP
6、引脚描述
关键: O =输出 IO =双向(输入/输出) P =电源引脚 Hi - Z =高阻抗
注 (1)这些引脚映射使用信号名称通常用于每个面板类型,但是信号名称在各个面板制造商之间可能不同。
在ssd1963中,用户可配置的TE信号反映垂直非显示期或反映垂直和水平的非显示期。额外水平非显示期 的信息,单片机可以计算水平线的液晶显示器扫描更准确地控制刷新动作。通常,一个快速的单片机不需要水 平非显示周期。但缓慢的MCU将需要它确保帧缓存更新过程总是滞后于液晶显示控制器。
机械硬盘内部硬件结构和工作原理详解
一般硬盘正面贴有产品标签,主要包括厂家信息和产品信息,如商标、型号、序列号、生产日期、容量、参数和主从设置方法等。
这些信息是正确使用硬盘的基本依据,下面将逐步介绍它们的含义。
硬盘主要由盘体、控制电路板和接口部件等组成,如图1-1所示。
盘体是一个密封的腔体。
硬盘的内部结构通常是指盘体的内部结构;控制电路板上主要有硬盘BIOS、硬盘缓存(即CACHE)和主控制芯片等单元,如图1-2所示;硬盘接口包括电源插座、数据接口和主、从跳线,如图1-3所示。
图1-1 硬盘的外观图1-2 控制电路板图1-3 硬盘接口电源插座连接电源,为硬盘工作提供电力保证。
数据接口是硬盘与主板、内存之间进行数据交换的通道,使用一根40针40线(早期)或40针80线(当前)的IDE接口电缆进行连接。
新增加的40线是信号屏蔽线,用于屏蔽高速高频数据传输过程中的串扰。
中间的主、从盘跳线插座,用以设置主、从硬盘,即设置硬盘驱动器的访问顺序。
其设置方法一般标注在盘体外的标签上,也有一些标注在接口处,早期的硬盘还可能印在电路板上。
此外,在硬盘表面有一个透气孔(见图1-1),它的作用是使硬盘内部气压与外部大气压保持一致。
由于盘体是密封的,所以,这个透气孔不直接和内部相通,而是经由一个高效过滤器和盘体相通,用以保证盘体内部的洁净无尘,使用中注意不要将它盖住。
1.2 硬盘的内部结构硬盘的内部结构通常专指盘体的内部结构。
盘体是一个密封的腔体,里面密封着磁头、盘片(磁片、碟片)等部件,如图1-4所示。
图1-4 硬盘内部结构硬盘的盘片是硬质磁性合金盘片,片厚一般在0.5mm左右,直径主要有1.8in(1in=25.4mm)、2.5in、3.5in和5.25in 4种,其中2.5in和3.5in盘片应用最广。
盘片的转速与盘片大小有关,考虑到惯性及盘片的稳定性,盘片越大转速越低。
一般来讲,2.5in硬盘的转速在5 400r/min~7 200 r/ min之间;3.5in硬盘的转速在4 500 r/min~5 400 r/min之间;而5.25in硬盘转速则在3 600 r/min~4 500 r/min之间。