完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我的设计是把SCI口上的发送的数据在串口调试助手上显示一下,简单的显示一个数字就好,用的是SCI-A口和MAX232相连接现在程序贴出来,请各位指教下有什么错误,好改正,现在不知道错在哪里?谢谢啦
#include "DSP28_Device.h" Uint16 RecieveChar; // Global counts used in this example Uint16 LoopCount; Uint16 ErrorCount; void Scia_init() { EALLOW; GpioMuxRegs.GPFMUX.all = 0x0030;// 设置F4和F5为通信端口 EDIS; SciaRegs.SCICCR.all = 0x07; // 禁止接收和发送中断 SciaRegs.SCICTL1.all= 0x03; //enable TX ScibRegs.SCICTL2.all = 0x03; // SciaRegs.SCIHBAUD =0x0000; SciaRegs.SCILBAUD =0x000F; SciaRegs.SCIFFTX.all=0xC028; SciaRegs.SCIFFRX.all=0x0028; SciaRegs.SCIFFCT.all=0x00; // SciaRegs.SCICTL2.bit.RXBKINTENA =1; ScibRegs.SCICTL1.all = 0x23;// Relinquish SCI from Reset } // Transmit a character from the SCI void scia_xmit(int a) { SciaRegs.SCITXBUF=a; } void error(int ErrorFlag) { ErrorCount++; // asm(" ESTOP0"); // Uncomment to stop the test here // for (;;); } void main() { Uint16 SendChar; InitSysCtrl(); InitSciGpio(); // Step 3. Clear all interrupts and initialize PIE vector table: // Disable CPU interrupts DINT; IER = 0x0000; IFR = 0x0000; // Initialize PIE control registers to their default state. // The default state is all PIE interrupts disabled and flags // are cleared. // This function is found in the DSP2833x_PieCtrl.c file. InitPieCtrl(); // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // This will populate the entire table, even if the interrupt // is not used in this example. This is useful for debug purposes. // The shell ISR routines are found in DSP2833x_DefaultIsr.c. // This function is found in DSP2833x_PieVect.c. InitPieVectTable(); for(;;) { scia_xmit(SendChar); while(SciaRegs.SCIFFRX.bit.RXFIFST !=1) { } // wait for XRDY =1 for empty state // Check received character ReceivedChar = SciaRegs.SCIRXBUF.all; if(ReceivedChar != SendChar) error(1); // Move to the next character and repeat the test SendChar++; // Limit the character to 8-bits SendChar &= 0x00FF; LoopCount++; } } |
|
相关推荐 |
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
嵌入式DSP教学实验箱操作教程:2-20 数模转换实验(模拟SPI总线输出电压值)
628 浏览 0 评论
目前在2837x系列用的最多的、性能最好、性价比最高的是哪一款?
403 浏览 0 评论
国产嵌入式DSP教学实验箱_操作教程:22-AD采集DA输出实验(采集输出正弦波)
1596 浏览 0 评论
2336 浏览 0 评论
使用CCS6.0尝试给TMS320VC5502进行配置的时候找不到对应芯片的选项,该怎么麽办呀?
2286 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-28 21:28 , Processed in 0.384196 second(s), Total 68, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号