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
  • Hello,

    Thank you for your enquiry,

    I am in a position whereby I may be able to provide you with some useful assistance.

    It is, however, unfortunate that you have not included sufficient information in your original post.

    For example, you have neglected to specify what chip you are using or even the architecture of said chip.

    You have also mentioned the use of a function DISABLE_RESET, but have not provided any details as to the intended use of said function.

    Please consider posting more details so that we, the guiding experts, can provide suitable and accurate responses.

    Get on down,

    Monica.

Reply
  • Hello,

    Thank you for your enquiry,

    I am in a position whereby I may be able to provide you with some useful assistance.

    It is, however, unfortunate that you have not included sufficient information in your original post.

    For example, you have neglected to specify what chip you are using or even the architecture of said chip.

    You have also mentioned the use of a function DISABLE_RESET, but have not provided any details as to the intended use of said function.

    Please consider posting more details so that we, the guiding experts, can provide suitable and accurate responses.

    Get on down,

    Monica.

Children
  • 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
    }
    
    

  • "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