串行外设接口模块(SPI).docVIP

  • 2
  • 0
  • 约2.06千字
  • 约 3页
  • 2018-06-01 发布于河南
  • 举报
串行外设接口模块(SPI)

第9章 串行外设接口模块(SPI) 9.4.2 软件设计 2 MAX5121与DSP的SPI软件实现 源程序代码: (1)所需的复位和中断向量定义文件“vectors.asm” // 该文件利用汇编语言代码定义了复位和中断向量 .title vectors.asm .ref _c_int0,_nothing .sect .vectors reset: b _c_int0 int1: b _nothing int2: b _nothing int3: b _nothing int4: b _nothing int5: b _nothing int6: b _nothing (2)主程序 //该程序利用LF2407的SPI模块向MAX5121芯片发送数据用于D/A转换,MAX5121的模拟输出端输出一个三角波 //用C语言编写 #include register.h int GPR3; int flag1; int flag; initial() { asm( setc INTM); //屏蔽中断 WSGR=0X00; //禁止所有的等待状态 asm( CLRC SXM); asm( CLRC OVM); asm( CLRC CNF);//B0被配置为数据空间

文档评论(0)

1亿VIP精品文档

相关文档