FLMD0 pin status reading

Hi,

 

Microcontroller - RH850/F1L

Compiler - CS+

Issue : FLMD0 pin is not set high. I have used external pullup resistor 100K at FLMD0 pin and set internal pullup register FLMDCNT

See below code snippet

 

#define WRITE_PROTECTED_REG( reg, val ) (reg) = (val);   /* write value */   \
          (reg) = (~(val));  /* write inversed value */ \
          (reg) = (val);   /* write value */

#define WRITE_FLMDP_REG( reg, val )  do {            \
          FLMDPCMD = 0xA5; /* write to protected reg */ \
          WRITE_PROTECTED_REG ( reg, val )     \
          } while ( FLMDPS != 0 )

 // --- 2) FLMD0 = H;
 #define D_FLMDPUP_L 0x00
 #define D_FLMDPUP_H 0x01
 while ( FLMDCNT != D_FLMDPUP_H )
 {
  
  WRITE_FLMDP_REG ( FLMDCNT, D_FLMDPUP_H );
 }

 #define FPMON  *( (volatile unsigned char *)(0xFFA10000uL) )
 // --- wait for "FPMON.FWE = 1".
 while ( FPMON != 0x80 ) // FPMON.FWE != 1 ?
 {
  __nop();

}

Here FPMON is not set high, So it is  in infinite loop(Bluer colored).But if execute above code snippet using Emulator, FPMON status is HIGH and not in infinite loop.

I am facing this issue quite long time and appreciate if I get any clarification.

 

Thanks,

Sethu