Hello Forum,
Pls I present to you a problem which has denied me sleep for the past 2days. I'm working on my final year project which is titled "DIGITAL ALARM CLOCK USING PIC16F84A" and I seem to be having problem with the source code. Im a newbie in pic programming and I have very limited time, b4 my project defence takes place. Pls all u PIC programming guru's any1 should pls help me out and write the source code, if possible with the circuit diagram. I need ur help plssssssssss.

I know and believe i've presented my case to the right website/forum so im counting on the pic programming guru's

Thanks alot
cheers:sad:

HI to all,I'am a new user in this site..can any one help me in designing a clock for the scoreboard using PIC 16f84a and a seven segment..I need the program and the schematic design of it..thanx..

Comments
It is not nice to hijack another person's post!

At least try and write the code your self and then come back here and quote bit's of your code that don't work. People will be more inclined to help you if it looks like you are at least trying to learn something yourself rather than getting other people to do your school work for you.

Comments
Well said!!!
Well said!

i attach a schematic in her...and i tryid to make a program....can any body help ASP...please..this is the program..

int i;
main()
{
while(1)
portb=0xFA;
porta=0x01;
portb=0xA4;
porta=0x02;
portb=0xC0;
porta=0x04;
portb=0xC0;
porta=0x08;
}
if(portb.f5==0)
{
i=12;
while(i<12)
{
portb=i;
i=i-1;
}
}
else if(portb.f6==0)
{
while(1)
{
portb=portb;
}
}
else if(i=0)
{
while(1)
{
portb=0xFA;
porta=0x01;
portb=0xA4;
porta=0x02;
portb=0xC0;
porta=0x04;
portb=0xC0;
porta=0x08;
}
}
}

this is a countdown program...please can any one correct this ASAP...because i really need this in our design the scoreboard...A very big thanks to the one that can help me....

Attachments scan0007.jpg 306.71 KB

That is C code you posted, not assembly. If its a C program you are writing then you are in the wrong board. Let us know which is it and one of the mods will move this thread for you into the right board.

can we ask for sample asm codes for time and date display with alarm plzzzzz,,,need asap!! we are using pic16f84a microcontroller.

Comments
It is not nice to hijack another person's post!
Wayyyy too late with the "me too" plzsndmetehcodez bumpage.

hi guys...i wanna ask if somebody knows how to interface(source code) a pic 16f84a particularly PORTA(RA0-RA3) "ONLY" to the 7 segment display using cd4543...thanks

Comments
It is not nice to hijack another person's post!

Is it me, or is it that whenever a certain group of people get the same homework assignment in school, multiple of them come here to see if people here will do it for them?

Dear samari, salbja and joycekram1021,

It is not nice to hijack another person's post! Create a new post for yourself...this will maintain an organized way for us to respond to your individual questions, after all one main trait of a programmer is being organized!!!

guys...what do you think is wrong in my program...pls check it out...please, please...thanks...

Attachments
processor 16f84
         include   <p16f84A.inc>
       __config  _HS_OSC & _WDT_OFF & _PWRTE_ON

Sec			equ		H'10'
Sec10			equ		H'11'
Min			equ		H'12'
Min10			equ		H'13'
Disp_Sel		equ		H'14'
In1_New			equ		H'15'
In1_Prev		equ		H'16'
Pre_Count		equ		H'17'
W_Temp			equ		H'18'
STAT_Temp		equ		H'19'
Count_Dir		equ		H'1A'		;count down/up
Start_Status		equ		H'1B'		;start/stop operation
Preset10		equ		H'1C'
Preset01		equ		H'1D'
Ten_Prev		equ		H'1E'

    
	    	org     0x00		; reset vector									
		goto	Start
		org     0x04		; interupt vector
		goto	Int_Routine

Start:		
	bsf    	STATUS,RP0	;Select bank 1
        movlw	B'11100000'
        movwf	TRISA		;    	   
	movlw	B'00000000'
        movwf	TRISB		;
	movlw	B'11000011'	;
	movwf	OPTION_REG	;1:16 prescaler       
        bcf	STATUS,RP0
	
		
	clrf	Min10
	clrf	Min
	clrf	Sec10
	clrf	Sec
	clrf	Pre_Count
	clrf	In1_New
	clrf	In1_Prev
	clrf	TMR0
	clrf	Start_Status
	clrf	Count_Dir
	
	bsf	INTCON,T0IE
	bsf	INTCON,GIE

Main:
	goto	Main

Table1:
	addwf	PCL,F
		;bafged*c
	retlw	B'11101101'	;0
	retlw	B'10000001'	;1
	retlw	B'11011100'	;2
	retlw	B'11010101'	;3
	retlw	B'10110001'	;4
	retlw	B'01110101'	;5
	retlw	B'01111101'	;6
	retlw	B'11000001'	;7
	retlw	B'11111101'	;8
	retlw	B'11110101'	;9
		
Do_Count:
	btfss	Start_Status,0
	goto	Do_Count_Done
	incf	Pre_Count,F
	movlw	D'250'
	subwf	Pre_Count,W
	btfss	STATUS,Z
	goto	Do_Count_Done
	clrf	Pre_Count
	btfsc	Count_Dir,0
	call	Count_Down

Do_Count_Done:
	return

Count_Down:
	decf	Sec,F			;countdown 
	movlw	H'FF'
	subwf	Sec,W
	btfss	STATUS,Z
	goto	Count_Down_Done
	movlw	D'9'
	movwf	Sec
		
	decf	Sec10,F
	movlw	H'FF'
	subwf	Sec10,W
	btfss	STATUS,Z
	goto	Count_Down_Done
	movlw	D'9'
	movwf	Sec10

	decf	Min,F
	movlw	H'FF'
	subwf	Min,W
	btfss	STATUS,Z
	goto	Count_Down_Done
	movlw	D'9'
	movwf	Min
		
	decf	Min10,F
	movlw	H'FF'
	subwf	Min10,W
	btfss	STATUS,Z
	goto	Count_Down_Done
	movlw	D'9'
	movwf	Min10

	btfss	STATUS,C
	goto	Count_Down_Done
	clrf	Min10
	clrf	Min
	clrf	Sec10
	clrf	Sec

Count_Down_Done:
	movf	Min10,W
	btfss	STATUS,Z
	goto	Down_Done

	movf	Min,W
	btfss	STATUS,Z
	goto	Down_Done

	movf	Sec10,W
	btfss	STATUS,Z
	goto	Down_Done

	movf	Sec,W
	btfss	STATUS,Z
	goto	Down_Done

	clrf	Start_Status

Down_Done:
	return

Int_Routine:
	movwf	W_Temp		;save w_reg
	movf	STATUS,W
	movwf	STAT_Temp	;save status_reg
	bcf	STATUS,RP0	;select bank0
	btfsc	INTCON,T0IF	;test if TMR0 interupt flag is set
	call	Do_TMR0
	movf	W_Temp,W	;restore w_reg
	movf	STAT_Temp,W	
	movwf	STATUS		;restore status_reg
	retfie

Do_TMR0:
	movlw	D'6'
	movwf	TMR0
	bcf	INTCON,T0IF	;enable TMR0 interupt
	call	Read_Key
	call	Do_Count
	call	Display
	return

Display:
	bsf	PORTA,0		;Turn off Sec Digit
	bsf	PORTA,1		;Turn off Sec10 Digit
	bsf	PORTA,2		;Turn off Min Digit
	bsf	PORTA,3		;Turn off Min10 Digit

Disp_Min10:
	btfss	Disp_Sel,0
	goto	Disp_Min10_Done
	movf	Min10,W
	call	Table1
	xorlw	H'FF'
	movwf	PORTB
	bcf	PORTA,3
			
Disp_Min10_Done:
	nop

Disp_Min:
	btfsc	Disp_Sel,0
	goto	Disp_Min_Done
	movf	Min,W
	call	Table1
	xorlw	H'FF'
	movwf	PORTB
	bcf	PORTA,2
			
Disp_Min_Done:
	nop

Disp_Sec10:
	btfss	Disp_Sel,0
	goto	Disp_Sec10_Done
	movf	Sec10,W
	call	Table1
	xorlw	H'FF'
	movwf	PORTB
	bcf	PORTA,1
			
Disp_Sec10_Done:
	nop

Disp_Sec:
	btfsc	Disp_Sel,0
	goto	Disp_Sec_Done
	movf	Sec,W
	call	Table1
	xorlw	H'FF'
	movwf	PORTB
	bcf	PORTA,0
			
Disp_Sec_Done:
	nop

	incf	Disp_Sel,F
	return

Read_Key:					;keypad/pushbutton
	bsf	PORTA,0		;turn off		
	bsf	PORTA,1		;display
	bsf	PORTA,2		;turn off
	bsf	PORTA,3		;display
	bsf	STATUS,RP0	;select bank1
	movlw	B'00001111'
	movwf	TRISB
	bcf	STATUS,RP0	;select bank0
		
Read_Col:
	movlw	B'00010000'
	movwf	PORTB
	movf	PORTB,W
	movwf	In1_New

ChkC1R1:
	btfss	In1_New,0	;push button for inc
	goto	ChkC1R1_Done
	btfsc	In1_Prev,0
	goto	ChkC1R1_Done
		
	incf	Sec,F		;inc Sec (+1)
	movlw	D'10'
	subwf	Sec,W
	btfss	STATUS,Z
	goto	ChkC1R1_Done
	clrf	Sec
	
	incf	Sec10,F		
	movlw	D'6'
	subwf	Sec10,W
	btfsc	STATUS,C
	clrf	Sec10
		
ChkC1R1_Done:
	nop

ChkC1R2:
	btfss	In1_New,1	;push button for clr
	goto	ChkC1R2_Done
	btfsc	In1_Prev,1
	goto	ChkC1R2_Done	
	clrf	Min10		;clear
	clrf	Min	
	clrf	Sec10
	clrf	Sec
			
ChkC1R2_Done:
	nop

ChkC1R3:
	btfss	In1_New,2	;push button for stop
	goto	ChkC1R3_Done	
	btfsc	In1_Prev,2
	goto	ChkC1R3_Done
	clrf	Start_Status	;stop
		
ChkC1R3_Done:
	nop

ChkC1R4:
	btfss	In1_New,3	;push button for start (Counting Decrement)
	goto	ChkC1R4_Done
	btfsc	In1_Prev,3
	goto	ChkC1R4_Done
	bsf	Start_Status,0	;start
	bsf	Count_Dir,0	;decrement
		
ChkC1R4_Done:
	nop

	movf	In1_New,W
	movwf	In1_Prev
	bsf	STATUS,RP0
	movlw	B'00000000'	;make portb all output
	movwf	TRISB
	bcf	STATUS,RP0

Read_Key_Done:
	return

	end





-----notes:

	*4 7 segment display for seconds & Minutes....
	*push buttons for inc(+1),clear,stop,&start


-----bale, ok poh ung s counting nya ng decrement...

-----prob is, pg ng'se'set ng time, e.g. 30sec...db ung sec01 ung unang mg'inc,
kaso, pati ung min01 eh ng'inc din...tendency, pg'ng'start ng countdown,
sabay sila ng decrement...

-----prng 2 pairs of second ung ngyayari...imbes n 0-99min, 2 0-99sec ung
output...


-----aun poh...tnx poh ng madami huh...

-----e'mail agad kita or txt pg ngawan q n ng paraan...tnxtnxtnx tlga...
This article has been dead for over six months. Start a new discussion instead.