Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Eric please come on chat if you can ....
hmmmm
Sure ... and if you do please let me know...
I feel its the oshon bug gonna try to load it to the muc and try the hex received from MPlab
Yes!!Verdit is osho is the problem has a bug ! works well in the real world.
list p=18f2520
#include <p18f2520.inc>
radix dec
; Compiled with: PIC18 Simulator IDE v2.81
; Microcontroller model: PIC18F2520
; Clock frequency: 20.0 MHz
;
; The address of 'inp' (bit) (global) is 0xF82,4
; The address of 'led' (bit) (global) is 0xF82,3
; Begin
R0L EQU 0x000
R0H EQU 0x001
R1L EQU 0x002
R1H EQU 0x003
R2L EQU 0x004
R2H EQU 0x005
R3L EQU 0x006
R3H EQU 0x007
R4L EQU 0x008
R4H EQU 0x009
R5L EQU 0x00A
R5H EQU 0x00B
R6L EQU 0x00C
R6H EQU 0x00D
R7L EQU 0x00E
R7H EQU 0x00F
R8L EQU 0x010
R8H EQU 0x011
R9L EQU 0x012
R9H EQU 0x013
ORG 0x000000
BSF RCON,IPEN
BRA L0004
ORG 0x000008
RETFIE FAST
ORG 0x000018
RETFIE FAST
; Begin of program
L0004:
; 1: Define CONFIG1L = 0x00
; 2: Define CONFIG1H = 0x02
; 3: Define CONFIG2L = 0x1a
; 4: Define CONFIG2H = 0x00
; 5: Define CONFIG3L = 0x00
; 6: Define CONFIG3H = 0x03
; 7: Define CONFIG4L = 0x80
; 8: Define CONFIG4H = 0x00
; 9: Define CONFIG5L = 0x0f
; 10: Define CONFIG5H = 0xc0
; 11: Define CONFIG6L = 0x0f
; 12: Define CONFIG6H = 0xe0
; 13: Define CONFIG7L = 0x0f
; 14: Define CONFIG7H = 0x40
; 15:
; 16:
; 17: Config PORTC.4 = Input
BSF TRISC,4
; 18: Config PORTC.3 = Output
BCF TRISC,3
; 19:
; 20: Symbol inp = PORTC.4 'status LED
; 21: Symbol led = PORTC.3 'status LED
; 22:
; 23: main:
L0001:
; 24: led = 0
BCF 0xF82,3
; 25: WaitMs 5
MOVLW 0x05
MOVWF R0L
CLRF R0H
RCALL W001
; 26:
; 27: start:
L0002:
; 28: led = 1
BSF 0xF82,3
; 29:
; 30: menu:
L0003:
; 31: WaitMs 250
MOVLW 0xFA
MOVWF R0L
CLRF R0H
RCALL W001
; 32: If inp = 0 Then
BTFSC 0xF82,4
BRA L0005
; 33: led = 1
BSF 0xF82,3
; 34: Else
BRA L0006
L0005:
; 35: Toggle led
BCF TRISC,3
BTG LATC,3
; 36: Endif
L0006:
; 37: Goto menu
BRA L0003
; 38: End
L0007 BRA L0007
; End of program
L0008 BRA L0008
; Waitms Routine
W001: MOVF R0L,F
BTFSC STATUS,Z
BRA W002
RCALL W003
DECF R0L,F
NOP
NOP
NOP
NOP
NOP
BRA W001
W002: MOVF R0H,F
BTFSC STATUS,Z
RETURN
RCALL W003
DECF R0H,F
DECF R0L,F
BRA W001
W003: MOVLW 0x0C
MOVWF R2H
W004: DECFSZ R2H,F
BRA W004
NOP
NOP
MOVLW 0x62
MOVWF R1L
W005: DECFSZ R1L,F
BRA W006
RCALL W007
RCALL W007
NOP
NOP
RETURN
W006 RCALL W007
BRA W005
W007: MOVLW 0x0D
MOVWF R2L
W008: DECFSZ R2L,F
BRA W008
NOP
RETURN
; Configuration bytes settings
ORG 0x300000
DW 0x0200
DW 0x001A
DW 0x0300
DW 0x0080
DW 0xC00F
DW 0xE00F
DW 0x400F
; End of listing
END