Searching \ for 'How to display numbers in a LED display' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=led
Search entire site for: 'How to display numbers in a LED display'.

Truncated match.
PICList Thread
'How to display numbers in a LED display'
1997\05\20@171731 by Jose Antonio Noda

flavicon
face
Hi,

I know a little about the microcontroller PIC16C84,
and I would like make a little counter with a LED display,
and a 16C84 chip.
I have made my first proyects with the PIC16C84,
and now I would like make a 0 to 9 counter with a 16C84 chip.
Please, could you help me with a little source code,
and a little scheme or how to connect the display?.
Please, help me with this proyect of the counter!.

Regards,
Jose Antonio
spam_OUTjant_nodaTakeThisOuTspamredestb.es

1997\05\20@184445 by andreabelian

picon face
Jose Antonio Noda wrote:
>
> Hi,
>
> I know a little about the microcontroller PIC16C84,
> and I would like make a little counter with a LED display,
> and a 16C84 chip.
> I have made my first proyects with the PIC16C84,
> and now I would like make a 0 to 9 counter with a 16C84 chip.
> Please, could you help me with a little source code,
> and a little scheme or how to connect the display?.
> Please, help me with this proyect of the counter!.
>
> Regards,
> Jose Antonio
> .....jant_nodaKILLspamspam@spam@redestb.es


try this

               PC              EQU             OX02
               COUNT   EQU             0X0C

                               MOVF    COUNT,W
                               CALL    SEGMENTS
                               MOVWF   PORTB

       SEGMENTS        ADDWF   PC,F    ; ADD OFFSET TO PGM CTR
                               RETLW   3F              ; 0
                               RETLW   06              ; 1
                               RETLW   53              ; 2
                               RETLW   4F              ; 3
                               RETLW   66              ; 4
                               RETLW   6D              ; 5
                               RETLW   7D              ; 6
                               RETLW   07              ; 7
                               RETLW   7F              ; 8
                               RETLW   6F              ; 9

HOP THIS HELPS


ANDRE
















                    _____________________________________
                   /                                    /\
                  /   Andre  Abelian  818.840-0003     /
/\                                                 /       Data Image
Technology       _/ /                                             /
andreabelianspamKILLspamearthlink.net    / \/
               /        1128 Alameda Ave.ste 4      /\
              /           Glendale  CA  91201      /
/
             /____________________________________/ /
             \____________________________________\/
              \  \  \  \  \  \   \  \  \  \  \  \  \

1997\05\20@185315 by TONY NIXON 54964

flavicon
picon face
This code should help you with your problem
The delay between number increments is determined by 'timer'
and will depend on the crystal frequency you choose.

The 7 seg display needs to be a common cathode type.
If you only have a common anode type then invert the display data.

ie  xorlw 0xff

I haven't tested the code, but it should work

Regards

Tony


list p=16c84,c=140  ; processor type
errorlevel        1, -(305)
;
;
status equ 3h
rp0 equ 5h
portb   equ 6h
trisb  equ 86h
intcon equ 0bh
rtif equ 2h
optionreg   equ 81h
;
counter equ 0ch
timer equ 0dh
;
org 0h              ; program start
bsf status,rp0     ; initialise
clrf trisb
movlw 7h ; prescale = 1:256
movwf optionreg
bcf status,rp0
clrf portb
clrf counter
movlw d'15'
movwf timer
bcf intcon,rtif
;
loop btfss intcon,rtif   ; wait for RTCC overflow
goto loop
;
bcf intcon,rtif
decfsz timer             ; wait 15 overflow periods
goto loop
;
movlw d'15'            ; reset timer
movwf timer
;
movf counter,w
call display            ; get 7 seg data
movwf portb
incf counter
movlw d'10'          ; test for overflow
xorwf counter,w
btfsc status,z
clrf counter          ; clear counter
goto loop
;
; 7 Seg data
;
display  addwf pcl
retlw b'00111111'
retlw b'00000110'
retlw b'01011011'
retlw b'01001111'
retlw b'01100110'
retlw b'01101101'
retlw b'01111101'
retlw b'00000111'
retlw b'01111111'
retlw b'01101111'
;
;
end


Just when I thought I knew it all,
I learned that I didn't.

1997\05\20@185315 by TONY NIXON 54964

flavicon
picon face
This code should help you with your problem
The delay between number increments is determined by 'timer'
and will depend on the crystal frequency you choose.

The 7 seg display needs to be a common cathode type.
If you only have a common anode type then invert the display data.

ie  xorlw 0xff

I haven't tested the code, but it should work

Regards

Tony


list p=16c84,c=140  ; processor type
errorlevel        1, -(305)
;
;
status equ 3h
rp0 equ 5h
portb   equ 6h
trisb  equ 86h
intcon equ 0bh
rtif equ 2h
optionreg   equ 81h
;
counter equ 0ch
timer equ 0dh
;
org 0h              ; program start
bsf status,rp0     ; initialise
clrf trisb
movlw 7h ; prescale = 1:256
movwf optionreg
bcf status,rp0
clrf portb
clrf counter
movlw d'15'
movwf timer
bcf intcon,rtif
;
loop btfss intcon,rtif   ; wait for RTCC overflow
goto loop
;
bcf intcon,rtif
decfsz timer             ; wait 15 overflow periods
goto loop
;
movlw d'15'            ; reset timer
movwf timer
;
movf counter,w
call display            ; get 7 seg data
movwf portb
incf counter
movlw d'10'          ; test for overflow
xorwf counter,w
btfsc status,z
clrf counter          ; clear counter
goto loop
;
; 7 Seg data
;
display  addwf pcl
retlw b'00111111'
retlw b'00000110'
retlw b'01011011'
retlw b'01001111'
retlw b'01100110'
retlw b'01101101'
retlw b'01111101'
retlw b'00000111'
retlw b'01111111'
retlw b'01101111'
;
;
end


Just when I thought I knew it all,
I learned that I didn't.

1997\05\20@185518 by Steve Smith

picon face
If you use a look up table to translate the binary number into the seven
segment pattern you can drive the display directly from the port with series
resistors otherwise look in the "Embedded Control Handbook" Mircochip and
there are designs for multiplexed displays and code examples for returning
the correct pattern to do the job required.

Otherwise you could tax the grey matter and drive a 5 X 7 dot matrix display
using only eight output lines and a 74138. thus making a display capable of
displaying not only numbers but also ASCII. If then feeling even more
energetic an attempt at space invaders could be written on the same hardware.


Oh well its late here in Bristol and the local ale appears to have caused a
minor fault in reality. This may resolve itself in time but it could get
worse...........


Steve..........

1997\05\21@013631 by Philippe TECHER

flavicon
face
You can try your software exactly with UMPS simulator
which will allow you to see the graphical result of
the output to a display and much more ...

Demo available at:
    http://idls.izarbel.tm.fr/entp/techer/P01.HTM

Best regards,
       Philippe.

 +--------------------------------------------------------+
 |   Virtual Micro Design                                 |
 | Try the new generation microcontroller simulator       |
 | E-Mail: .....p.techerKILLspamspam.....idls.izarbel.tm.fr                    |
 | URL:    http://idls.izarbel.tm.fr/entp/techer/P01.HTM  |
 +--------------------------------------------------------+

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...