+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 25
  1. #1
    Full Member level 4
    Points: 1,795, Level: 9

    Join Date
    Nov 2009
    Location
    Lahore, Pakistan, Pakistan
    Posts
    210
    Helped
    14 / 14
    Points
    1,795
    Level
    9

    8051 hardware problem

    hi....i want to ask a question when i simulate the hex file in protious everything goes fine but when i burn the hex in 8051 and put 89s51 in circuit and at that moment i apply power after that for a very short interval of time all the pins of 8051 goes high and after that it start following the code written inside..a very short pulse i recive at the start is disturbing my circuit and i couldnt find any solution for this..help me...plz

  2. #2
    Member level 5
    Points: 1,442, Level: 8
    debjit625's Avatar
    Join Date
    Aug 2011
    Location
    Blue planet...
    Posts
    90
    Helped
    10 / 10
    Points
    1,442
    Level
    8

    Re: 8051 hardware problem

    Have you provided a proper reset on start up,if not check out the datasheet for proper reset requirements.Or may be their is something wrong in your code so you can try to post it here.

    Good Luck
    Debjit Roy
    __________________
    A man would do nothing,if he waited until he could do it so well,that no one would find fault with what he has done.
    - CARDINAL NEWMAN



  3. #3
    Advanced Member level 5
    Points: 12,636, Level: 26
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Posts
    1,918
    Helped
    411 / 411
    Points
    12,636
    Level
    26

    Re: 8051 hardware problem

    is it like , after reset , the port connected devices behave madly ?



  4. #4
    Full Member level 4
    Points: 1,795, Level: 9

    Join Date
    Nov 2009
    Location
    Lahore, Pakistan, Pakistan
    Posts
    210
    Helped
    14 / 14
    Points
    1,795
    Level
    9

    Re: 8051 hardware problem

    #include
    unsigned char gsm[9]={0,1,2,4,8,16,32,64,128};
    sbit led=P1^1; unsigned int k,i,j,l,m; sbit sw=P3^1;
    void delay()
    {
    TMOD=0x01;
    TL0=0x67;
    TH0=0xFC;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;
    }
    void mdelay(int x)
    {
    for(m=0;m delay();
    }
    void call()
    {

    P1=gsm[4];
    mdelay(1000);
    P1=gsm[0];
    mdelay(500);
    P1=gsm[2];
    mdelay(1000);
    P1=gsm[0];
    }
    void on()
    {
    P1=gsm[0];
    for(j=0;j<5;j++)
    delay();
    P1=gsm[8];
    mdelay(5000);
    P1=gsm[0];
    mdelay(15000);
    }
    void main()
    { P1=0;
    if(sw==1)
    {
    mdelay(50);
    if(sw==1)
    {
    on();
    call();
    while(1);

    }
    }
    }


    __________________________________________________ __
    this is my code i dont know how to apply proper reset at startup....plz tell me how to do that..thnks.

    ---------- Post added at 17:02 ---------- Previous post was at 16:59 ----------

    srizbf no just after powering the circuit device attached to port behave madly for a very short period of time and after that every thing goes fine..and i do ot reset the controler i off the power to reset becuse i ahve no button a this time available..



  5. #5
    Full Member level 4
    Points: 2,628, Level: 11
    Achievements:
    Created Album pictures 7 years registered
    tushki7's Avatar
    Join Date
    Jul 2010
    Location
    india
    Posts
    237
    Helped
    51 / 51
    Points
    2,628
    Level
    11

    Re: 8051 hardware problem

    Ok, Hello aliraza
    which capacitor and resistor value are you using for reset circuit?? use 10µf capacitor and 10k(or 8.2k) resistance?? It is normal for a microcontroller to reset immediately(during which all port are high) after supplying power but for a very very short time!!!



    •   AltAdvertisement

        
       

  6. #6
    Full Member level 4
    Points: 1,795, Level: 9

    Join Date
    Nov 2009
    Location
    Lahore, Pakistan, Pakistan
    Posts
    210
    Helped
    14 / 14
    Points
    1,795
    Level
    9

    Re: 8051 hardware problem

    ya i am using 10k and 10uf capacitor but after applying power ports high for a very very short interval but enough time that in which a relay conected to the circuit actiavte and the circuit attached to the relay activated thats the problem basically.........!!
    how to reset after start up mean powering the ciruit is is it done by coding..??



  7. #7
    Super Moderator
    Points: 260,253, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,447
    Helped
    13829 / 13829
    Points
    260,253
    Level
    100

    Re: 8051 hardware problem

    i apply power after that for a very short interval of time all the pins of 8051 goes high and after that it start following the code written inside
    That's by design of x51 processor and can't be avoided. All port pins, that have an internal pull-up, e.g. P1 will go to high state during power-up and reset. Your external circuit must be designed to deal with this behaviour. In some cases, you may need to invert a signal. Basically, there's no problem if all signals are defined active low.


    4 members found this post helpful.

    •   AltAdvertisement

        
       

  8. #8
    Full Member level 6
    Points: 3,339, Level: 13
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Germany
    Posts
    335
    Helped
    58 / 58
    Points
    3,339
    Level
    13

    Re: 8051 hardware problem

    Upload the schematic for better help...
    "I have no special talents. I am only passionately curious." Albert Einstein

    Regards,
    Embedded_Geek



    •   AltAdvertisement

        
       

  9. #9
    Full Member level 4
    Points: 2,628, Level: 11
    Achievements:
    Created Album pictures 7 years registered
    tushki7's Avatar
    Join Date
    Jul 2010
    Location
    india
    Posts
    237
    Helped
    51 / 51
    Points
    2,628
    Level
    11

    Re: 8051 hardware problem

    ohhh its just fine .. Invert your signal--> you can use transistor(such as bc547,bc548 etc.) for inverting it(basically a not gate).
    What i mean is, use low signal to activate relay and high for normal state(to keep it d-energized)!!! so if it resets, all ports will go high and after that it will remain high due to your code .. there will be a little change in your code and just small addition of transistor in your circuit part!!!

    Good Luck :)


    1 members found this post helpful.

  10. #10
    Full Member level 4
    Points: 1,795, Level: 9

    Join Date
    Nov 2009
    Location
    Lahore, Pakistan, Pakistan
    Posts
    210
    Helped
    14 / 14
    Points
    1,795
    Level
    9

    Re: 8051 hardware problem

    tushki you are right by doing this my problem will be solved...here is the shematics simple oneaa.bmp



  11. #11
    Full Member level 5
    Points: 3,305, Level: 13
    Achievements:
    7 years registered

    Join Date
    Feb 2008
    Location
    Turkiye
    Posts
    259
    Helped
    60 / 60
    Points
    3,305
    Level
    13

    Re: 8051 hardware problem

    If it is a very short duration that your port is pulled up, may be you can connect a small capacitor which will not effect your port set/reset time so much.
    It can keep IO port pulled low for a moment at the start up. But just a workaround, not much recommended.



  12. #12
    Full Member level 4
    Points: 1,795, Level: 9

    Join Date
    Nov 2009
    Location
    Lahore, Pakistan, Pakistan
    Posts
    210
    Helped
    14 / 14
    Points
    1,795
    Level
    9

    Re: 8051 hardware problem

    emresel i havent try this yet first i try this then i tell you that my problem solved or not have you try this or not...??



  13. #13
    Full Member level 4
    Points: 2,628, Level: 11
    Achievements:
    Created Album pictures 7 years registered
    tushki7's Avatar
    Join Date
    Jul 2010
    Location
    india
    Posts
    237
    Helped
    51 / 51
    Points
    2,628
    Level
    11

    Re: 8051 hardware problem

    It is power on reset..Actually what happens is When power is turned on the(capacitor and resistor) circuit holds the rst pin high for an amount of time that depends on the capacitor value and the rate at which it charges..
    (aa.bmp)Thats the schematic for reset circuit it will work fine but it is incomplete .. if u want to reset your microcontroller of your own add a tack switch as shown below :-
    Click image for larger version. 

Name:	ioi84.jpg 
Views:	13 
Size:	11.2 KB 
ID:	60196



  14. #14
    Full Member level 5
    Points: 3,305, Level: 13
    Achievements:
    7 years registered

    Join Date
    Feb 2008
    Location
    Turkiye
    Posts
    259
    Helped
    60 / 60
    Points
    3,305
    Level
    13

    Re: 8051 hardware problem

    Hi aliraza;
    During start up capacitor begins to chare up and your port voltage level change slowly. Hopefully your cct will not be trigged during this time. And then your software takes the exact controls on the IO ports. (by the way put port control commands at very early stage of your code, just at the beginning if possible).That is the idea.
    It needs some trial and error to determine correct cap value, a kind of optimisation. Becasue that capacitor (form your port to gnd) also delay any port set/reset signal always (during run time). So if your applicaiton is so time critical one, it may disturb the applciaiton.
    At the end you should try, see and decide. But best solutiın is hardware inverter.
    Good luck



  15. #15
    Full Member level 5
    Points: 1,583, Level: 9

    Join Date
    May 2011
    Posts
    246
    Helped
    11 / 11
    Points
    1,583
    Level
    9

    Re: 8051 hardware problem

    where r u from ali raza? i know it is not forum to ask you but it is important for me. If u r from lahore can u plz tell me that what is the price of 89c51 and 89s51 by atmel at hall road? I have not any electronics background or knowledge but mcu is a point of interest for me these days so i have dome some abc and turn on leds on pic16 mcu as i cant find the even a single chip of any mcu but any crystal in my city sahiwal :-p



  16. #16
    Full Member level 4
    Points: 2,628, Level: 11
    Achievements:
    Created Album pictures 7 years registered
    tushki7's Avatar
    Join Date
    Jul 2010
    Location
    india
    Posts
    237
    Helped
    51 / 51
    Points
    2,628
    Level
    11

    Re: 8051 hardware problem

    Of course emeresel is right . . Yes you can try it, use a capacitor, earlier i too was going to suggest you that but as i did not tried that(but i think it will work) so i told you other method.. if it does not work for you then invert the signal it will definitely work ..
    Good Luck :)



  17. #17
    Full Member level 5
    Points: 1,583, Level: 9

    Join Date
    May 2011
    Posts
    246
    Helped
    11 / 11
    Points
    1,583
    Level
    9

    Re: 8051 hardware problem

    Quote Originally Posted by tushki7 View Post
    It is power on reset..Actually what happens is When power is turned on the(capacitor and resistor) circuit holds the rst pin high for an amount of time that depends on the capacitor value and the rate at which it charges..
    (aa.bmp)Thats the schematic for reset circuit it will work fine but it is incomplete .. if u want to reset your microcontroller of your own add a tack switch as shown below :-
    Click image for larger version. 

Name:	ioi84.jpg 
Views:	13 
Size:	11.2 KB 
ID:	60196
    actually i want some better solution. the problem is brown out . as in pakistan the failure of electricity is as common as you are taking breath but most important to note is that the brown-out is double the time of failure of electricity. and even no one can beleive that the 220 volt ac from main power line also have powerful surges becoz the transformer are old enough to scrap. so one thing is to have big caps in power supply so that the brown out can be ignored . second is that there should be some kind of better network to dischage the capacitor more quickly. as i have told that i have no back ground of science and electronics so may be my question is foolish but i am just asking it for knowledge :p



  18. #18
    Full Member level 4
    Points: 2,628, Level: 11
    Achievements:
    Created Album pictures 7 years registered
    tushki7's Avatar
    Join Date
    Jul 2010
    Location
    india
    Posts
    237
    Helped
    51 / 51
    Points
    2,628
    Level
    11

    Re: 8051 hardware problem

    Hey d@nny,
    Actually i didnt get you? What question are you asking?
    But you are Right thats why large capacitors(about 1000uf.., 2200uf ..) are used in power supply circuit(as in 7805 for 5volt regulated supply) . .
    but for reset circuit you cannot use large values of capacitor. . sorry i didnt get you, plz be more clear!!!



  19. #19
    Full Member level 5
    Points: 1,583, Level: 9

    Join Date
    May 2011
    Posts
    246
    Helped
    11 / 11
    Points
    1,583
    Level
    9

    Re: 8051 hardware problem

    i mean the reset time should be the proper but there should be some thing to descharge the reset capacitor as quickly as possible

    ---------- Post added at 18:27 ---------- Previous post was at 18:26 ----------

    i am using the same 10k and 10uf with ch4013 flipflop but it fails in brownout as the capacitor didnot dishcarge quickly and relay turned on



    •   AltAdvertisement

        
       

  20. #20
    Full Member level 4
    Points: 1,795, Level: 9

    Join Date
    Nov 2009
    Location
    Lahore, Pakistan, Pakistan
    Posts
    210
    Helped
    14 / 14
    Points
    1,795
    Level
    9

    Re: 8051 hardware problem

    danny price of 89s51 and 89c51 or 89s52 is round about under 130 pkr...tushki you mean that i use logic level zero to activate my circuit conected at port instead of using logic level 1...and i coudnt understand the hardware inverter will you kindly post the shematics of hardware invertor...thnks



--[[ ]]--