完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我正试图配置发送模块的DSPIC33 EV32 GM00 2微控制器。我已经尝试将它们配置为发射机和接收机。我无法得到输出。我写的代码如下。在这两种情况下,时钟频率fCy=22.1184MHz和嘀嗒周期tiCKK=3US。1。接收器配置无效InitSENT(void){RPINR44bits.SEINR44bits.SENT11000000000000000000000000000000000000000000000000000000000000000000SENT1CON1比特;SENT1CON1CON1CON1比特.NIBCNBCNT=1;SENT1CON1CON1比特.SENT1CON1CON1比特.NIBCNT=0b110;SENT1CON1CON1比特.NIBCNT 1比特.NIBCNT=0b110;SENT1CON1CON1CON1比特1比特.NIBCNT1NBCNT=0b110;SENT1CON1CON1CON1CON1比特.NIBCNT;SENT1CON1D8bits.SENT1MD=0;IFS11bI.SENT1IF=0;IPC45bit.SENT1IP=0b11;IEC11bit.SENT1IE=1;Delayus(20);SENT1CON1bit.SNTEN=1;Delayus(20);.;}2。发送Modevoid InitSENT(void){RPOR1bits.RP36R=0b111001;TRISB比特.TRISB4=0;TRISB比特.TRISB4=0;SENT1CON11CON1比特.RCVEN=0;SENT1CON1CON1CON1比特.SENT1CON1CON1比特.卷=0;SENT1CON1CON1比特.RCVENT1CON1比特.RCVE=0;SENT1CON1CON1比特.RCVENT1CON1比特.SNTSIDL=0;SENT1CON1CON1比特.SNSNTSIDL=0;TXM=0;TXM=0;0;0;0;0;0;0;0;0;0;0;0;0 CON2=0x0041;SENT1CON3=0x0258;//PMD8BITS,Stord1MD=0;IFS11BITSUNIF=0;IPC45 BITS.SUN1IP= 0B11;IEC11BITSUNIIE=1;Stord1DATL= 0x4FFF;Stord1DaTe= 0x0FF0;Delayus(20);Sun1CON1BITS.SNTEN=1;DelayUS(20);返回;}请帮助我,如果有什么事情要改变的话。
以上来自于百度翻译 以下为原文 Hi, I am trying to configure the SENT module of the dsPIC33EV32GM002 microcontroller. I have tried to configure them as both transmitter and receiver . I am unable to get the output . The codes I have written are below. In both cases Clock frequency FCY = 22.1184MHz and Tick period TTICK = 3us. 1. Receiver configuration void InitSENT(void) { RPINR44bits.SENT1R = 0b0010000; SENT1CON1bits.RCVEN = 1; SENT1CON1bits.NIBCNT = 0b110; SENT1CON1bits.CRCEN = 0; SENT1CON1bits.PPP = 1; SENT1CON1bits.PS = 0; SENT1CON1bits.SNTSIDL = 0; SENT1CON2 = 0x0FDD; SENT1CON3 = 0x0A93; //PMD8bits.SENT1MD = 0; IFS11bits.SENT1IF = 0; IPC45bits.SENT1IP = 0b11; IEC11bits.SENT1IE = 1; Delayus(20); SENT1CON1bits.SNTEN = 1; Delayus(20); return; } 2. Transmit Mode void InitSENT(void) { RPOR1bits.RP36R = 0b111001; TRISBbits.TRISB4 = 0; SENT1CON1bits.RCVEN = 0; SENT1CON1bits.TXM = 0; SENT1CON1bits.NIBCNT = 0b110; SENT1CON1bits.CRCEN = 1; SENT1CON1bits.PPP = 1; //SENT1CON1bits.PS = 0; //SENT1CON1bits.SNTSIDL = 0; SENT1CON2 = 0x0041; SENT1CON3 = 0x0258; //PMD8bits.SENT1MD = 0; IFS11bits.SENT1IF = 0; IPC45bits.SENT1IP = 0b11; IEC11bits.SENT1IE = 1; SENT1DATL = 0x4FFF; SENT1DATH = 0x0FF0; Delayus(20); SENT1CON1bits.SNTEN = 1; Delayus(20); return; } Please help me if is there any thing to change. |
|
相关推荐
1个回答
|
|
作为参考,正确使用DSSP33 EV CAN-LIN启动工具包和/或参考手册中的代码。
以上来自于百度翻译 以下为原文 Hi. As a reference, use exactly the code from the dsPIC33EV CAN-LIN starter kit and/or the one in the reference manual. Working like a charm here |
|
|
|
只有小组成员才能发言,加入小组>>
5237 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
671浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 00:12 , Processed in 1.398348 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号