Finding intermittent faults in PIC PCB Peripherals OSHONSOFT

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi J,
I have a visitor, who understands this sort of thing, and he figured out that our 'error' is caused by high impedance on the MISO BUS, I had already tried a 10K resistor, and he advised 1K, which looks like it's working, I'll re-check and report back
C
 

jjw

Joined Dec 24, 2013
823
Hi J,
I have a visitor, who understands this sort of thing, and he figured out that our 'error' is caused by high impedance on the MISO BUS, I had already tried a 10K resistor, and he advised 1K, which looks like it's working, I'll re-check and report back
C
Did you read #146?
It probably means that the compass is in power down state or the chip select is off.
 

JohnInTX

Joined Jun 26, 2012
4,787
C
I noticed your question on another site re: interference and shielding of the compass against interference. Keep in mind that you can have magnetic interference as well as electrical interference. Any current-carrying wire will have a magnetic field around it that can affect the compass. Changing currents will show up as erratic headings. Twisting the two power wires going to the compass will help to cancel the magnetic field generated by them. The data wires aren't differential but routing them closely with the power will help. Secure the wiring so that the cable run does not move with respect to the compass. Then any errors will be relatively constant and can be calibrated out.

You can find lots of info on this by searching magnetometer installation and calibration. It's a common issue in aircraft systems. Of course, you still have to have the comms right so.. carry on.

Sorry to butt in..
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Did you read #146?
It probably means that the compass is in power down state or the chip select is off.
Hi J,
Yes, I read everything posted.

I don't think the chip is in power down. I'm pretty sure the Chip select is ON, as where the 'raggy' bits are, are where the MOSI is READ.

The 'error' seems in this area though.

I tried a different module with a 1K resistor, but it seems that each module is different, and may need a different value. I doubt that this is true though
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
C
I noticed your question on another site re: interference and shielding of the compass against interference. Keep in mind that you can have magnetic interference as well as electrical interference. Any current-carrying wire will have a magnetic field around it that can affect the compass. Changing currents will show up as erratic headings. Twisting the two power wires going to the compass will help to cancel the magnetic field generated by them. The data wires aren't differential but routing them closely with the power will help. Secure the wiring so that the cable run does not move with respect to the compass. Then any errors will be relatively constant and can be calibrated out.

You can find lots of info on this by searching magnetometer installation and calibration. It's a common issue in aircraft systems. Of course, you still have to have the comms right so.. carry on.

Sorry to butt in..
Hi J2,
It's difficult to tell what exactly is causing this 'intermittent' error.
At the moment the COMP is on a Callibration PCB, with minimum program, while testing. I suppose everything will change when it's inside the transmitter or Model, as there's more peripherals and wiring.

There's a lot to take into consideration with these little blighters, isn't there.

Butt in any time, it all helps.
C
 

jjw

Joined Dec 24, 2013
823
Have you noticed this?

Last phase after reading x,y,z
(4) Read ST2 register (required)
HOFL: Shows if magnetic sensor is overflown or not. “0” means not overflown, “1” means
overflown.
When ST2 register is read, AK8963 judges that data reading is finished. Stored measurement data is
protected during data reading and data is not updated. By reading ST2 register, this protection is released.
It is required to read ST2 register after data reading.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Have you noticed this?

Last phase after reading x,y,z
(4) Read ST2 register (required)
HOFL: Shows if magnetic sensor is overflown or not. “0” means not overflown, “1” means
overflown.
When ST2 register is read, AK8963 judges that data reading is finished. Stored measurement data is
protected during data reading and data is not updated. By reading ST2 register, this protection is released.
It is required to read ST2 register after data reading.
Hi J,
The reason for READing all of the Registers includes READing ST2.
I'm guessing that before the next READ the 'old' DATA has been 'used', which I think is ok.

I looked at the HOFL, and was a bit confused, although I think the scope told me that it doesn't overflow, and if it did it would error, and I would have to average the 'odd' READing, what do you think?
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
It's difficult to know what to do next!

I added a 1K pull up resistor to MISO on COMP 2, and tested it on on CALLI PCB3. The square wave is good (A few 'shapes' but constant) and is a good voltage. The DEG is also good, when rotated.

COMP2 on PCB1 (The MAIN one) shows Square wave good, low voltage and DEG not good. Different board, different lengths of wire and more peripherals.

It's not worth a proper rotation test, as it's not calibrated and needs to be in situ.

Do you think the 'error' is caused by all of these subtle influences, and perhaps I should mount one in it proper place and try to get it working that way. One problem is that we won't know what the actual problem is :(C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
The 5x AK8963C modules, all give different READings, and as I had 'popped' No4 today, I changed the chip, and added a 5K pull up resistor to MISO. It now gives a good 3.3v square wave on CALLI PCB= PCB3 and good MISO output, and DEG=. On PCB 1, it gives a low voltage and bad output.

I'm not sure if the pullup resistor does anything apart from tidy the MISO?

I think it's probably best to get all of the modules to output good signals on PCB3, and if they don't, then change the module. Once this has been done, I'll see why they have low voltage on PCB1. I'll have to modify this 18F4520 program to 18F4620 and change the PINOUTS. The supply voltage is ok.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
I don't understand why it goes to 1.65V.
It is strange, that is exactly half of 3.3V.
Maybe it is floating when the devices are all off.
If Vdd is 3.3V and Vid is connected to it, SO high should be at least 2.64V.
Hi J,
I'm trying to figure out why sometimes the MISO is 1.65V exactly 1/2 of the supply voltage.

I think the MISO voltage is set by a different voltage at VID. VID is connected to 3.3V on all COMPS. There is a line in the D/S that says VID should be <VDD, is this important?

The latest test:
PCB3 CALLI, 1xperipheral COMP. With a new AK8963C:
SCK 3.3V ok, C/S 3.3V ok, MOSI 3.3V ok, MISO 3.3V ok. READ Good

PCB1 All peripherals, same program (modified for different PINs and CHIP) with new AK8963C:
SCK 3.3V ok, C/S 3.3V ok, MOSI 3.3V ok, MISO 1.65V. READ Not good

PCB2 All peripherals, same program (modified for different PINs and CHIP) with new AK8963C:
SCK 3.3V ok, C/S 3.3V ok, MOSI 3.3V ok, MISO 3.3V. READ Good. MISO square wave

While I was testing with PCB2 the MISO voltage went down to 1.65V (as if something 'popped') I tried another COMP and the same. I tried on PCB1 again, and MISO was 3.3V again. When the voltage drops, it doesn't READ.

What's causing the CHIP to change the MISO voltage? (All other SPI voltages 3.3V)
C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,842
I don't see in the D/S, that Vid should be < Vdd
There is said, that it should be from 1.65 to Vdd.
Hi J,
Just found it, then did a search to find this: The [ ≤ ] (less than or equal to) sign.

Learnt something :)
C.



 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
As the MISO is a good square wave, albeit 1.65V, I think I'm going to try a level shifter.

It's possible that there is a problem with the CHIP low voltage level system, maybe static related?

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
Level shifter added to the MISO line COMP2, which now shows 3.3V and outputting sensible READings :)
I'll keep testing.
NOTE: I checked the voltage into the level shifter, and now it is 3.3V.
C
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
I think we've found the problem! (We, being multiple replies on various forums) In #103 the LF version of the 18F4620 was mentioned, then kind of bypassed, but I now think that this is the problem, and only showing with the above situation. I added a level shifter to MISO between the COMP and the PIC, and this seems to have got it working, although this is a kind of sticking plaster.

I've ordered some 18LF4620 PICs, let's hope this solves it.

Thanks, for all of the interesting, but headachy replies.
Cheers, C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
I changed the PCB MAIN PIC with 18LF4620s, which gave much better results, but still intermittent.

Some of the COMPASS peripherals, had slight faults so I repaired them.
I now have 5 working. If the MISO track is cut, the AK8963C gives out 3.3v, but once connected to the 18LF4620, this mostly results in failure. The voltage on the Scope shows 3.3V snapping to 1.65V.

I've got 1x with a MISO 1K pull up, no good.
3x standard no good.
I added a level shifter to the MISO track and this appears to work. I was advised that this is a sticking plaster, and should run without it.

I tried checking the resistance between the MISO line (Disconnected from the AK8963C MISO) and GND, with a digital meter. This shows 33-Ohms at what appears to be the time the COMP is being READ.
C
 
Top