Welcome![Sign In][Sign Up]
Location:
Search - picc18 8.

Search list

[Othercanf18xx8.h

Description: 、 先在microchip网站上找到00738.zip,这个包中有 can18xx8.h,can18xx8.c,将其复制到一个你要编写程度的子目录中,例如C:\testcan下,这个时候这个东东是不能直接用的。 2、 下载一个MPLAB 7.10,直接安装(要求直接下载) 3、 再下载一个PICC18 (HI-TECH的),要正版哦(支持正版,买不起的想其它办法吧) 4、在你的头文件上写上如下的样式: #include "stdio.h" #include "can18xx8.h" #include "pic18fxx8.h"//可能是“pic.h”不太好包含,因此常会报错,直接包含克服之 5、然后设置好PICC和MPLAB,如果MPLAB上没有PICC18,则到PICC的网上下一个安装软件,可以直接运行安装就有了。 6、按照工程的基本要求把你的源代码、添加上两个库(不加也可以) 然后就可以写如下代码了:下面是一个完整版,可以直接使用microchip的库函数,本程序只是仿真调试过,未在多个芯片通信过,仍在制作中。 #include "stdio.h" #include "can18xx8.h" #include "pic18fxx8.h" unsigned long NewMessage; BYTE NewMessageData[8]; BYTE MessageData[8]; BYTE NewMessageLen; enum CAN_RX_MSG_FLAGS NewMessageFlags=1; BYTE RxFilterMatch; void main() { //int a; //int b; CANInitialize(1, 5, 7, 6, 2, CAN_CONFIG_VALID_XTD_MSG); while(1) { // Application specific logic here // Check for CAN message if ( CANIsRxReady() ) { CANReceiveMessage(&NewMessage,NewMessageData,&NewMessageLen,&NewMessageFlags); if ( NewMessageFlags & CAN_RX_OVERFLOW ) { // Rx overflow occurred; handle it } if ( NewMessageFlags & CAN_RX_INVALID_MSG ) { // Invalid message received; handle it } if ( NewMessageFlags & CAN_RX_XTD_FRAME ) { // Extended Identifier received; handle it } else { // Standard Identifier received. } if ( NewMessageFlags & CAN_RX_RTR_FRAME ) { // RTR frame received } else { // Regular frame received. } // Extract receiver filter match, if it is to be used RxFilterMatch = NewMessageFlags & CAN_RX_FILTER_BITS; } // Process received message // Transmit a message due to previously received message or // due to application logic itself. if ( CANIsTxReady() ) { MessageData[0] = 0x01; CANSendMessage( 0x02,MessageData,1,CAN_TX_PRIORITY_0 &CAN_TX_STD_FRAME & CAN_TX_NO_RTR_FRAME); } // Other application specific logic } // Do this forever // End of program } 以上均是参考文档并进行了修正,由于中间总是报错,为了大家让CAN更容易,谢谢大家!
Platform: | Size: 10682 | Author: lovelzs2008@126.com | Hits:

[SCMpicc18v835pl35

Description: picc_18v 8.35pl35 PIC18系列单片机开发C编译器,去除限制。-picc_18v 8.35pl35 PIC18 MCU Development Series C compiler to remove restrictions.
Platform: | Size: 4085760 | Author: 亚克 | Hits:

[ELanguagePICC18-8.35

Description: PICC-8.35破解版,绝对好用,本人一直用它-PICC-8.35 crack version, absolutely easy to use, I have been using it
Platform: | Size: 6441984 | Author: 陈培国 | Hits:

[ELanguagePICC18

Description: HI-TECH PICC18编译器,但是我的注册码生成器不好用了-HI-TECH PICC18 compiler, but I am not the key generator with the
Platform: | Size: 6329344 | Author: nene | Hits:

[Other Embeded programnokialcdlib

Description: Nokia 6120 LCD lib for HITECH PICC18 Compiler V 8.35PL2
Platform: | Size: 4096 | Author: Micrax | Hits:

[SCMPICC18-8.35

Description: PICC18-8.35 PICC18-8.35.rar-PICC18-8.35.rar PICC18-8.35.rar
Platform: | Size: 6441984 | Author: 浙江省 | Hits:

[SCMAd2Uart

Description: PIC16F77 AD转换 Hi-TECE PICC18 8.01-PIC16F77 AD conver Hi-TECE PICC18 8.01
Platform: | Size: 2048 | Author: 刘春祥 | Hits:

[Embeded-SCM Developnokialcdlib

Description: Nokia 6120 LCD lib for HITECH PICC18 Compiler V 8.35PL2
Platform: | Size: 4096 | Author: 王小京 | Hits:

CodeBus www.codebus.net