Problem with I2C start
I have 50 and more of the same devices. The main materials found in the device:
- 1 x Display: 2x16 LCD
- 1 x I/O expander for I2C Bus: PCF8574T
- 1 x Regulator: L78M05CDT-TR
- 1 x PIC: PIC16F1765-I/SL
- 1 x Rotary encoder
- 1 x Switch for ON/OFF
The problem is one out of every 10or15 faulty. The LCD doesnt launch correctly. when i close the switch 12 volts applied to the circuit. The most of the devices launching and working perfectly. But a few of them unable to initialize the LCD but rest of the code works fine(Encoder readings, Pwm outputs etc.)
The pic runs PCF8574T. The PCF8574T runs LCD.
All of these devices were manufactured in machine string. They were programmed with the same code at the same time.
- I think, faulty devices cant start I2C with PCF8574T. when i close the switch meaningless characters appear on single line of screen and sliding when i change the values via encoder. Second line is always empty. Normally there should be values that are updated occasionally on both lines of the LCD.
- The interesting one: when i touch the MCLR pin of the pic with tweezers the pic is being reset and that time lcd starts fine. When you on and off the switch the same problem appears. MCLR pin has external pull_ups. On the flawless devices when i touch the MCLR pin the pic does not being reset as expected.
- On faulty devices only when I change the pic and replace with new one and reprogram it the problem goes away. When i change the rest of the components with new ones the problem stands still.
- On faulty devices when i close the switch while MCLR pin of PIC is grounded, lcd backlight turns on as expected and everything waits. when i set high the MCLR same problem occurs, same meaningless slideable chars.. when I reset the PIC same way again but without opening switch this time, problem goes away as I said previously.
- Tried to ramp-up the supply voltage several times while switch is closed ofc. ramp-up from 4V to 12V. some times while ramp-up the pic is reset several times then problem goes away.
Do you think that in such a case do we need to suspect the code or should we look for the solution elsewhere?
Image 1: The regulation
Image 2: The main part of circuit i think its the faulty part
Image 3: yes this is what happens,, this chars can shift right whenever i change a value
Image 4: These are the decoupling and bypass caps located at nearest location to ICs
Image 5: I2C Configuration from MCC
#pragma config FOSC = INTOSC
#pragma config WDTE = OFF
#pragma config PWRTE = OFF
#pragma config MCLRE = ON
#pragma config CP = ON
#pragma config BOREN = ON
#pragma config CLKOUTEN = OFF
#pragma config IESO = ON
#pragma config FCMEN = ON
#pragma config WRT = OFF
#pragma config PPS1WAY = ON
#pragma config ZCD = OFF
#pragma config PLLEN = ON
#pragma config STVREN = ON
#pragma config BORV = LO
#pragma config LPBOR = OFF
#pragma config LVP = OFF
post edited by LenHar - 2020/02/22 05:07:40