Introduction: SLCD of K32L2B has the capability to detect shorting between BP to FP but to detect shorting between two adjacent BPs or FPs there isn't any direct method therefore we will leverage the capability of LCD to detect BP to FP short to detect two adjacent BP's short and two adjacent FP's short.
Project Description: There are two separate functions in the attached demo project:
void fault_diffplane(void); ->to detect FP to BP short
void fault_sameplane(void); ->to detect adjacent BP's short and FP's shorts
First step is to initialize an array with all LCD pins number with all BP's grouped together in the array and all FP's pin together inside the same array. This is done just for ease of implementing fault detection logic for both the function.
For eg. LCD_PINS[12]={14,15,59,60,20,24,26,27,40,42,43,44}; //starting 4 are BP & rest are FP
Detecting BP to FP fault is straight forward done using fault_diffplane() function but for fault_sameplane() function we first need to re-initialize the LCD pins as alternate BP and FP pins regardless of the pins being actually FP or BP.
Note: fault_diffplane() can detect shorting between any FP and BP but fault_sameplane() can only detect shorting in between adjacent FP's and adjacent BP's in the LCD_PINS array.
Also fault_sameplane() requires re initialization of LCD pins as alternative BP and FP irrespective of their actual configuration in the application therefore user should carefully use this function(may be in the starting of code) in his application to avoid any problems.
After either of the above fault detection functions are called, the Fault counts are stored in a array
fault_count_difP[]
fault_count_samP[]
User can see the reduction in counts at the respective LCP pin index in the fault_count_difP[] & fault_count_samP[] array when those pins are shorted.
Following is the screen shot of the same when LCD pin 59(BP) is shorted with pin43(FP)
When Pin 59(BP) is shorted with Pin60(BP)
Attached is the reference project tested on FRDM K32L2B development board LCD.
Thanks
Madhur