Continue to Site

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.

  • 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.

Countdown Timer Question

Status
Not open for further replies.
Once again, it works great.
I will start working on the PCB soon.

Your help was greatly appreciated.
 
No problem. You helped me keep my PIC ASM skills sharp. I haven't coded with ASM for a year or more now.
Good luck with your project!
 
Last edited:
Not really. Especially on the PIC since there are only 35 instructions to learn (16F series). Definitely worth learning if you want to create your own designs or mod designs by others. There are several PIC tutorials on the web like who is also a mod here.
 
There is another problem with the circuit,

When the 10's digit is blank you can see a dim number, the same a second 1's.
For example...
21:52
It is slightly annoying, but otherwise it looks great.
 
The ghosting is caused by the fact that they don't turn off the digit select lines before altering the bit pattern on the 4543. Try adding the code in bold to the interrupt routine:
Code:
INTERRUPT   MOVWF W_TEMP        ; save W
            SWAPF STATUS,W        ; save status
            MOVWF STATUS_TEMP        ; without changing flags
;           CLRWDT            ; Clear Watchdog timer

[B]            movf PORTB,W        ; read PORTB bits
            andlw B'00110000'    ; don't touch bits 4 & 5
            movwf PORTB            ; turn off digit select transistor(s)

[/B]            INCF DIGCTR,F        ; next digit #
            MOVF DIGCTR,W        ; get it into W
            ANDLW B'00000011'        ; mask off 2 lowest bits
            MOVWF DIGIT            ; save it for later
            ADDLW H'40'            ; point at register to display
            MOVWF FSR            ; use as pointer
            MOVF INDF,W            ; get value of reg pointed to into W

            btfss DIGIT,0        ; These 4 lines check for a 3 in DIGIT
            goto NOT_MIN10_DIGIT
            btfss DIGIT,1
            goto NOT_MIN10_DIGIT
            btfsc STATUS, Z        ; Check if W is zero
            movlw H'0A'            ; Make the 4543 display a blank

NOT_MIN10_DIGIT
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top