欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18F4580-I/PT 参数 Datasheet PDF下载

PIC18F4580-I/PT图片预览
型号: PIC18F4580-I/PT
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚增强型闪存微控制器与ECAN技术, 10位A / D和纳瓦技术 [28/40/44-Pin Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology]
分类和应用: 闪存微控制器和处理器外围集成电路时钟
文件页数/大小: 490 页 / 8912 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F4580-I/PT的Datasheet PDF文件第280页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第281页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第282页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第283页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第285页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第286页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第287页浏览型号PIC18F4580-I/PT的Datasheet PDF文件第288页  
PIC18F2480/2580/4480/4580  
EXAMPLE 24-1:  
CHANGING TO CONFIGURATION MODE  
; Request Configuration mode.  
MOVLW  
MOVWF  
B’10000000’  
CANCON  
; Set to Configuration Mode.  
; A request to switch to Configuration mode may not be immediately honored.  
; Module will wait for CAN bus to be idle before switching to Configuration Mode.  
; Request for other modes such as Loopback, Disable etc. may be honored immediately.  
; It is always good practice to wait and verify before continuing.  
ConfigWait:  
MOVF  
ANDLW  
CANSTAT, W  
B’10000000’  
; Read current mode state.  
; Interested in OPMODE bits only.  
; Is it Configuration mode yet?  
; No. Continue to wait...  
TSTFSZ WREG  
BRA  
ConfigWait  
; Module is in Configuration mode now.  
; Modify configuration registers as required.  
; Switch back to Normal mode to be able to communicate.  
EXAMPLE 24-2:  
WIN AND ICODE BITS USAGE IN INTERRUPT SERVICE ROUTINE TO ACCESS  
TX/RX BUFFERS  
; Save application required context.  
; Poll interrupt flags and determine source of interrupt  
; This was found to be CAN interrupt  
; TempCANCON and TempCANSTAT are variables defined in Access Bank low  
MOVFF  
CANCON, TempCANCON  
; Save CANCON.WIN bits  
; This is required to prevent CANCON  
; from corrupting CAN buffer access  
; in-progress while this interrupt  
; occurred  
MOVFF  
CANSTAT, TempCANSTAT  
; Save CANSTAT register  
; This is required to make sure that  
; we use same CANSTAT value rather  
; than one changed by another CAN  
; interrupt.  
MOVF  
ANDLW  
ADDWF  
TempCANSTAT, W  
B’00001110’  
PCL, F  
; Retrieve ICODE bits  
; Perform computed GOTO  
; to corresponding interrupt cause  
; 000 = No interrupt  
; 001 = Error interrupt  
; 010 = TXB2 interrupt  
; 011 = TXB1 interrupt  
; 100 = TXB0 interrupt  
; 101 = RXB1 interrupt  
; 110 = RXB0 interrupt  
; 111 = Wake-up on interrupt  
BRA  
BRA  
BRA  
BRA  
BRA  
BRA  
BRA  
NoInterrupt  
ErrorInterrupt  
TXB2Interrupt  
TXB1Interrupt  
TXB0Interrupt  
RXB1Interrupt  
RXB0Interrupt  
WakeupInterrupt  
BCF  
PIR3, WAKIF  
; Clear the interrupt flag  
;
; User code to handle wake-up procedure  
;
;
; Continue checking for other interrupt source or return from here  
NoInterrupt  
; PC should never vector here. User may  
; place a trap such as infinite loop or pin/port  
; indication to catch this error.  
DS39637D-page 284  
© 2009 Microchip Technology Inc.  
 复制成功!