This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Enable Reset Pin

Hi,

When I program the chip, I set 8MHz internal clock and Disable RESET pin (as PORT3.6) using the function DISABLE_RESET.
The program is running well, but when I want to reprogram again, I can't enable PORT3.6 as RESET again.
Help me out of this problem !

Parents
  • Hi,

    I am using an 8051 with peripherals.

    my code is this

    
    #include <c:\\compilars\\c51\\include\intel8051\stdio.h>
    #include <c:\\compilars\\c51\\include\misc\chips.h>
    
    #define DISABLE_RESET Set_IO ( PORT3 , 6);
    
    int main ( int argc, char **argv )
    {
      argc = 1;                    // kill the errors ....
      argv = (char **)0;           // .... does it work sometime
    
      initialize();                // initialize the variables
    
      DISABLE_RESET                // disable the reset
    
      for ( argc = 1; argc < 100 ; argc = argc + 1)  // when the code runs
      {                                   // begin
        argv = argv + 1;                  // debugger
        gener8_the_file ();               // write the file
        disable_affectar ();              // does it like the line
      }                                   // end
    
      argc = 62;                          // argc := 62
    
      !DISABLE_RESET ();                  // change the reset code
    }
    
    

Reply
  • Hi,

    I am using an 8051 with peripherals.

    my code is this

    
    #include <c:\\compilars\\c51\\include\intel8051\stdio.h>
    #include <c:\\compilars\\c51\\include\misc\chips.h>
    
    #define DISABLE_RESET Set_IO ( PORT3 , 6);
    
    int main ( int argc, char **argv )
    {
      argc = 1;                    // kill the errors ....
      argv = (char **)0;           // .... does it work sometime
    
      initialize();                // initialize the variables
    
      DISABLE_RESET                // disable the reset
    
      for ( argc = 1; argc < 100 ; argc = argc + 1)  // when the code runs
      {                                   // begin
        argv = argv + 1;                  // debugger
        gener8_the_file ();               // write the file
        disable_affectar ();              // does it like the line
      }                                   // end
    
      argc = 62;                          // argc := 62
    
      !DISABLE_RESET ();                  // change the reset code
    }
    
    

Children
  • "I am using an 8051 with peripherals."

    That wasn't exactly a good specification of what chip you are using.

    Anyway, why do you think that an exclamation mark before your define DISABLE_RESET would make a difference?

    You have to figure out what "Set_IO ( PORT3 , 6);" does, and figure out what the reversal should be.

    An exclamation mark may invert a logic expression, but it will not invert an action...

    By the way: Exactly what does you think that your program does?

    Have you verified that main() gets any argc and argv parameters?

    Exactly how cool is a function named gener8_the_file? 1337!!! Read this link:
    www.urbandictionary.com/define.php

    And generate what file? Do you have a file system?

    What's the magic with the following line?

    argc = 62;                          // argc := 62
    

  • Do you use rechargeable batteries or a power supply? I guess that you have problems with bad batteries. Try some other batteries or charge and discharge your batteries a few times.

    Regards,
    Stephan