Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/23/06 13:40
Read: times


 
#112864 - Do you really need to build it?
Responding to: ???'s previous message
Suresh said:
So if possible can you let me know on its suitability to use in the circuit you have given me?

Suresh, in the meanwhile I have given you 3 circuits. This one:




This one:



And this one, also with a complete code:


                    $nomod51
                    $include (89s52.mcu)    

                    org 0
            
                    sjmp begin

                    org 002bh

                                            ;initialize
begin:              mov auxr,#00011001b     ;reset pin is input
                    mov tmod,#00000001b     ;timer 0 in modus 1
                
                                          
                                            ;Total delay is
                                            ;number 'z' (BCD- 
                                            ;switches) times
                                            ;10msec delay of
                                            ;timer 0
                                            
                                            ;reads 'start' and
                                            ;BCD switches

start_pressed?:     clr p1.4                ;strobe watchdog
                    mov c,p0.2              ;read 'start'
                    setb p1.4               ;strobe watchdog

                                            ;'start' pressed?
                    jc start_pressed?       ;No!

                                            ;'start' is pressed:            
                    mov a,p0                ;read "1"
                    swap a                  ;eases layout
                    cpl a                   ;true data
                    anl a,#00001111b        ;low nibble needed
                    mov r0,a                ;store "1" in r0
                    mov a,p2                ;read "10","100"
                    cpl a                   ;true data
                    mov r1,a                ;store it in r1
                    swap a                  ;eases layout
                    anl a,#00001111b        ;low nibble needed
                    mov b,#10               ;load #10 into b
                    mul ab                  ;a = "10" x 10
                    add a,r0                ;add r0 ("1")
                    mov r0,a                ;store it in r0
                    mov a,r1                ;now we need "100"
                    anl a,#00001111b        ;low nibble needed
                    mov b,#100              ;load #100 into b
                    mul ab                  ;a = "100" x 100
                    add a,r0                ;add r0
                    mov r0,a                ;low byte in r0
                    mov a,#0                ;carry?
                    addc a,b                ;add carry to b
                    mov r1,a                ;high byte in r1
                        
                                            ;r1=0?
                    jnz activate_relay      ;r1<>0!

                                            ;r1=0!
                    mov a,r0                ;r0=0?

                    jz start_released?      ;r0=0 and r1=0!
                                            ;means z=0!                     
                               
                                            ;r0<>0 or r1<>0!
                                            ;means z<>0!
activate_relay:     clr p0.0                ;turn on relay

                                            ;initialize timer            
timer_delay:        mov th0,#220            ;reload high byte
                    mov tl0,#15             ;reload low byte
                    setb tr0                ;start timer 0
                    clr p1.4                ;strobe watchdog

                                            ;timer busy?
timer_busy?:        jnb tf0,timer_busy?     ;timer busy!

                                            ;10msec delay over
                    clr tr0                 ;stop timer 0
                    clr tf0                 ;clear overfl. flag
                    setb p1.4               ;strobe watchdog

                                            ;decrement z
                    mov a,r0                ;                
                    clr c                   ;
                    subb a,#1               ;a=r0-1
                    mov r0,a                ;low byte of z=z-1
                                            ;into r0
                    mov a,r1                ;carry?
                    subb a,#0               ;
                    mov r1,a                ;high byte of z=
                                            ;z-1 into r1

                                            ;r1=0?
                    jnz timer_delay         ;r1<>0!

                                            ;r1=0!
                    mov a,r0                ;r0=0?

                    jnz timer_delay         ;r0<>0!

                                            ;r0=0 and r1=0!
                                            ;means z=0!
                    setb p0.0               ;turn off relay

start_released?:    clr p1.4                ;strobe watchdog
                    mov c,p0.2              ;read 'start'
                    setb p1.4               ;strobe watchdog

                                            ;'start' released?
                    jnc start_released?     ;No!

                                            ;'start' released!
                                            ;initialize waiting
                                            ;loop
                    mov r1,#103             ;'start' released
waiting_loop_1:     mov r0,#255             ;for 0.2 sec?
waiting_loop_2:     clr p1.4                ;strobe watchdog
                    mov c,p0.2              ;read 'start'
                    setb p1.4               ;strobe watchdog

                                            ;still released?
                    jnc start_released?     ;No!
                                            
                                            ;still released!
                    djnz r0,waiting_loop_2  ;repeat loop 2

                    djnz r1,waiting_loop_1  ;repeat loop 1

                    ljmp start_pressed?     ;'start' released
                                            ;for at least
                                            ;0.2sec!


                    end


Are you really expecting, that I discuss with you the CD4541 now? Do you really need to build such a dispenser or are you only toying with it?

Kai

List of 39 messages in thread
TopicAuthorDate
Pressing 555 trigger SW continuously.            01/01/70 00:00      
   Again            01/01/70 00:00      
   capacitor couple it.            01/01/70 00:00      
      Re: cap coupling            01/01/70 00:00      
         Look up the internal block diagram            01/01/70 00:00      
            Read the Data Sheet!!            01/01/70 00:00      
      got the o/p            01/01/70 00:00      
         Satisfaction            01/01/70 00:00      
            Thanku steve            01/01/70 00:00      
         Not enough            01/01/70 00:00      
            alternatives ?            01/01/70 00:00      
               Remedy            01/01/70 00:00      
                  remedy?            01/01/70 00:00      
                     Alternatives            01/01/70 00:00      
                  BC550 & diodes            01/01/70 00:00      
                     Try it by yourself, it's simple!            01/01/70 00:00      
                        analysis results            01/01/70 00:00      
                           Analysis            01/01/70 00:00      
                              Thank you            01/01/70 00:00      
                              after the set delay Time            01/01/70 00:00      
                                 Enhanced debouncing            01/01/70 00:00      
                                    What do you think about it, Suresh?            01/01/70 00:00      
   why the neqw thread            01/01/70 00:00      
      reply            01/01/70 00:00      
         Read the Data Sheet!!            01/01/70 00:00      
   kalpak dabir            01/01/70 00:00      
   Have you considered using a 74121?            01/01/70 00:00      
      74121 versus CMOS555            01/01/70 00:00      
      74121 fine for short period delays?            01/01/70 00:00      
         No debounce needed???            01/01/70 00:00      
            Schmitt trigger operation?            01/01/70 00:00      
               Transition times of input signal            01/01/70 00:00      
                  controlling noise related issues            01/01/70 00:00      
                     Schmitt-trigger operation            01/01/70 00:00      
                      CD 4541BC = Alternative for ICM 7555?            01/01/70 00:00      
                        Do you really need to build it?            01/01/70 00:00      
                           Yes.            01/01/70 00:00      
                              try try try again            01/01/70 00:00      
                                 a sign of confidence            01/01/70 00:00      

Back to Subject List