AnsweredAssumed Answered

BKGDPR in SOPT

Question asked by DALE RODDA on May 9, 2012
Latest reply on May 9, 2012 by bigmac

I am running the software validation on a unit that uses the RS08KA1 . We are using PTA3 as an output pin so I had BKGDPE in SOPT cleared. We thought this would make work as a standard output. It appease we did not completely understand section 2.4.3

 

“The background / mode select function is shared with an output-only pin on PTA3 pin and the optional

analog comparator output. While in reset, the pin functions as a mode select pin. Immediately after reset

rises, the pin functions as the background pin and can be used for background debug communication.

While functioning as a background / mode select pin, this pin has an internal pullup device enabled. To use

as an output-only port, BKGDPE in SOPT must be cleared.”

 

We are using PTA3 through a transistor as a relay drive. Some of the time the processor appears to run as normal and part of the time it appears to enters the background mode or at least an undetermined mode.

 

Looking at the PE generated cpu.c code

 

"void _EntryPoint(void)
{

  /*** !!! Here you can place your own code using property "User code before PE initialization" on the build options tab of the CPU compoennt. !!! ***/

  /* ### MC9RS08KA2_8 "Cpu" init code ... */
  /*  PE initialization code after reset */
  /* Common initialization of the write once registers */
  /* SOPT: COPE=1,COPT=1,STOPE=0,??=0,??=0,??=0,BKGDPE=0,RSTPE=0 */
  setReg8(SOPT, 0xC0U);                 
  /* SPMSC1: LVDF=0,LVDACK=0,LVDIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */
  setReg8(SPMSC1, 0x1CU);               
  /*  System clock initialization */
  /* ICSC1: ??=0,CLKS=0,??=0,??=0,??=0,??=0,??=0,IREFSTEN=0 */
  setReg8(ICSC1, 0x00U);               /* Initialization of the ICS control register 1 */
  /* ICSC2: BDIV=3,??=0,??=0,LP=0,??=0,??=0,??=0 */
  setReg8(ICSC2, 0xC0U);               /* Initialization of the ICS control register 2 */

  /*** End of PE initialization code after reset ***/

  /*** !!! Here you can place your own code using property "User code after PE initialization" on the build options tab of the CPU component. !!! ***/

  __asm   jmp _Startup ;               /* Jump to C startup code */

}"

 

 

Does the part check for entering BDM mode before running the _EntryPoint code?  If so does anyone have a recommended output drive circuit?

 

Does onyone know where the entry process for BDM is documented?

Thanks for the help.

Outcomes