gnupic: Re: [gnupic] in-circuit debugger
Subject:
Re: [gnupic] in-circuit debugger
From:
"Maxim Wexler" ####@####.####
Date:
4 Feb 2007 21:33:16 +0000
Message-Id: <a0811460702041332g470a88acr6be8b0444bdc7690@mail.gmail.com>
>
>
> Describe the circuit wiring diagram and post the code.
Hmm, seems to be one of yours, Byron. Now's a good time to ask about the
'^80s'. They don't show up in the 'step' output and I took one out without
effect. What are they for?
Works as desired in gpsim: toggling RB5 stops and starts display. In
hardware -- LEDs never light.
;
; blink88.asm -- A PIC16F88 Hello World Program
;
;
; source code for gpasm by Byron Jeff - July 31st 2002,
;
;
; The standard 1st Blinky LED program for PICDesigner.
; I/O
; B0-B2,E0: Interface to 7445 decoder which grounds cathodes.
; D0-D7 : Interface to LED anodes.
;
; define PIC device type
;
LIST P=16F88
;
; define config fuses
;
__config
_CONFIG1,_BODEN_OFF&_CP_OFF&_PWRTE_ON&_WDT_OFF&_LVP_ON&_INTRC_IO&_MCLR_OFF
; Reset the default radix to decimal. I use 0x for hex numbers
RADIX DEC
;
; include PIC register definitions, and some macros
;
#include "p16f88.inc"
; Define some variables
SW equ 5
CBLOCK 0x20
c1
c2
c3
display
endc
;
; code start
;
org 0
goto init
org 8 ; Leave room for later interrupts
init
bsf STATUS,RP0 ;register page 1
movlw 0x70
movwf OSCCON ;^ 0x80
bcf STATUS,RP0 ;register page 0
clrf PORTB ;
bsf STATUS,RP0 ;register page 1
movlw 0xf8
movwf TRISB ^ 0x80 ;initialize port B so that portb0-b2 is out
bcf STATUS,RP0 ;register page 0
clrf PCLATH
clrf PORTB
clrf display ; clear the display
main
movf display,w ; get the display
andlw 7 ; only last 3 digits
movwf PORTB ; Set the column
call delay
incf display,F ; next display
goto main ; loop forever.
switch
;blank
clrf PORTB
retlw 0
;goto blank
delay
clrf c1
clrf c2
movlw 20
movwf c3
kwloop
btfsc PORTB,SW ; RB5 switch press?
call switch
decfsz c1,F ; Delay awhile for char to xmit
goto kwloop
decfsz c2,F
goto kwloop
decfsz c3,F
goto kwloop
return
END
Circ: leds on RB0-2, one debounced-by-hardware pb switch(NO).
Maxim