Repeat question: Solving intermittent electronic errors (Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Hi,
I've asked similar questions over the years regarding intermittent errors in electronic circuits, and am puzzled.
Is it me or does everyone suffer from this?
How are these sort of errors found?

I am and have been working with 18F46K20 PIC and at the moment, I'm getting hard to find problems with an AK8963C compass module connected to it.
I have multiple PCBs and multiple AK8963C modules. I've redesigned the PCBs paying attention to Capacitors, also I've redesigned the AK8963C Boards similarly. These boards connect to the PCBs with plug and sockets.

2x PCBs have been electronically and visually checked, to be ok? Both PICs have the same program, outputting the compass resuts to a computer terminal.
PCB1 used to work then stopped giving results, so I used PCB2, this is ok. I can swap the Compass between both PCBs and PCB1 never works and 2 always works.

What can I do?
Cheers, Camerart.
 

dendad

Joined Feb 20, 2016
4,168
What is could be is your design may be running at the limits of the device specs so it is prone to tolerances in the parts. causing problems.
There are many things that can play up.
Look at the timing.
Check for dry joints.
Carefully compare the signals of each board on a scope.

'Tho it does not apply here, we had a real "funny" problem with a batch of boards. The crystal would not oscillate and changing it, the caps and even the processor did not fix the problem.
Needless to say, we were stumped as these boards were stamped with a "Blank Board Tested OK" stamp.
Well, that was the problem! The stamp ink was conductive and they had managed to place it over the tracks to the crystal an all the boards.
Cleaning it off fixed the boards. It took quite a while to find!

So, your problem may be something quite odd too.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,028
What is could be is your design may be running at the limits of the device specs so it is prone to tolerances in the parts. causing problems.
There are many things that can play up.
Look at the timing.
Check for dry joints.
Carefully compare the signals of each board on a scope.

'Tho it does not apply here, we had a real "funny" problem with a batch of boards. The crystal would not oscillate and changing it, the caps and even the processor did not fix the problem.
Needless to say, we were stumped as these boards were stamped with a "Blank Board Tested OK" stamp.
Well, that was the problem! The stamp ink was conductive and they had managed to place it over the tracks to the crystal an all the boards.
Cleaning it off fixed the boards. It took quite a while to find!

So, your problem may be something quite odd too.
Hi D,
I doubt it's dry joints, as I keep testing and re-soldering, just in case.
I doubts it's timing, as I try to compare same with same. And this has happened odd times over the years.
Usually checking signals with a scope, proves ok or not, but why?

I think it is most likely limits of the device. Since posting this, and after checking device PINS to PIC pins previously. For convenience I was using a logic probe, and on the 'error' PCB, the compass results stalled, as I checked. On the 'good' PCB it didn't.

The AK8963C compass chip is tiny, and I wonder if it can deliver enough to switch the PIC inputs.
I'm no expert, and comparing between output/input is a bit out of my skills. They are both 3.3V, so I'll look at the other parameters, and see if I can see anything that could be a problem.

How can device limits be corrected?

Regarding your conductive ink, I can see how this would cause head scratching.
Thanks, C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Can you post the circuit? And some pictures too may help.
Hi D,
Here's a photo and PCB diagram.

It's been a long time since I used Kicad, and the SCH is different, so I may have updated and lost (temporalily) the correct one, so I didn't post it.
C
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Hi,
I've just been trying again with the Oscilloscope, and now find the 'error' PCB shows 1.5V on the SPI MISO track.
I tried a 1K pull-up resistor, no change.
C
 

jjw

Joined Dec 24, 2013
775
Hi,
I've just been trying again with the Oscilloscope, and now find the 'error' PCB shows 1.5V on the SPI MISO track.
I tried a 1K pull-up resistor, no change.
C
I remember, that over two years ago you had similar problem with MISO voltage been about half of the supply voltage.
Was it resolved then?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,028
I remember, that over two years ago you had similar problem with MISO voltage been about half of the supply voltage.
Was it resolved then?
Hi J,
Yes, this is a repeating problem! Each time I try something like redesign the PCB. or the compass board, the problem seems to be solved for a while, then errors arrive, and I've been going over the same old things time and time again.

After the above suggestion to : " Carefully compare the signals of each board on a scope. " I did just that.
As mentioned, I added a pull up resistor, and slowly lowered the resistance, but could see the 0V of the signal also being pulled up, so thinking it could be the AK8963C holding it down, I though it could be the low voltage setting, which switches it to 1.65V. This is controlled by VID, which I have connected to VDD.
I'm going to have a closer look at the D/S, in case I can figure out what's happening.
C
 

jjw

Joined Dec 24, 2013
775
It might be that other SPI devices are pulling down the MISO.
Have you checked the chip selects, shorts between pins, etc
 

ApacheKid

Joined Jan 12, 2015
720
Hi D,
Here's a photo and PCB diagram.

It's been a long time since I used Kicad, and the SCH is different, so I may have updated and lost (temporalily) the correct one, so I didn't post it.
C
Did you make those PCBs yourself and solder those chips onto the pads? That's quite impressive, the last time I made a PCB was in the 1970s using tape and ferric chloride and so on, real mess.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Did you make those PCBs yourself and solder those chips onto the pads? That's quite impressive, the last time I made a PCB was in the 1970s using tape and ferric chloride and so on, real mess.
Hi A,
This has taken quite a few years to develop, with help from all around, especially these types of forums. So I've had a headache for that long :)

Up to a month or so ago, I made the PCBs myself, with laser print, toasted onto 2x side PCB, then Ferric chloride, then I used a chinese site, for these PCBs, then I stuck the components on. The AK8963C was made by me a week or so ago.

I make less of a mess as I watch videos showing how things are done, and hold my breath while doing most of it.
C
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,028
It might be that other SPI devices are pulling down the MISO.
Have you checked the chip selects, shorts between pins, etc
Hi J,
I tested as you suggest, and found the 'error' PCB had much more resistance between the PINs.
I changed the 18F46K20, no difference. As there's not much else on the SPI bus, I removed the 18F4431 PIC, and it has started working.
Well done, stick around :)
Thanks to all.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Hi,
EDIT: I replaced the 4431 PIC, which 'broke' the compass again, it could have been the SPI settings, and now it is working. even so, some of the tests are odd.

I have 2x PCBs shown above plus a FULL PCB with all of the peripherals. 3x 'before' compasses (AK8963C) 2x 'updated' compasses, as shown. 3x compass cables. Lots of cut down test programs, and the last FULL program was a couple of months ago, before all of these tests.

Using different combinations of the above, I get different results, with some parts not working properly.
What next?
C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Hi,
I'm pretty sure that everything is working, but not in the combinations I've tried, and they are infinite.
e,g, I've just recalled, that each compass module needs callibration, so it's possible that if the wrong callibration settings are used, then there may be a divide by zero.

I think I've now got to refine each PCB, each with it's own callibration and try to stop moving peripherals around, also each PCB should have it's own tailored program.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,028
Maybe add an EEPROM to each board for calibration data?
Hi D,
2x of the peripherals use calibration DATA. The program READs the altimiter chip for it's DATA, and the Compass, needs (in my case) a calibration cube, so that it can be oriented in everyway, separately, and gives DATA READings, that I add into the program.
C.
 
Top