摘 要:本次设计是以STC89C51单片机为核心,选用PCF8591为数模转换芯片,并辅以必要的模拟电路,设计出了一个基于STC89C51单片机的函数信号发生器。其设计内容主要包括单片机最小系统的设计、D/A转换模块的设计、键盘控制模块的设计及LCD12864显示模块的设计。其中将所有的程序存储在51单片机的程序存储器(ROM)中;D / A通过将字节发送到PCF8591设备存储在DAC数据存储器中,再转换为相应的模拟电压;键盘控制模块采用6个按键来选择波形类型及调节频率的大小;显示模块则采用LCD12864来显示波形类型、频率,在从机选择线CS为低电平,时钟线SCK为上升沿的时候,使用串行SPI接口对控制器写入控制指令及指令的数据,对模组进行显示的控制操作;最终将设计好的函数发生器的输出接上示波器,通过按键调用不同的程序,在示波器上显示实际输出的波形。
本设计最终能达到预期的效果,即在LCD12864上显示波形类型及波形的频率,并且可以通过示波器来观察其输出的波形及其波形的频率。
关键词:51单片机; 函数信号; 发生器
Abstract:The design is based on the SCM STC89C51, and chooses PCF8591 for analog-to-digital conversion chip.It is supported by the necessary analog circuit.And it designs function signal generator which is based on SCM STC89C51.Its design content mainly includes the smallest single-chip system design, the design of D/A conversion module, and the design of keyboard control module and LCD12864 display module .In which all programs will be stored in 51 SCM program memory (ROM); The byte which is stored in the DAC data memory is sent to the PCF8591equipment , and then is converted to corresponding analog voltage;Keyboard control module uses 6 buttons to select the type of waveform and the size of frequency regulation;The display module displays the type of waveform and the frequency of it by LCD12864,when the slave select line CS is low and SCK for the rising edge of the clock line, using the serial SPI interface on the controller to write control instructions and the data of directives in order to display control operation for module.Eventually the output of function generator is connected with the oscilloscope, through the button to invoke different procedures, the oscilloscope will display actual output waveform.
The design will achieve the desired results which can be achieved the type of signal wave and the frequency of it on LCD12864, and may observe the output waveform and the frequency of the waveform by oscilloscope.
Key words:51 SCM ; Function signal; Generator