Re: Help needed in completing a classic 8digit LED counter kit

Patrick Pugh Sawian
 

I think the 7217 burnt as a result of a short in the display PCB. Checked everything now and all is fine but I have one 7217 less and they are now obsolete and hard to get items these days.  :-(
Any help with compiling the code below into hex for my common anode display would be appreciated.
 
; 8DGTCACC.INC: 8 digits CA or CC 7-segments LED display
; using conditional assembly

;-------------------- keywords for conditional assembly -----------------

; uncomment only one among these two directives
;#define useCAdisplay ; if using Common Anode 7-segment display
#define useCCdisplay ; if using Common Cathode 7-segment display

; uncomment only one among these five directives
;#define PORTX 5 ; if using PORTA (full 8 bits, example: PIC16F628)
#define PORTX 6 ; if using PORTB (any 18 pins mid-range PICmicro)
;#define PORTX 7 ; if using PORTC (any 28 pins mid-range PICmicro)
;#define PORTX 8 ; if using PORTD (any 40 pins mid-range PICmicro)
;#define PORTX 9 ; if using PORTE (any 40 pins mid-range PICmicro)

;----------------------------------------------------------
; declare in the main file:
;----------------------------------------------------------
; numdgt ; .128, then .64, .32, .16, .8, .4, .2, .1
; rlfcnt ; .8, then .7, .6, .5, .4, .3, .2, .1
; affvis ; ratio display visible
; dgtvis ; digit currently displayed
;
; dgtDS7 ; digit #7 (left most digit)
; dgtDS6 ; digit #6
; dgtDS5 ; digit #5
; dgtDS4 ; digit #4
; dgtDS3 ; digit #3
; dgtDS2 ; digit #2
; dgtDS1 ; digit #1
; dgtDS0 ; digit #0 (right most digit)
;
;----------------------------------------------------------
; macro to prepare input parameters to "Disp" routine
;----------------------------------------------------------
DISPDGT macro posdgt, dgt
MOVLW posdgt
MOVWF rlfcnt
MOVF dgt, w
CALL Disp
endm

;----------------------------------------------------------
config. RBx & CC as outputs, (if Common Cathode), then RBx=HIGH & CC=LOW
;Config. RBx & CA as outputs, (if Common Anode), then RBx=LOW & CA=HIGH
;----------------------------------------------------------
SEGx macro REGx, RBx, jump, configRB, dgtX
BTFSC dgtX, RBx
GOTO jump

#ifdef useCCdisplay
BTFSS REGx, RBx ; conditional assembly
#endif

#ifdef useCAdisplay
BTFSC REGx, RBx ; conditional assembly
#endif

GOTO jump
BSF STATUS, RP0 ; flip to bank1
MOVLW configRB
XORWF dgtX, w
MOVWF PORTX
BCF STATUS, RP0 ; go back to bank0
MOVLW configRB

#ifdef useCCdisplay
XORLW 0FFh ; complement W (conditional assembly)
#endif

MOVWF PORTX

MOVLW .128 ; internal delay = 0.5 ms (quartz 4 MHz)
ADDLW 0FFh ; W--
BTFSS STATUS, Z ; bit Z=1 (i.e. W = 0 ?)
GOTO $-2 ; loop = 4 * 128 = 512 us

endm

;----------------------------------------------------------
; Routine to display 8 digits
; (one digit at a time, segment by segment individually)
;----------------------------------------------------------
Display
MOVLW .15
MOVWF affvis
dispdgts
DISPDGT .8, dgtDS7
DISPDGT .7, dgtDS6
DISPDGT .6, dgtDS5
DISPDGT .5, dgtDS4
DISPDGT .4, dgtDS3
DISPDGT .3, dgtDS2
DISPDGT .2, dgtDS1
DISPDGT .1, dgtDS0

DECFSZ affvis, f
GOTO dispdgts
RETURN

;----------------------------------------------------------
Common Cathode digit, light segment by segment
; Common Anode digit, light segment by segment
;----------------------------------------------------------
Disp
MOVWF dgtvis

MOVLW high Tab7seg
MOVWF PCLATH
MOVF dgtvis, w ; (dgtvis) -> W
CALL Tab7seg ; convert
MOVWF dgtvis ; (dgtvis) converted to 7 segments code

#ifdef useCAdisplay
COMF dgtvis, f ; conditional assembly (for Common Anode)
#endif
CLRF numdgt
BSF dgtvis, 7
BSF STATUS, C
rlfloop
RLF numdgt, f
RLF dgtvis, f
BTFSC STATUS, C
GOTO setBit0
BCF dgtvis, 0
GOTO rlfnext
setBit0
BSF dgtvis, 0
rlfnext
BCF STATUS, C
DECFSZ rlfcnt, f
GOTO rlfloop

DispsegA SEGx dgtvis,0,DispsegB,0FEh, numdgt ; Disp. dgtvis, bit0
DispsegB SEGx dgtvis,1,DispsegC,0FDh, numdgt ; Disp. dgtvis, bit1
DispsegC SEGx dgtvis,2,DispsegD,0FBh, numdgt ; Disp. dgtvis, bit2
DispsegD SEGx dgtvis,3,DispsegE,0F7h, numdgt ; Disp. dgtvis, bit3
DispsegE SEGx dgtvis,4,DispsegF,0EFh, numdgt ; Disp. dgtvis, bit4
DispsegF SEGx dgtvis,5,DispsegG,0DFh, numdgt ; Disp. dgtvis, bit5
DispsegG SEGx dgtvis,6,DispsegX,0BFh, numdgt ; Disp. dgtvis, bit6
DispsegX SEGx dgtvis,7,Dispoff, 07Fh, numdgt ; Disp. dgtvis, bit7

Dispoff
CLRF PORTX ; clear portX
RETURN

; 8DGTCNT.ASM: main file to test display file "8DGTCACC.INC"

;----------------------------------------------------------
list P = 16F628A
#include <p16f628a.inc>
__CONFIG _CP_OFF &_BODEN_OFF &_PWRTE_ON &_WDT_OFF &_LVP_OFF &_MCLRE_OFF &_INTRC_OSC_NOCLKOUT

;---------------------- DEFINE HARDWARE ---------------------------------------
#define BTN PORTA, 4 ; push button connected to RA4

;--------------------- DEFINE VARIABLES ---------------------------------------
CBLOCK 0x70 ; common RAM [16 bytes, 0x70 to 0x7F]
numdgt ; .128, puis .64, .32, .16, .8, .4, .2, .1
rlfcnt ; .8, puis .7, .6, .5, .4, .3, .2, .1
affvis ; ratio display visible
dgtvis ; digit currently displayed

dgtDS7 ; digit #7 (left most digit)
dgtDS6, dgtDS5, dgtDS4 ; digit #6, digit #5, digit #4
dgtDS3, dgtDS2, dgtDS1 ; digit #3, digit #2, digit #1
dgtDS0 ; digit #0 (right most digit)
ENDC

;----------------------------------------------------------
; increment one digit from 0 to maxi-1 ; if maxi, then wrap to 0
;----------------------------------------------------------
INC1 macro digitX, maxi, jump
INCF digitX, f ; increment digitX
MOVLW maxi
XORWF digitX, w
BTFSS STATUS, Z ; digitX = maxi ?
GOTO jump ; no
CLRF digitX ; yes, then clear digitX
endm

;//////////////////////////////////////////////////////////////////////////////
ORG 0x00 ; reset vector
GOTO Start
;----------------------------------------------------------
; L.U.T. to convert a decimal value into the corresponding 7 segment code
;----------------------------------------------------------
Tab7seg
ADDWF PCL, f ; display 7 segments GFEDCBA
DT 3Fh, 06h, 5Bh, 4Fh, 66h, 6Dh, 7Dh, 07h, 7Fh, 6Fh

;/////////////////////////////////////////////////////////////////////////////////
#include "8DGTCACC.INC"
;/////////////////////////////////////////////////////////////////////////////////
Start
bsf STATUS, RP0 ; flip to Bank 1
bsf BTN ; config. BTN as input
bcf STATUS, RP0 ; back to Bank 0

clrf dgtDS7
clrf dgtDS6
clrf dgtDS5
clrf dgtDS4
clrf dgtDS3
clrf dgtDS2
clrf dgtDS1
clrf dgtDS0
tstBtn
btfsc BTN ; BTN pushed
goto majDisp ; no
IncDgts
INC1 dgtDS0, .10, majDisp
INC1 dgtDS1, .10, majDisp
INC1 dgtDS2, .10, majDisp
INC1 dgtDS3, .10, majDisp
INC1 dgtDS4, .10, majDisp
INC1 dgtDS5, .10, majDisp
INC1 dgtDS6, .10, majDisp
INC1 dgtDS7, .10, majDisp
majDisp
CALL Display
GOTO tstBtn
;----------------------------------------------------------
END


 
73ees,
Pat

--- On Mon, 10/10/11, iam74@... <iam74@...> wrote:


From: iam74@... <iam74@...>
Subject: [BITX20] Re: Help needed in completing a classic 8digit LED counter kit
To: BITX20@...
Date: Monday, October 10, 2011, 1:26 AM



 





--- In BITX20@..., "LeonardL" <dredger@...> wrote:

Is this the counter that you are building?

http://golddredgervideo.com/kc0wox/frequencycounter/frequencycounter.htm

Leonard

--- In BITX20@..., "hmpph" <patrick_pugh2000@> wrote:

Hi all,

My dual 7217 with 7017 and a 6.5Mhz crystal osc 8 digit counter 3.5 Mhz common anode LED kit blew up with one of the 7217s in smoke. The LEDs did not light up and am hoping to replace the circuitry with a PIC16F84+4051 combination from here:- http://www.qsl.net/y/yo5ofh//pic/digiscale.htm

Could a kind soul help me with hexing the source code from C please for my common anode display please. PIC is 16F84A

73ees,
Pat
No, Leonard. I don't know the "7217 with 7017" design, but the YO5OFH group are variants of earlier LED designs that eventually became the IK3OIL design.

The hex codes, source codes, and writeups for the "digiscale" designs are all at the OM3CPH website.

I would suggest using the W8DIZ kit which uses an ATTiny2313, goes easily to 30 Mhz with 8 LCD digits accurate to 1 Hz, and has all the source code as well as writeups on his website. The original documentation is in QRP Quarterly, the ARCI journal. And the kit is very reasonable for what it does, about US$25.

john
AD5YE








[Non-text portions of this message have been removed]

Join BITX20@groups.io to automatically receive all group messages.