stm8

STM8驱动LCD段码屏

两盒软妹~` 提交于 2020-03-10 00:12:40
在工作中遇到用stm8驱动LCD段码屏,发现很有意思,特在此记录下来。整个说明过程由液晶屏显示原理,驱动断码LCD液晶屏的方式,stm8驱动断码屏三块进行说明。 一、液晶屏显示原理 液晶是一种介于固态和液态中间的物质。通电时,液晶分子的排列变得有序,使光线容易通过;不通电时排列混乱,阻止光线通过。通过此原理制作成液晶显示器。 液晶显示器(LCD/Liquid Crystal Display)的显像原理,是将液晶置于两片导电玻璃之间,靠两个电极间电场的驱动,引起液晶分子扭曲向列的电场效应,以控制光源透射或遮蔽功能,在电源关开之间产生明暗变化,从而将影像显示出来。若加上彩色滤光片,则可显示彩色影像。在两片玻璃基板上装有配向膜,所以液晶会沿着沟槽配向,由于玻璃基板配向膜沟槽偏离90度,所以液晶分子成为扭转型,当玻璃基板没有加入电场时,光线透过偏光板跟着液晶做90度扭转,通过下方偏光板,液晶面板显示白色(如图1左);当玻璃基板加入电场时,液晶分子产生配列变化,光线通过液晶分子空隙维持原方向,被下方偏光板遮蔽,光线被吸收无法透出,液晶面板显示黑色(如图1右))。液晶显示器便是根据此电压有无,使面板达到显示效果。(网上盗用,感谢,原文地址 http://www.520101.com/html/base/1202066690.html ) 图1 液晶屏一般有这几个参数:可视角度、亮度和对比度

Programing STM32 like STM8(register level GPIO )

爱⌒轻易说出口 提交于 2019-12-21 06:26:01
问题 I programmed STM8 GPIO like PD_ODR_ODR4 = 1; but stm32f10x.h doesn't have this function.Is there any .h file that has definition for bits. Sorry but I don't know how to explain this problem better. I tried multiple GPIO libraries. strong text 回答1: You mention stm32f10x.h in the question, so I'm assuming it's about the STM32F1 series of controllers. Other series have some differences, but the general procedure is the same. GPIO pins are arranged in banks of 16 called ports, each having it's

Programing STM32 like STM8(register level GPIO )

隐身守侯 提交于 2019-12-21 06:25:20
问题 I programmed STM8 GPIO like PD_ODR_ODR4 = 1; but stm32f10x.h doesn't have this function.Is there any .h file that has definition for bits. Sorry but I don't know how to explain this problem better. I tried multiple GPIO libraries. strong text 回答1: You mention stm32f10x.h in the question, so I'm assuming it's about the STM32F1 series of controllers. Other series have some differences, but the general procedure is the same. GPIO pins are arranged in banks of 16 called ports, each having it's

Programing STM32 like STM8(register level GPIO )

情到浓时终转凉″ 提交于 2019-12-03 20:29:54
I programmed STM8 GPIO like PD_ODR_ODR4 = 1; but stm32f10x.h doesn't have this function.Is there any .h file that has definition for bits. Sorry but I don't know how to explain this problem better. I tried multiple GPIO libraries. strong text You mention stm32f10x.h in the question, so I'm assuming it's about the STM32F1 series of controllers. Other series have some differences, but the general procedure is the same. GPIO pins are arranged in banks of 16 called ports, each having it's own set of control registers, named GPIOA , GPIOB , etc. They are defined as pointers to GPIO_TypeDef

SWIM接口及STM8烧录过程

匿名 (未验证) 提交于 2019-12-03 00:41:02
1. 硬件连接 SWIM接口只需要一根传输线,即可完成双向的传输。传输过程,都是由主控制端(host)发起,设备端然后做出反应。host端需要在一个总线上实现读和写,那就是说必须要同时接一个输出IO和一个输入IO(不建议用同一个切换,太慢),且输出IO必须设计成开漏,总线上挂接上拉电阻,以便随时交出控制权。硬件连接如下: 上图SWIM_IN为输入IO,SWIM为输出IO。 2. 编码格式 SWIM协议使用归零码,且支持两种速率。 高速模式 低速模式 这两种模式都是使用8M的clock同步(上图中的箭头)。高速模式下,2个低电平加8个高电平表示1;8个低电平加2个高电平表示0。低速模式下,2个低电平加20个高电平表示1;20个低电平加2个高电平表示0。 程序的第一步就是要实现这两种速率的编码输出。通常情况下,使用IO口加延时即可达到目的。只不过,延时时间需要使用示波器观测,然后多次调节才能比较准。另外,在翻转IO的过程中,注意要关掉所有中断,避免被打断。 3. 通讯协议 上图为host到设备端的通讯过程,主要由命令和数据组成。命令占6个bit,数据占11个bit。 - Command。黑体部分为Command,由5个bit组成。第一个bit固定为0,称之为header,b0~b2为预定义的命令。pb为b0~b2异或之后的值,ack为设备返回的电平。下图为预定义的三种命令: -