• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: APP009开发板的CAN模块和上位机(PCI9810CAN通讯卡,CAN控制器为SJA1000)通信失败?
#5
新會員
新會員


查看用戶資訊
8倍频改为16倍频,就是125kbps。可是我的依然不能通信,我怀疑是不是物理层的不兼容啊?上位机的CAN控制器是SJA1000,而下位机是微芯的嵌入CAN控制器,等高人指点----

發表於: 2009/3/27 19:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: APP009开发板的CAN模块和上位机(PCI9810CAN通讯卡,CAN控制器为SJA1000)通信失败?
#4
版主
版主


查看用戶資訊
如果是只有一半的話,那就是Oscillation 的選項設錯了,改一下吧!

發表於: 2009/3/26 13:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: APP009开发板的CAN模块和上位机(PCI9810CAN通讯卡,CAN控制器为SJA1000)通信失败?
#3
新會員
新會員


查看用戶資訊
谢谢你版主,你给的这个例程,我调试过了,能够通过,不过波特率用示波器看和计算好象不是125Kbps,而是125Kbps的一半吧?參照:

Ryang 寫道:
程式單是用看的不容易看不出問題所在,這個 Code Example 是經過測試過的試試看。

http://www.microchip.com.tw/modules/w ... glefile.php?cid=12&lid=73

發表於: 2009/3/25 20:40
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: APP009开发板的CAN模块和上位机(PCI9810CAN通讯卡,CAN控制器为SJA1000)通信失败?
#2
版主
版主


查看用戶資訊
程式單是用看的不容易看不出問題所在,這個 Code Example 是經過測試過的試試看。

http://www.microchip.com.tw/modules/w ... glefile.php?cid=12&lid=73

發表於: 2009/3/25 17:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


APP009开发板的CAN模块和上位机(PCI9810CAN通讯卡,CAN控制器为SJA1000)通信失败?
#1
新會員
新會員


查看用戶資訊
我用的开发板:APP009-dsPIC40-28 20050110。我用这个开发板和周立功的PCI-9810做CAN通信实验,上位机用周立功自带的ZLGCANTest调试软件,下位机用的这个开发板,程序如下(就是一直接收波特率配置为125KBPS):
#include <p30f4011.h>
int failmemory[40];
//---------------------------------------------------------------------------
_FOSC(CSW_FSCM_OFF & XT_PLL16); //XT with 16xPLL oscillator, Failsafe clock off
_FWDT(WDT_OFF); //Watchdog timer disabled
_FBORPOR(PBOR_OFF & MCLR_EN); //Brown-out reset disabled, MCLR reset enabled
_FGS(CODE_PROT_OFF); //Code protect disabled

// ----------------------------------------------------------------------------
#define FCY 29491200 // Osc. configuration = XT, PLL * 16 and XT = 7.3728 Mhz

unsigned int buffer1;
unsigned int buffer2;
unsigned int buffer3;
unsigned int buffer4;
unsigned long int i = 0;
void initial1()
{
C1CTRLbits.REQOP = 0x4; //请求进入配置模式
while (C1CTRLbits.OPMODE!=0x4){} //确认进入配置模式
C1TX0CON = 0x0003; //发送0邮箱配置,高优先级
C1TX0SID = 0x0020; //发送0标准标识符,11位,标准标识符0000 0001 000,报文发送标准标识符
C1TX0DLC = 0x01c0; //发送0数据长度,8字节
C1RX0CON = 0x0000; //接收0邮箱配置
C1RX0DLC = 0x0008; //接收0数据长度,8字节
C1RXF0SID = 0x0020; //接收滤波器0标准标识符,11位,接收代码位0000 0001 000
C1RXM0SID = 0x0001; //接收屏蔽0标准标识符,屏蔽码0000 0000 000
C1CTRLbits.CANCKS=1; //FCAN时钟为FCY
C1CFG1 = 0x0088; //波特率为125kbps配置
SJW<1:0>=3Tq,BRP<5:0>=001000
C1CFG2 = ox03e9;
//SEG2PH<2:0>=4Tq,SEG1PH<2:0>=6Tq,PRSEG<2:0>=2Tq,采样3次
C1CTRLbits.REQOP = 0x0; //请求进入正常模式
while (C1CTRLbits.OPMODE!=0x0){} //确认进入正常模式
return;
}
int main()
{
INTCON1=0x0000;
INTCON2=0x0000; //关闭所有中断
initial1();
while(1)
{
if(C1RX0CONbits.RXFUL==1)
{
buffer1=C1RX0B1;
buffer2=C1RX0B2;
buffer3=C1RX0B3;
buffer4=C1RX0B4;
C1RX0CONbits.RXFUL=0;
for(i=0;i<300000;i++){}
}
}
}

为什么上位机一直提示发送失败呢?请高手赐教,不胜感激!

發表於: 2009/3/24 14:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------