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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/10/03 14:27
Read: times


 
#45171 - My Approach
Responding to: ???'s previous message
the bible is really interesting..more than a book...this is enough and i think after reading this no need of any other book... intel great Job.

Port Data Change program:-

External Device connected with 8 bits of P2.
keeping in mind what Hans van Pelt in last reply, to make controller execute instruction set if "1" comes and do nothing if "0" should make MOV P2,|00H but if i do this by default 0 comes on P2 and as i was reading the internal architecture which shows each port has a buffer , invertor on each bit with transistor whos collector has a resistor connected with 5 volts, now if by default 0 is written on any Port except P0 which is not internally pull up and external device sent high signal then it can damage the Bits of controller if the current by chance comes High....so it is necessary to keep the bits by defalut High or 1...
is it rite ?


coming back to instruction set for Port data change...

to check port data change;

LOOP:
MOV A,P1
JZ LOOP ; waiting for any High Signal on P2

now finding which bit of P2 is high;

BIT0;
CJNE A,#00000001B,BIT1
SJMP work0 ; program goes to bit p2.0 work

BIT1;
CJNE A,#00000010H,BIT2
SJMP work1 ; program goes to bit p2.1 work

BIT2;
CJNE A,#00000100B,BIT3
SJMP work2 ; program goes to bit p2.2 work

BIT3;
CJNE A,#00001000B,BIT4
SJMP work3 ; program goes to bit p2.3 work

BIT4;
CJNE A,#00010000B,BIT5
SJMP work4 ; program goes to bit p2.4 work

BIT5;
CJNE A,#00100000B,BIT6
SJMP work5 ; program goes to bit p2.5 work

BIT6;
CJNE A,#01000000B,BIT7
SJMP work6 ; program goes to bit p2.6 work

BIT7;
CJNE A,#01000000B,LOOP
SJMP work7 ; program goes to bit p2.7 work

the problem i feel with above patterns is if any other bit is set then ...then i think more checks in the above pattern must be included or suggest other way...

in which bit 1 and 0 status can be checked at the same time and all bit sets or cleared then also ...

List of 33 messages in thread
TopicAuthorDate
Port status and bit status            01/01/70 00:00      
   RE: Port status and bit status            01/01/70 00:00      
      RE: Port status and bit status            01/01/70 00:00      
   RE: Port status and bit status            01/01/70 00:00      
      is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
            RE: is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
            My Approach            01/01/70 00:00      
               RE: My Approach            01/01/70 00:00      
               RE: My Approach            01/01/70 00:00      
               RE: My Approach            01/01/70 00:00      
                  use of interputs for polling            01/01/70 00:00      
                     RE: use of interputs for polling            01/01/70 00:00      
                        RE: use of interputs for polling            01/01/70 00:00      
                           RE: project            01/01/70 00:00      
                              RE: project            01/01/70 00:00      
                                 RE: project            01/01/70 00:00      
                           RE: project            01/01/70 00:00      
                              RE: project            01/01/70 00:00      
                                 how come this happens            01/01/70 00:00      
                                    RE: how come this happens            01/01/70 00:00      
                                       RE: how come this happens            01/01/70 00:00      
                                    RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                       RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                       RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                          RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                    RE: someone Help            01/01/70 00:00      
                                       RE: someone Help            01/01/70 00:00      
   Thankyou            01/01/70 00:00      
      RE: Thankyou            01/01/70 00:00      

Back to Subject List