AVR单片机实现了232到CAN转换
#include
#defineuchar unsigned char
#define uint unsigned int
#pragma interrupt_handler INT1_17:3 //定义INT1的中断服务程序
#pragma interrupt_handler Timer0:10 //定义定时计数器0的中断服务程序
#pragma interrupt_handler Usart_receive:12 //定义接收中断服务程序
#define fosc 7372800 //晶振7.3728MHZ
#define CANSTAT
#define CANCTRL
#define BFPCTRL
#define TEC
#define REC
#define CNF3
#define CNF2
#define CNF1
#define CANINTE
#define CANINTF
#define EFLG
#define TXRTSCTRL
#define RXF0SIDH
#define RXF0SIDL
#define RXF0EID8
#define RXF0EID0
#define RXF1SIDH
#define RXF1SIDL
#define RXF1EID8
#define RXF1EID0
#define RXF2SIDH
#define RXF2SIDL
#define RXF2EID8
#define RXF2EID0
#define RXF3SIDH
#define RXF3SIDL
#define RXF3EID8
#define RXF3EID0
#define RXF4SIDH
#define RXF4SIDL
#define RXF4EID8
#define RXF4EID0
#define RXF5SIDH
#define RXF5SIDL
#define RXF5EID8
#define RXF5EID0
#define RXM0SIDH
#define RXM0SIDL
#define RXM0EID8
#define RXM0EID0
#define RXM1SIDH
#define RXM1SIDL
#define RXM1EID8
#define RXM1EID0
#define TXB0CTRL
#define TXB0SIDH
#define TXB0SIDL
#define TXB0EID8
#define TXB0EID0
#define TXB0DLC
#define TXB0D0
#define TXB0D1
#define TXB0D2
#define TXB0D3
#define TXB0D4
#define TXB0D5
#define TXB0D6
#define TXB0D7
#define TXB1CTRL
#define TXB1SIDH
#define TXB1SIDL
#define TXB1EID8
#define TXB1EID0
#define TXB1DLC
#define TXB1D0
#define TXB1D1
#define TXB1D2
#define TXB1D3
#define TXB1D4
#define TXB1D5
#define TXB1D6
#define TXB1D7
#define TXB2CTRL
#define TXB2SIDH
#define TXB2SIDL
#define TXB2EID8
#define TXB2EID0
#define TXB2DLC
#define TXB2D0
#define TXB2D1
#define TXB2D2
#define TXB2D3
#define TXB2D4
#define TXB2D5
#define TXB2D6
#define TXB2D7
#define RXB0CTRL
#define RXB0SIDH
#define RXB0SIDL
#define RXB0EID8
#define RXB0EID0
#define RXB0DLC
#define RXB0D0
#define RXB0D1
#define RXB0D2
#define RXB0D3
#define RXB0D4
#define RXB0D5
#define RXB0D6
#define RXB0D7
#define RXB1CTRL
#define RXB1SIDH
#define RXB1SIDL
#define RXB1EID8
#define RXB1EID0
#define RXB1DLC
#define RXB1D0
#define RXB1D1
#define RXB1D2
#define RXB1D3
#define RXB1D4
#define RXB1D5
#define RXB1D6
#define RXB1D7
#define TXREQ
#define TXP
#define RXM
#define BUKT
#define REQOP
#define ABAT
#define OSM
#define CLKEN
#define CLKPRE
#define REQOP
#define ICOD
#define RX0IE
#define RX1IE
#define TX0IE
#define TX1IE
#define TX2IE
#define ERRIE
#define WAKIE
#define MERRE
#define RX0IF
#define RX1IF
#define TX0IF
#define TX1IF
#define TX2IF
#define ERRIF
#define WAKIF
#define MERRF
#define B1BFS
#define B0BFS
#define B1BFE
#define B0BFE
#define B1BFM
#define B0BFM
#define SJW
#define BRP
#define BTLMODE
#define SAM
#define PHSEG1
#define PRSEG
#define WAKFIL
#define PHSEG2
#define TXB2RTS
#define TXB1RTS
#define TXB0RTS
#define SJW_1TQ
#define SJW_2TQ
#define SJW_3TQ
#define SJW_4TQ
#define BTLMODE_CNF3
#define BTLMODE_PH1_IPT 0x00
#define SMPL_3X
#define
AVR单片机232CAN转 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)