Iam using At89c52 and looking for some assembly software help.
a example will really help me to continue on my work.
Suppose,
I have connected Four Door Sensing Device and there out -put is connected with controller
P2.0
P2.1
P2.2
P2.3
Now when ever any door is opened a siren starts to ring for 6 seconds and under two conditions it is turned off:
1) if no one close the door up till 6 seconds,
or
2) the door is closed before 6 seconds.
using crystal of 11.05KOH
in designing software in assembly for 89c52 i only don't understand how to write code for monitoring all doors , if any one of the door is opened also the controller should perform the siren task but also keep on monitoring other ports if a high signals comes on them..
suppose high comes on P2.0 , sirens starts to ring but at the same time or within 6 seconds High also comes on P2.1 and P2.3 then also the controller should starts the siren for these pins and at the same time look which door is need to be disconnected from the siren considering the above mentioned conditions.
I know i have to use timer to keep on monitoring the bits as fast as possible, lets say 10 micro-seconds... after every 10 seconds controller controller should see if any bit is set or not.
i only need help for the monitoring part...?
also if i use timer 0 for monitoring and timer 1 for generating the siren for 6 seconds, can the same timer 1 interrupt be use for the above four doors ...
Like if a door is opened and the next door is opened after 3 seconds of the first door then also the siren should provide same timing for 6 seconds to all doors in case if all doors are opened at the different times...
what i mean to ask is will the same timer 1 will provide 6 seconds interval for different door opening conditions...or is there any other technqiue..
a example will really help me to continue on my work.
Suppose,
I have connected Four Door Sensing Device and there out -put is connected with controller
P2.0
P2.1
P2.2
P2.3
Now when ever any door is opened a siren starts to ring for 6 seconds and under two conditions it is turned off:
1) if no one close the door up till 6 seconds,
or
2) the door is closed before 6 seconds.
using crystal of 11.05KOH
in designing software in assembly for 89c52 i only don't understand how to write code for monitoring all doors , if any one of the door is opened also the controller should perform the siren task but also keep on monitoring other ports if a high signals comes on them..
suppose high comes on P2.0 , sirens starts to ring but at the same time or within 6 seconds High also comes on P2.1 and P2.3 then also the controller should starts the siren for these pins and at the same time look which door is need to be disconnected from the siren considering the above mentioned conditions.
I know i have to use timer to keep on monitoring the bits as fast as possible, lets say 10 micro-seconds... after every 10 seconds controller controller should see if any bit is set or not.
i only need help for the monitoring part...?
also if i use timer 0 for monitoring and timer 1 for generating the siren for 6 seconds, can the same timer 1 interrupt be use for the above four doors ...
Like if a door is opened and the next door is opened after 3 seconds of the first door then also the siren should provide same timing for 6 seconds to all doors in case if all doors are opened at the different times...
what i mean to ask is will the same timer 1 will provide 6 seconds interval for different door opening conditions...or is there any other technqiue..