Continue to Site

Help me write a simple Two-Input-AND Gate program in C

Status
Not open for further replies.

Help

Advanced Member level 2
Advanced Member level 2
Joined
Feb 15, 2005
Messages
617
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
7,065
Programming....

Hai....

How to write the program...

i using 16f84, i need to write a simple Two-Input-AND Gate program in C. One of the input is the input from A0 and another is the Clock-Pulse (program - clock-pulse). How to write a program while Clock-Pulse is H then at the same time the input is H then output become H. If Clock-Pulse is L & input is H then output become L.

Anyone can help me.. please............

Thank You.
 

Programming....

hi, the program is in here

org 000
movlw b'00000011'
tris TRISA ;A0,A1 input, A2 out
begin:
btfss PORTA,0
goto out0
btfss PORTA,1
goto out0
goto out1
out0:
bcf PORTA,2
goto begin
out1:
bdf PORTA,2
goto begin
end


i hope that will helps you
 

Re: Programming....

shafee001 said:
hi, the program is in here

org 000
movlw b'00000011'
tris TRISA ;A0,A1 input, A2 out
begin:
btfss PORTA,0
goto out0
btfss PORTA,1
goto out0
goto out1
out0:
bcf PORTA,2
goto begin
out1:
bdf PORTA,2
goto begin
end


i hope that will helps you


Hai.... shafee001,

Tqs for your help.... :), i prefer C language but nevermind i will try it........

Thanks you...
 

Re: Programming....

Put this code into:

// ---- asm code ---
#asm


...


#endasm

and use C ..
 

Re: Programming....

IanP said:
Put this code into:

// ---- asm code ---
#asm


...


#endasm

and use C ..

Thank you.... i will try it..


Can i know the asm code, izit the clock-pluse is generate by asm program???

Added after 7 minutes:

shafee001 said:
hi, the program is in here

org 000
movlw b'00000011'
tris TRISA ;A0,A1 input, A2 out
begin:
btfss PORTA,0
goto out0
btfss PORTA,1
goto out0
goto out1
out0:
bcf PORTA,2
goto begin
out1:
bdf PORTA,2
goto begin
end


i hope that will helps you

hai...

Can you explain me the code.....

Thy.....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top