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

Software reset for Dallas 390 continous mode

Anyone now how can you perform a software reset on a Dallas 390 when it is in continous mode?

The following suggested code does not work.

((void (code *) (void)) 0x000000) ();

I believe this is because I am in continous mode, which uses longer jump instructions than the normal 8051 mode. Continous mode uses 3 address bytes rather than the normal 2.

Parents
  • Sorry I forgot to mention a couple of things
    I had stepped through the assembly of the C code, which I have included.

      1367:     EA=0;           // Disable interrupts
      1368:
    C:0x00FF8A  C2AF     CLR      EA(0xA8.7)
      1369:     TA=0xAA;        //Enable access to ACON
    C:0x00FF8C  75C7AA   MOV      TA(0xC7),#SADDR1(0xAA)
      1370:     TA=0x55;
    C:0x00FF8F  75C755   MOV      TA(0xC7),#0x55
      1371:     ACON=0xF8;      // Set ACON into reset mode (puts processor into normal 8051 mode)
      1372:
    C:0x00FF92  759DF8   MOV      ACON(0x9D),#EIP(0xF8)
      1373:     ((void (code *) (void)) 0x000000) (); // Cause a reboot
    C:0x00FF95  02000000 LJMP     C_STARTUP(C:000000)
    
    This code is pretty much what I had expected and would have written in assembler so I left it in C.

    When you step through the assembly code it correctly jumps to address 0. Once it gets to address 0 the ljmp instruction is interpresetted wrong, and so I suspect this is caused by not being in normal 8051 mode.

    I suspect that the cause of the problem maybe that I had not reset all the SFR's, so I will try and reset them all.

Reply
  • Sorry I forgot to mention a couple of things
    I had stepped through the assembly of the C code, which I have included.

      1367:     EA=0;           // Disable interrupts
      1368:
    C:0x00FF8A  C2AF     CLR      EA(0xA8.7)
      1369:     TA=0xAA;        //Enable access to ACON
    C:0x00FF8C  75C7AA   MOV      TA(0xC7),#SADDR1(0xAA)
      1370:     TA=0x55;
    C:0x00FF8F  75C755   MOV      TA(0xC7),#0x55
      1371:     ACON=0xF8;      // Set ACON into reset mode (puts processor into normal 8051 mode)
      1372:
    C:0x00FF92  759DF8   MOV      ACON(0x9D),#EIP(0xF8)
      1373:     ((void (code *) (void)) 0x000000) (); // Cause a reboot
    C:0x00FF95  02000000 LJMP     C_STARTUP(C:000000)
    
    This code is pretty much what I had expected and would have written in assembler so I left it in C.

    When you step through the assembly code it correctly jumps to address 0. Once it gets to address 0 the ljmp instruction is interpresetted wrong, and so I suspect this is caused by not being in normal 8051 mode.

    I suspect that the cause of the problem maybe that I had not reset all the SFR's, so I will try and reset them all.

Children
No data