资源简介

利用MSP430单片机设计的信号发生器,能够发出三角波,正弦波以及方波等等。包含四大项,有源代码、proteus仿真以及Altium desiger设计的原理图以及PCB图,还有设计报告。是课程设计的时候自己做的。

资源截图

代码片段和文件信息

#include
#include“lcd.h“
#include“ad.h“
#include“xinhaobiao.h“
#define uchar unsigned char
#define uint unsigned int
#define A 3
uchar table90[]={“正弦波“};
uchar const table2[]={“幅度:“};
uchar const table3[]={“频率:“};
uchar const table4[]={“波形三角波“};
uchar const table5[]={“波形正弦波“};
uchar const table6[]={“波形锯齿波“};
uchar const table7[]={“波形三角波“};
uchar const table8[]={“简易信号发生器“};
uchar const table9[]={“欢迎使用!“};
uchar const table10[]={“ A正弦波 B三角波“};
uchar const table11[]={“ C锯齿波“};
//const uchar table[]=“0123456789“;
uchar table1[]={012345678910111213141516171819202122232425
26272829393132333435363738394041424344454647484950515253
54555657585960616263646566676869707172737475767778798081
828384858687888990919293949596979899100};
uchar atempflagRise=1start=0baishigetempx;
uint Mibflag1;
int Count=0x=0;
void Sys_clock_init(void)
{
  DCOCTL = 0x60;//DC0=3 
  BCSCTL1= 0x8F;//0X88-RSEL=8 DCOCLK=1.6MHz  0X8F-RSEL=15 DCOCLK=15.25MHz
  for(unsigned int i=0;i<65535;i++);//延时,使系统时钟稳定
}
void TA_init(void)
{
 TACTL|=TASSEL_2+MC_1;//TA时钟源选择SMCLK,增计数模式
 TACCTL1=OUTMOD_7;//模式7,PWM输出模式
 TACCR0=255;
 TACCTL0|=CCIE;//打开中断
 _EINT();
}
void scanf(void)
{
  if((P1IN&0X38)!=0X38)
  {
    __delay_cycles(300000);
    if((P1IN&0X38)!=0X38)
    {
      temp=P1IN&0x38;
      while((P1IN&0X38)!=0X38);
      switch(temp)
      {
        case 0x30:flag++;
                  x=0;
                  start=0;
                  wr_com(0x01);
                  if(flag==1)
                  {  
                    TA_init(); 
                  }
                  if((flag==2)||(flag==3))
                  {
                  CCR0=3844;
                  CCR1=0; 
                  }
                  if(flag==4)
                  {  
                    TACTL=MC_0;
                    flag=0;
                  }
                  break;
        case 0x28: if(flag!=0)
                      x++; 
                   if(x>=100)
                   x=0;
                   break;
        case 0x18: if(flag!=0)
                      x+=10; 
                   if(x>=100)
                   x=0;
                   break;           
      } 
      temp=0;
    }
  }
}      
void anjian_init(void)
{
    P1DIR|=BIT3+BIT4+BIT5;
    P1OUT|=BIT3+BIT4+BIT5;
    P1REN|=BIT3+BIT4+BIT5;
    P1DIR&=~BIT3+~BIT4+~BIT5;  
}
void zhuyemian(void)
{
  if(start==0)
  {
      wr_com(0x80);
     for(a=0;a<14;a++)
        {
            wr_data(table8[a]);
        }
      wr_com(0x92);
      for(a=0;a<9;a++)
        {
            wr_data(table9[a]);
        }
      Delayms_16M(5000);
      wr_com(0x01);
      wr_com(0x80);
     for(a=0;a<18;a++)
        {
            wr_data(table10[a]);
        }
      wr_com(0x92);
      for(a=0;a<9;a++)
        {
            wr_data(table11[a]);
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        157  2012-07-18 14:49  MSP430\Production\Code\Frequency_Meter\4555.eww

     文件        568  2013-06-26 18:45  MSP430\Production\Code\Frequency_Meter\ad.h

     文件      27726  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\Debug\Exe\sin.d43

     文件       8996  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\Debug\Exe\sin.hex

     文件        499  2013-06-26 18:47  MSP430\Production\Code\Frequency_Meter\Debug\Obj\555555.pbi

     文件      84650  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\Debug\Obj\main.r43

     文件       5073  2013-06-20 21:02  MSP430\Production\Code\Frequency_Meter\Debug\Obj\msp430g2xx3_1_vlo.r43

     文件        142  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\Debug\Obj\sin.pbd

     文件        379  2013-06-21 10:38  MSP430\Production\Code\Frequency_Meter\dianzhen.h

     文件       4579  2013-06-21 10:54  MSP430\Production\Code\Frequency_Meter\lcd.h

     文件       6735  2013-06-27 19:58  MSP430\Production\Code\Frequency_Meter\main.c

     文件          0  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\path.txt

     文件       6462  2013-06-26 11:26  MSP430\Production\Code\Frequency_Meter\settings\444444.c

     文件       3032  2020-01-04 14:28  MSP430\Production\Code\Frequency_Meter\settings\4555.wsdt

     文件       6593  2013-06-26 15:21  MSP430\Production\Code\Frequency_Meter\settings\main.c

     文件       3421  2013-06-21 10:29  MSP430\Production\Code\Frequency_Meter\settings\sdd.wsdt

     文件       1253  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\settings\sin.cspy.bat

     文件       4412  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\settings\sin.dbgdt

     文件       1252  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\settings\sin.dni

     文件       4337  2013-06-28 16:41  MSP430\Production\Code\Frequency_Meter\sin.dep

     文件      20124  2012-08-17 19:45  MSP430\Production\Code\Frequency_Meter\sin.ewd

     文件      50438  2013-06-26 18:52  MSP430\Production\Code\Frequency_Meter\sin.ewp

     文件       7671  2013-06-25 17:19  MSP430\Production\Code\Frequency_Meter\xinhaobiao.h

     文件      57344  2013-06-26 08:24  MSP430\Production\Code\基于MSP430G2553的函数信号发生器源程序.doc

     文件     297472  2013-06-28 09:59  MSP430\Production\Paper\PWM波形生成原理.doc

     文件    1277952  2013-06-25 22:01  MSP430\Production\Paper\基于MSP430实现的简易信号发生器报告.doc

     文件     106630  2020-01-03 18:02  MSP430\Production\Proteus\Last Loaded 波形发生器.DBK

     文件     106630  2020-01-03 18:02  MSP430\Production\Proteus\波形发生器.DSN

     文件       1064  2020-01-04 14:03  MSP430\Production\Proteus\波形发生器.PWI

     文件     122368  2020-01-03 09:51  MSP430\Production\Schematic\AD转换器件.SchLib

............此处省略49个文件信息

评论

共有 条评论