| ??? 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 ... |



