Finding intermittent faults in PIC PCB Peripherals OSHONSOFT

jjw

Joined Dec 24, 2013
823
Hi J,
I'm getting mixed up now!

The first TERM VIEW showed the odd artifacts coming from the CALLI PCB, the example I've just updated shows an example from another program to illustrate what it should look like.

Here is a screen shot of the CALLI program OSH SIMULATOR. It shows the HSEROUT and should look similar. As it's simulated, there's no DATA.
C
This screenshot is as it should be from the program in #129
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
Multi embrarrasment :oops: When I popped the Radio and rewired another one in, I connected the radio to the next PIN to the TX, sorreeee.

The TERM is working now, but I need to change the program for any tests.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
Interesting!
When I put my hand near to the PCB, the Ghost MOSI moves up/down.

Is this capacitance? How can I correct it?
C
 

jjw

Joined Dec 24, 2013
823
Is it MOSI or MISO?
It looks like the signal is floating.
If the compass is in power down state, MISO could look like that.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
I've cut and pasted the later COMP calculation from a later program, into the CALLI program, where there could be errors now.

The PIC is now running 8x too slow, and not showing the SPI on the Oscillator.

This isn't important, I don't think, as the first program shows what we need for the test, so only check this one if it's felt necessary.
C
 

Attachments

jjw

Joined Dec 24, 2013
823
It is better to hserout the data.
I think the calibration data is individual for each compass module
Hserout the angles without calbration.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
It is better to hserout the data.
I think the calibration data is individual for each compass module
Hserout the angles without calbration.
Hi J,
I just had a quick look at the #148 and can see errors, but I will have to leave some time before changing anything.

The DATA is HSEROUT (see XRAW.LB)

There is only one COMP module.

For proper working the COMP needs calibrating, or it may be out of range.
C.
 

jjw

Joined Dec 24, 2013
823
Hi J,
I just had a quick look at the #148 and can see errors, but I will have to leave some time before changing anything.

The DATA is HSEROUT (see XRAW.LB)

There is only one COMP module.

For proper working the COMP needs calibrating, or it may be out of range.
C.
I don't see any data from #148.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
I don't see any data from #148.
Hi J,
Sorry I've just realised what you meant by "I think the calibration data is individual for each compass module " of course you're correct.
#148 is not working yet, I am just trying to get a calibrated/calculated program to work. (No DATA yet) There are errors in it, e,g, it's running 8x too slow. I'll correct it later if I can.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
This program was working ok, then it 'errored'

Here is a TERM READout showing intermittent firing. This also shows as before but intermittently on the SCOPE.

The MOSI is constant but the MISO at the COMP is intermittent.

I'll check the COMP set-up including the power down state, next.
C
 

Attachments

Last edited:

jjw

Joined Dec 24, 2013
823
This is worse than #143
It has less than 10% sensible values.

This is wrong:
SPICSOn
compss = 0 'CHIP SELECT COMPASS ON
SPISend 0x1f '(16BIT) (FUSE) %000111111 <------
'This is for reading the fuse ROM
SPISend 0x40 '%0001000 POWER DOWN, why??
compss = 1 'CHIP SELECT COMPASS OFF
SPICSOn

Here addr has no starting value.

compss = 0 'CHIP SELECT COMPASS ON
For i = 0 To 18 '5 'READ XYZ Xx2 Yx2 Zx2
SPISend addr
SPIReceive data
compss = 1
WaitUs 10
compss = 0
b(i) = data
addr = addr + 1
Next i
compss = 1 'CHIP SELECT COMPASS OFF

Correct to this:
compss = 0 'CHIP SELECT COMPASS ON
For i = 0 To 18 '5 'READ XYZ Xx2 Yx2 Zx2
addr=0x80 + i
SPISend addr
SPIReceive data
b(i) = data
Next i
compss = 1 'CHIP SELECT COMPASS OFF
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi J,
This is worse than #143
It has less than 10% sensible values.
Hi J,
Corrected hopefully.
-------------------------------------------------
Moved to before MAIN
'WRITE COMPASS SETTINGS
SPICSOn
compss = 0 'CHIP SELECT COMPASS ON
SPISend 0x1f '(16BIT) (FUSE) %000111111
SPISend 0x40 '%0001000 POWER DOWN######WHY##############
compss = 1 'CHIP SELECT COMPASS OFF
SPICSOn
[ I'll check later ]

main: '\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
''If BAUDCON.RCIDL = 1 Then
'Toggle dataswitch 'dataswitch = 1 '0=REMOTE 1=GPS
'Toggle rled
'Toggle yled
'WaitMs 100
''Endif

SPICSOn
For i = 0 To 18 '5 'READ XYZ Xx2 Yx2 Zx2
compss = 0 'CHIP SELECT COMPASS ON
addr = 0x80 + i
SPISend addr
SPIReceive data
b(i) = data
compss = 1 'CHIP SELECT COMPASS OFF
Next i
SPICSOff

wIa_raw = b(0)
info_raw = b(1)
st_1_raw = b(2)

x_raw.LB = b(3) 'BYTE
x_raw.HB = b(4) 'BYTE
y_raw.LB = b(5)
y_raw.HB = b(6)
z_raw.LB = b(7)
z_raw.HB = b(8)

'Hserout "WIA ", #wIa_raw, " ", "INFO ", #info_raw, " ", "XRAW LB ", #x_raw.LB, " ", "XRAW HB ", #x_raw.HB, " ", "YRAW LB ", #y_raw.LB, " ", "YRAW HB ", #y_raw.HB, " ", "ZRAW LB ", #z_raw.LB, " ", CrLf

Hserout "XRAW LB ", #x_raw.LB, " ", "XRAW HB ", #x_raw.HB, " ", "YRAW LB ", #y_raw.LB, " ", "YRAW HB ", #y_raw.HB, " ", "ZRAW LB ", #z_raw.LB, " ", "ZRAW HB ", #z_raw.HB, CrLf
----------------------------------------------------
This still has 'errors'
I re-added SPICSON/OFF, as a test, but no change, I'll leave them there for now.

With COMPSS =X OUTSIDE the FOR and NEXT LOOP, the square wave is good and 3.3V, but only ZRAWHB changes.

With COMPSS = X INSIDE the FOR and NEXT LOOP, the MOSI 'raggy' slope is back but the COMP gives sensible READings, including COMPSS DEG =X

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,842
Hi,
Just realised! We've been talking about the MOSI GHOST. MOSI is fine when connected to the SCOPE.

What all of the MISO images show is the MISO, which has the 'raggy' slope.
C.
 

jjw

Joined Dec 24, 2013
823
Hi J,

Hi J,
Corrected hopefully.
-------------------------------------------------
Moved to before MAIN
'WRITE COMPASS SETTINGS
SPICSOn
compss = 0 'CHIP SELECT COMPASS ON
SPISend 0x1f '(16BIT) (FUSE) %000111111
SPISend 0x40 '%0001000 POWER DOWN######WHY##############
compss = 1 'CHIP SELECT COMPASS OFF
SPICSOn
[ I'll check later ]

main: '\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
''If BAUDCON.RCIDL = 1 Then
'Toggle dataswitch 'dataswitch = 1 '0=REMOTE 1=GPS
'Toggle rled
'Toggle yled
'WaitMs 100
''Endif

SPICSOn
For i = 0 To 18 '5 'READ XYZ Xx2 Yx2 Zx2
compss = 0 'CHIP SELECT COMPASS ON
addr = 0x80 + i
SPISend addr
SPIReceive data
b(i) = data
compss = 1 'CHIP SELECT COMPASS OFF
Next i
SPICSOff

wIa_raw = b(0)
info_raw = b(1)
st_1_raw = b(2)

x_raw.LB = b(3) 'BYTE
x_raw.HB = b(4) 'BYTE
y_raw.LB = b(5)
y_raw.HB = b(6)
z_raw.LB = b(7)
z_raw.HB = b(8)

'Hserout "WIA ", #wIa_raw, " ", "INFO ", #info_raw, " ", "XRAW LB ", #x_raw.LB, " ", "XRAW HB ", #x_raw.HB, " ", "YRAW LB ", #y_raw.LB, " ", "YRAW HB ", #y_raw.HB, " ", "ZRAW LB ", #z_raw.LB, " ", CrLf

Hserout "XRAW LB ", #x_raw.LB, " ", "XRAW HB ", #x_raw.HB, " ", "YRAW LB ", #y_raw.LB, " ", "YRAW HB ", #y_raw.HB, " ", "ZRAW LB ", #z_raw.LB, " ", "ZRAW HB ", #z_raw.HB, CrLf
----------------------------------------------------
This still has 'errors'
I re-added SPICSON/OFF, as a test, but no change, I'll leave them there for now.

With COMPSS =X OUTSIDE the FOR and NEXT LOOP, the square wave is good and 3.3V, but only ZRAWHB changes.

With COMPSS = X INSIDE the FOR and NEXT LOOP, the MOSI 'raggy' slope is back but the COMP gives sensible READings, including COMPSS DEG =X

C.
You have not set the measurement mode.
 
Top