Keil™, An ARM® Company

Discussion Forum

Enable Reset Pin

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
cowwy lander
Posted
20-Jul-2008 23:42
Toolset
None
New! 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 !

Read-Only
Author
Monica Moniker
Posted
21-Jul-2008 01:09
Toolset
None
New! RE: Enable Reset Pin

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.

Read-Only
Author
cowwy lander
Posted
21-Jul-2008 03:58
Toolset
None
New! RE: Enable Reset Pin

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
}

Read-Only
Author
Per Westermark
Posted
21-Jul-2008 04:19
Toolset
None
New! RE: Enable Reset Pin

"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:
http://www.urbandictionary.com/define.php?term=1337+speech

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

What's the magic with the following line?

argc = 62;                          // argc := 62
Read-Only
Author
s bock
Posted
21-Jul-2008 05:08
Toolset
None
New! RE: Enable Reset Pin

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

Next Thread | Thread List | Previous Thread Start a Thread | Settings