Inquisitive
Super Moderator
I need some assistance getting this solved.
I'm still learning to crawl in PIC microcontrollers. Working with a PIC 16F628A
The issue is these restricted memory errors in the watch windows. How do I solve this?
Using MPLAB IDE 8.92 with MPLAB SIM
Why can I not watch RA0 and RB0 ? Suggestions anyone.
I'm still learning to crawl in PIC microcontrollers. Working with a PIC 16F628A
Code:
;=============================================================================
; Bin4B.asm 3-4-18
;=============================================================================
; Slow output binary count is stopped, started
; and reset with push buttons. This version uses a
; subroutine for the delay...
; Processor: PIC 16F628A
; Hardware: BIN Demo System
; Clock:
; Inputs: Push Buttons RA0, RA1 (active low)
; Outputs: RB0 - RB7 LEDs (active high)
;
; WDTimer: Disabled
; PUTimer: Enabled
; Interrupts: Disabled
; Code Protect: Disabled
;=============================================================================
; 16F628A
; ____ ____
; RA2-| 1 U 18 |-RA1
; RA3-| 2 17 |-RA0
; RA4-| 3 16 |-OSC1/RA7
; MCLR-| 4 15 |-OSC2/RA6
; VSS-| 5 14 |-VDD
; RB0-| 6 13 |-RB7
; RB1-| 7 12 |-RB6
; RB2-| 8 11 |-RB5
; RB3-| 9 10 |-RB4
; ----------
;
list p=16f628a
include <p16f628A.inc>
radix hex
__CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _XT_OSC
;
;...... Register Label Equates ...............................................
;
porta EQU 05 ; Port A Data Register
portb EQU 06 ; Port B Data Register
timer EQU 0C ; Spare register for delay
; Input Bit Label Equates ....................................................
;inres EQU 0 ; 'Reset' input button = RA0
;inrun Equ 1 ; 'Run' input button = RA1
;
cblock 0x20
inres ; 'Reset' input button = RA0
inrun ; 'Run' input button = RA1
endc
movlw .0
movwf inres
movlw .1
movwf inrun
;
;*****************************************************************************
; Initialise Port B (Port A defaults to inputs) ..............................
;
MOVLW b'00000000' ; Port B Data Direction Code
TRIS portb ; Load the DDR code into F86
GOTO reset
;
; 'delay' subroutine .........................................................
;
delay MOVWF timer ; Copy W to timer register
down DECFSZ timer ; Decrement timer register
GOTO down ; and repeat until zero
RETURN ; Jump back to main program
;
; Start main loop ............................................................
;
reset CLRF portb ; Clear Port B Data
;
start BTFSS porta,inres ; Test RA0 input button
GOTO reset ; and reset Port B if pressed
BTFSC porta,inrun ; Test RA1 input button
GOTO start ; and run count if pressed
;
INCF portb ; Increment count at Port B
MOVLW 0FF ; Delay count literal
CALL delay ; Jump to subroutine 'delay'
;
GOTO start ; Repeat main loop always
END ; Terminate source code
The issue is these restricted memory errors in the watch windows. How do I solve this?
Using MPLAB IDE 8.92 with MPLAB SIM
Why can I not watch RA0 and RB0 ? Suggestions anyone.