• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Wat is missin

Status
Not open for further replies.

Mr.K

New Member
y is some numbers on da lookup table not appearin rignt on a sement display?

example numbers not showin correctly 2,5,7,9

da top portion will not display

heres da code

Code:
list      p=16F84A      ; list directive to define processor
	__config  3FF9
;

;specify SFRs

pcl		equ		02
status	equ		03
porta	equ		05
trisa	equ		05
portb	equ		06
trisb	equ		06
;
pointer	equ		10
delcntr1	equ	11
delcntr2	equ	12
;
	org		00
;Initialise
start	bsf	status,5		;select memory bank 1
		movlw B'00011000'
		movwf trisa			;port A according to above pattern
		movlw 00
		movwf trisb			;all port B bits output
		bcf  status,5		;select bank 0
		clrf portb
		clrf pointer
;
;The "main" program starts here
		movlw	00				;clear all bits in port A
		movwf porta			
		movwf pointer			;also clear pointer
loop 	movf  pointer,0			;move pointer to W register
		call  table			
		movwf portb			   ;move W register, updated from table SR, to portB
		call  delay
loop2	btfsc porta,0
		incf  pointer,1
		btfsc porta,7
		clrf  pointer
		goto  loop
		
;

delay movlw D'255'
	  movwf delcntr2
outer movlw D'255'
	  movwf delcntr1
inner nop
      nop
	  nop
	  nop
	  nop
      decfsz delcntr1,1
      goto   inner
      decfsz delcntr2,1
      goto   outer
      return

;Holds Lookup Table
table addwf pcl,1
	  retlw B'01111110' ;0
      retlw B'00110000'	;1
      retlw B'01101101'	;2
      retlw B'01111001'	;3
      retlw B'00110011'	;4
      retlw B'01011011'	;5
      retlw B'01011111'	;6
      retlw B'01110000'	;7
	  retlw B'01111111'	;8
      retlw B'01111011'	;9
      retlw B'01111101'	;a
      retlw B'00011111'	;b
      retlw B'00001101'	;c
      retlw B'00111101'	;d
      retlw B'01001111'	;e
      retlw B'01000111'	;f
	;end of program'
	  END
 

Mr.K

New Member
dose buttons dont work on my laptop anytime more...seriously
 
Last edited:

blueroomelectronics

Well-Known Member
Then how did you type "goto"

Seriously put a wee bit of effort into your English when posting in a public forum, is it too much to ask?

PS try running your program through the MPLAB simulator.
PPS why not use the 16F84 include file instead of manually defining SFRs?
PPPS post a schematic and remember the 16F84 RA3 is sink only not source.
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
Then how did you type "goto"

Seriously put a wee bit of effort into your English when posting in a public forum, is it too much to ask?

PS try running your program through the MPLAB simulator.
PPS why not use the 16F84 include file instead of manually defining SFRs?
PPPS post a schematic and remember the 16F84 RA3 is sink only not source.
RA4 not RA3 Bill :D
 

blueroomelectronics

Well-Known Member
Opps you're right, RA4 is the open collector pin on many 16F PICs. A schematic would be helpful in determining the problem.
I would also recommend fixing that keyboard, how can you program with missing keys!
 

gabeNC

Member
Opps you're right, RA4 is the open collector pin on many 16F PICs. A schematic would be helpful in determining the problem.
I would also recommend fixing that keyboard, how can you program with missing keys!

Guess you could open "character map" and just click the appropriate char. :D
'course that would be REALLY time consuming, programming via the Joni Eareckson Tada style.
 

Mr.K

New Member
i thought it had to do with a number being flipped from a 1 to a 0 or a zero to a 1 in the lookup table because the top portion of these numbers dont show 0,2,3,5,7,8,9 every other part of the numbers show except the roof of those nunmbers
 
Last edited:

blueroomelectronics

Well-Known Member
Try posting the schematic. It could be anything as the source code you posted appears to be from an ancient source.
Oshonsoft have a trial version PIC simulator with 7segment displays. Try running it through that.
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top