BKGDPR in SOPT

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,190件の閲覧回数
barbercolman
Contributor III

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.

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
965件の閲覧回数
bigmac
Specialist III

Hello,

 

I presume that you are using a NPN  bipolar transistor.  If your series resistor to the base of the transistor is much lower than the equivalent pullup resistance, this will effectively be holding the pin at a low state.  You might temporarily remove the transistor connection to confirm whether the operation then becomes normal.

 

A further point to consider is that the current through the pullup will be attempting to switch the NPN transistor to the on state, something that may be operationally undesireable.

 

The best solution is to use a PNP transistor for switching.  The current through the series base resistor will then add to the internal pullup current, and the transistor will remain non-conducting during this initial state.  If the relay you are using operates at a higher voltage than Vdd, you might require that the collector of the PNP transistor drives an additional NPN transistor to switch the relay coil.

 

Regards,

Mac

 

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
966件の閲覧回数
bigmac
Specialist III

Hello,

 

I presume that you are using a NPN  bipolar transistor.  If your series resistor to the base of the transistor is much lower than the equivalent pullup resistance, this will effectively be holding the pin at a low state.  You might temporarily remove the transistor connection to confirm whether the operation then becomes normal.

 

A further point to consider is that the current through the pullup will be attempting to switch the NPN transistor to the on state, something that may be operationally undesireable.

 

The best solution is to use a PNP transistor for switching.  The current through the series base resistor will then add to the internal pullup current, and the transistor will remain non-conducting during this initial state.  If the relay you are using operates at a higher voltage than Vdd, you might require that the collector of the PNP transistor drives an additional NPN transistor to switch the relay coil.

 

Regards,

Mac

 

0 件の賞賛
返信