0184:main_0_0:
MOVFF FSR2L, POSTINC1
0188 MOVFF FSR1L, FSR2L
018C MOVF POSTINC1, F, ACCESS
018E BCF INTCON2, 0x7, ACCESS
0190 RCALL GetRB7 ;returns (RB7==0?1:0)
0192 MOVWF INDF2, ACCESS
0194 MOVLB 0
0196 MOVF 0xf0, W ;If [0xF0]<>0 goto bootload
0198 BNZ 0x1a8
019A MOVF INDF2, W ;If RB7==0 goto bootload
019C BNZ 0x1a8
019E RCALL TestIfOSAvail_0_5 ;If ==0 goto bootload
01A0 IORLW 0
01A2 BZ 0x1a8
01A4 GOTO 0x2800 ;start OS
01A8:bootload:
CLRF POSTINC1, ACCESS
01AA CALL InitTMR0_2_0, 0
01AE MOVF POSTDEC1, F, ACCESS
01B0 CALL InitIO, 0
01B4 MOVLW 0x14 ;UCFG =
01B6 MOVWF UCFG, ACCESS ;_PUEN|_TRINT|_FS|MODE_PP
01B8 MOVLB 0
01BA CLRF usb_device_state, BANKED
01BC MOVLB 0
01BE CLRF usb_state, BANKED
01C0 MOVLB 0
01C2 CLRF usb_active_cfg, BANKED
01C4:while1:
BTFSS PORTA, 0x4, ACCESS ; If RC4==High
01C6 BRA 0x1cc
01C8 CALL Hela_RA4IsHigh, 0 ;set RB3, loop forever flashing
RC1
01CC CALL USBCheckBusStatus, 0
01D0 CALL USBDriverService_0_1, 0
01D4 IORLW 0
01D6 BZ 0x1ee
01D8 MOVLW 0x8
01DA MOVWF POSTINC1, ACCESS
01DC MOVLW 0x40
01DE MOVWF POSTINC1, ACCESS
01E0 MOVLW 0
01E2 MOVWF POSTINC1, ACCESS
01E4 CALL ProcessIO_4_0, 0
01E8 MOVF POSTDEC1, F, ACCESS
01EA MOVF POSTDEC1, F, ACCESS
01EC MOVF POSTDEC1, F, ACCESS
01EE BRA 0x1c4
01F0 MOVF POSTDEC1, F, ACCESS
01F2 MOVF POSTDEC1, F, ACCESS
01F4 MOVFF INDF1, FSR2L
01F8 RETURN 0
>> 03 01 00 ...
<< 03 00 00 00 00 01 92 26
0000 MOVLB 0
0002 CLRF 0xF0,BANKED
0004 GOTO 0x1fdc
..
0008 GOTO 0x1f9c
..
0018 GOTO 0x1f9c
config PLLDIV = 5
config USBDIV = 2
config FOSC = HSPLL_HS
config CPUDIV = OSC1_PLL2
config VREGEN = ON
03 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00
Get 0x8 bytes from the device:
03 00 01 00 80 01 00 00
03 00 00 00 00 01 92 26
Connecting to MPLAB ICD 2
...Connected
ICDWarn0054: MPLAB IDE has lost communications with the MPLAB ICD 2. Would you like to attempt to reconnect? (here I said no)
ICD0286: Unable to communicate with ICD
MPLAB ICD 2 Ready
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?