Jul 13, 2012 #1 P pratzz Member level 5 Joined Jun 15, 2012 Messages 83 Helped 6 Reputation 12 Reaction score 6 Trophy points 1,288 Activity points 1,781 Code: clr p3.1 mov p1,#0ffh start: Here1: Cpl p3.1 mov r2,#80 sjmp there1 there1: Mov r1,#5 acall delay djnz r2,there1 sjmp here1 delay: Mov tmod,#01 mov tl0,#0f6h mov th0,0c2h setb tr0 again:jnb tf0,again clr tr0 clr tf0 djnz r1,delay ret end in simulation i have connected led to port 3.1 but it is not blinking. Last edited: Jul 13, 2012
Code: clr p3.1 mov p1,#0ffh start: Here1: Cpl p3.1 mov r2,#80 sjmp there1 there1: Mov r1,#5 acall delay djnz r2,there1 sjmp here1 delay: Mov tmod,#01 mov tl0,#0f6h mov th0,0c2h setb tr0 again:jnb tf0,again clr tr0 clr tf0 djnz r1,delay ret end in simulation i have connected led to port 3.1 but it is not blinking.
Jul 13, 2012 #2 D dean_winchester Advanced Member level 4 Joined Oct 19, 2010 Messages 108 Helped 22 Reputation 44 Reaction score 21 Trophy points 1,298 Location India Activity points 1,813 then you should complement the P3.7 not theP3.1 that you are doing in code.
Jul 13, 2012 #3 P pratzz Member level 5 Joined Jun 15, 2012 Messages 83 Helped 6 Reputation 12 Reaction score 6 Trophy points 1,288 Activity points 1,781 no that was not the mistake , i meant 3.1 only ,sorry for that
Jul 13, 2012 #4 I IanP Advanced Member level 7 Joined Oct 5, 2004 Messages 7,929 Helped 2,311 Reputation 4,624 Reaction score 531 Trophy points 1,393 Location West Coast Activity points 66,416 Without analizing your code, hardwarewise, how did you connect the LED? [C] to the CPU pin and [A] {through a resistor} to Vcc? Keep in mind that there is nothing to drive a load connected between a pin and GND ... :wink: IanP
Without analizing your code, hardwarewise, how did you connect the LED? [C] to the CPU pin and [A] {through a resistor} to Vcc? Keep in mind that there is nothing to drive a load connected between a pin and GND ... :wink: IanP
Jul 13, 2012 #5 P pratzz Member level 5 Joined Jun 15, 2012 Messages 83 Helped 6 Reputation 12 Reaction score 6 Trophy points 1,288 Activity points 1,781 p-side to port and n side to ground,do we require pull ups in 2051?i have never used it before.