numanali Posted March 25, 2010 Report Share Posted March 25, 2010 hi everyone...my friend give me a task to install a an alarm circuit i his little industry.....he gave me instructions that a circuit should alarm after every 30 minutes,and it must only stops when any worker press the button,and when button is pressed the timer must restart ...every time a button is pressed. ckt should acknowledge the computer (data logging) the time button is pressed..so i thought to use at89c2051 for this purpose i have made the ckt prototype....but still some problems are there, i have to design a driver ckt to on the alarm.and i dont know how to do data logging on pc...by rs485...this is the circuit i designed but it didnt run according to program....so modify my prog for other micro controller trainer i have....the program runs fine ....now the modifications i want in my hardware is seven segment display of timer and it wud be better if timer can be set by user inputs through switches... can u guide me what modifications i must do in my circuit..plz help i want to make this thing like professional.ORG 00HMOV SP,#60MOV TMOD,#21H ;TIMER 1 MODE 2, TIMER 0 MODE 1MOV TH1,#-3 ;9600 BAUD RATEMOV SCON,#50H ; SERIAL MODE SPECIFIERPROGR: MOV P1,#00HMOV P3,#00HACALL DELAY;---------------------------------------CANB: MOV TMOD,#01HSETB P1.7 ;BUZZER INDICATOR OFFSETB P1.4 ;ATTENDANCE INDICATOR OFFSETB P1.1 ;SYSTEM BUSY INDICATOR OFFCLR P1.3 ;RELAY OFFSETB P1.0 ;BUZZER ONACALL DELAYCLR P1.0 ;BUZER OFF;----------------------------------------REPEAT: CLR P1.1 ;SYSYTEM BUSY ONACALL DELAY30MSETB P1.1 ;SYSTEM BUSY LED OFFSETB P1.0 ;BUZZER ONSETB P1.3 ;RELAY ONCLR P1.7 ;BUZZER INDIACTOR ONSETB P1.2 ;MAKE P1.2 INPUT PORTSWITCH: JNB P1.2,SWITCHCLR P1.0 ; BUZZER OFFCLR P1.3 ; RELAY OFSETB P1.7; BUZZER INDICATOR OFF;-----------------------------------------------SERIAL: SETB TR1MOV DPTR,#MYDATASER_1: CLR AMOVC A,@A+DPTRJZ REPEATACALL TRANSMITINC DPTRSJMP SER_1TRANSMIT:MOV SBUF,AT_1: JNB TI,T_1CLR TIRET;----------------------------------------DELAY: MOV R4,#100DL1: MOV R5,#200DL2: MOV R6,#200DL3: DJNZ R6,DL3DJNZ R5,DL2DJNZ R4,DL1RET;----------------------------------------DELAY30M:MAIN: MOV R1,#9MAIN1: MOV R2,#200MAIN2: ACALL TIMERDJNZ R2,MAIN2DJNZ R1,MAIN1RETTIMER:BACK: MOV TH0,#4BH ; FOR 50MSMOV TL0,#0FDHSETB TR0TIM: JNB TF0,TIMCLR TR0CLR TF0RETMTDATA : DB 'MACHINE ATTENDED',0;----------------------------------------END Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.