TLE9833 - High-Voltage Monitor Input - not detected

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,
I am using the TLE9833 micro. I have the TLE983x evb board. I have swapped out the TLE9832 for the TLE9833.

I have seen a difference in operation. The example code quicktest did not work correctly. Pressing MON input buttons never gets the response any more.
Below is the main function of the slightly modified code.
See the if-else piece of code for MON1_CTRL_STS -- I always get the else -- button pressed or not. There is nothing wrong with the electrical connection. Pressing the button brings a 0v to the MON1 input, otherwise its 12v

I am not sure if the XSFR() is working correctly? Any ideas?
Thanks
Donal

void main(void)
{
data unsigned int WD_Trig_Time;
data unsigned int count = 0;
data unsigned int count_reset = 0;
data unsigned int tog_count = 0;
data unsigned char mon;
//Select the Memory Bank 0
MEX1 = 0x00; // current = next bank = 0
MEX2 = 0x00; // interrupt = constant bank = 0
MEX3 = 0x0A; // XRAM in bank 2

// switch chip frequency to 40 MHz
#ifdef _40MHZ
SFR_PAGE(_su2, noSST); // switch to page2
PLL_CON |= 0x08; // Set VCOBYP = 1 Bypass VCO
PLL_CON &= 0xFB; // Set OSCDISC = 0 By default it is
// set to 1 upon Power-On RESET

PASSWD = 0x98; // open access to write protected bits
// -- switch NDIV--
PLL_CON &= 0x0F; // Clear previous NDIV value
PLL_CON |= 0x60; // modify NDIV (N = 16)
// --switch K2DIV--
CMCON &= 0xCF; // clear K2DIV (K2 = 0)
// --restart detection of lock--
PLL_CON |= 0x02; // set RESLD bit
// PASSWD = 0xAB; // enable password protection again
WDTCON = 0x00;
while(!(PLL_CON & 0x01)){ // Wait until PLL lock
}

PLL_CON &=0xF7; // Set VCOBYP = 0
AMCLK1_CTRL_STS &=~ 0x03;
AMCLK1_CTRL_STS |= 0x01; // set mi_clk divider to 2
AMCLK2_CTRL_STS &=~ 0x1F;
AMCLK2_CTRL_STS |= 0x09; // set clk_2Mhz divider to 10

SFR_PAGE(_su1, noSST); // switch to page1
NMICON &= ~0x11;
NMICON =0x00;
SFR_PAGE(_su0, noSST);
#endif

SFR_PAGE(_su7, noSST); // switch to page7
COCON = 0xFF; //
SFR_PAGE(_su0, noSST); // switch to page0

Main_Init();



XSFR(LS1_CTRL) = 0x01; // enable LS1
XSFR(LS2_CTRL) = 0x01; // enable LS2

XSFR(MON1_CTRL_STS) = 0x07; // configuration of the MON pins
mon = XSFR(MON1_CTRL_STS);
XSFR(MON2_CTRL_STS) = 0x01;
XSFR(MON3_CTRL_STS) = 0x01;
XSFR(MON4_CTRL_STS) = 0x01; //100111
XSFR(MON5_CTRL_STS) = 0x01;

XSFR(WDT1_TRIG) = WD_TRIG; // WD trigger
WD_Counter = 0; // reset WD counter
WD_Trig_Time = Calc_WD_Trigger(WD_TRIG);// calculation of the WD trigger time


P1_2 = 1;
P0_3 = 1;
while(1){

mon = XSFR(MON1_CTRL_STS);
if((mon & 0x80) == 0x80){ /
P1_2 = 0;
P0_3 = 0;
}
else{
P1_2 = 1; //Always gets here
P0_3 = 1;
}


ET0 = 0; // Disable Timer 0 interrupt
if (WD_Counter>WD_Trig_Time) // WatchDog trigger sent
{
XSFR(WDT1_TRIG) = WD_TRIG; // WD trigger
WD_Counter=0; // reset WD counter
Mon_Counter++;


if (count_reset == 1){
//IO_TogglePin(P1_3); // toggle P1.0 at each WD trigger
count_reset=0;
}

}
ET0 = 1; // Enable Timer 0 interrupt







}
} // End of function main
0 Likes
0 Replies