Remote control by location (PIC in Oshonsoft)

ericgibbs

Joined Jan 29, 2010
21,453
hi,
If your 4431 is not over busy I would do the divide in the 4431, all it is QEIAZA= QIEAZI/4 ....
As QEIAZA is a 16 Bit WORD , the decimal part will be ignored, so eg: QEIAZI = 1437/4 would give a WORD of 359 decimal == 0x0167 ,
then SPI QEIAZA.HB as 0x01 and
then QEIAZI.LB as 0x67.

It is hard to say what the SMP bit change has done, especially when it was working OK before.??
E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi,
If your 4431 is not over busy I would do the divide in the 4431, all it is QEIAZA= QIEAZI/4 ....
As QEIAZA is a 16 Bit WORD , the decimal part will be ignored, so eg: QEIAZI = 1437/4 would give a WORD of 359 decimal == 0x0167 ,
then SPI QEIAZA.HB as 0x01 and
then QEIAZI.LB as 0x67.

It is hard to say what the SMP bit change has done, especially when it was working OK before.??
E
Hi E,
Recalculate,ok.

Since including the Incremental encoder into the 4431 program, it hasn't worked properly, but I didn't notice it at first.
Previous to adding the Incremental encoder I can't be sure, that it was working correctly, because many READings were from the Analyser or the 4431 output, which is not what we're talking about now (MASTER 18F4620) I can check if it's important, but it would be a pain.
C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
I've been looking at the SPI CLK and MISO, both with SMP set to [ 1 ] with an Oscilloscope
Here are 2x images,
1x when 4431 is outputting HB = 0 LB = 1 [ 1_0_1 ]
1x when 4431 is outputting HB = 1 LB = 1 [ 1_1_1 ]

As can be seen the MISO switching is not clean, so when the SMP is changed it can overlap either the HSB of HB or the HSB of the LB.

I'm getting doubtful that the Oshonsoft SPI is accurate enough to use SPI, as it stands.

The reason I want to use SPI between MASTER and SLAVE, is that the UART already has 2x inputs, so I added a switch between them. With the findings above (Unless there are other ideas) I am going to try alternatives to SPI.

During the recent past, I learnt the difference between PIC software and hardware. I'm now wondering if the 4431 SEROUT, can be connected to the 4620 SERIN, for the SPI transfer. does this sound ok?
C
 

Attachments

ericgibbs

Joined Jan 29, 2010
21,453
hi,
This shot is from my LCD Scope, shows the SPI Slave to Master transfer of 359 decimal ie: 0x01 0x67
Note the Data Bit is Read on the high going edge of the clock.
This is from the program I posted for you, so why have you changed the SPI settings.?

Excuse the poor image quality.

E
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi,
This shot is from my LCD Scope, shows the SPI Slave to Master transfer of 359 decimal ie: 0x01 0x67
Note the Data Bit is Read on the high going edge of the clock.
This is from the program I posted for you, so why have you changed the SPI settings.?

Excuse the poor image quality.

E
Hi E,
I don't change anything lightly, but when I got errors, I started changing settings, such as SSPSTAT.SMP to correct this. I have posted all of my findings each time.

Do you have programs from the date the SPI_image was taken, please, so that I can check against?
C.
 

ericgibbs

Joined Jan 29, 2010
21,453
hi,
The image was taken approx 1 hour ago when I re-powered ON my test rig.

You already have a program copy, look thru the programs I have recently posted.
From what you have said you did have that test program running.

E

Update
: Same SPI programs as post #469, just different data
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi,
The image was taken approx 1 hour ago when I re-powered ON my test rig.

You already have a program copy, look thru the programs I have recently posted.
From what you have said you did have that test program running.

E

Update
: Same SPI programs as post #469, just different data
Hi E,
Or could it be #492, which I think look the most recent from you.
C.
 

ericgibbs

Joined Jan 29, 2010
21,453
hi C,
It is not possible answer that question.
SSPM 3,2,1,0 are used to set the condition.
What are bits 3,2,1 set as.?
E


Update:
If you recall we decided to use ss as burst control Enable.
so you want 3,2,1,0 as 0101
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi C,
It is not possible answer that question.
SSPM 3,2,1,0 are used to set the condition.
What are bits 3,2,1 set as.?
E


Update:
If you recall we decided to use ss as burst control Enable.
so you want 3,2,1,0 as 0101
Hi E,
I've transferred #528 programs to my system, hopefully correct:confused:, and commented 'all' of the changes necessary. I haven't included the QEI section yet.

I'm not fully conversant with my Oscilloscope, but the BITs for HB=1 and LB=67 appear occasionally, in the correct place.
C.
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
I need a rest from PIC as SLAVE HWSPI for a while, but if anyone would like me to test modified #532 programs, post them and I'll test and post the results.

In the meantime, I tried using the 'old' SS track, which is now reversed and used as 4431 SLAVE [ SEROUT ] to 4620 MASTER [ SERIN ] to send the AZIMUTH from the Incremental encoder.

The TERM TXT shows 1REV of the Incremental encoder 360DEG.

Here:
EDITED:
C
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi, UPDATE
I've added the AZIMUTH from the 4431 Incremental encoder SERIN to the MAIN PROGRAM on the 4620, which is now working.

Now we have:
AZIMUTH, being sent from the 4431 to the 4620. This is a dialed AZI from an incremental encoder connected to 4431, which will SEND to the REMOTE VIA a radio link, as an instruction.

5x POT INPUTS, These are TRANSMITTER STICK instructions.

TEMP Perhaps compensation??

ALTITUDE The BASE ALTITUDE as reference.

The GPS is intermittent, but is working.

The COMPASS is faulty.

Thanks to all:)

EDIT:
C
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
I've edited #534, hopefully to clarify things a bit.

There are still issues with the COMPASS module, but I tested them on a test rig (For Magmaster) and at first they didn't work, then they suddenly started working again. It's possible the the AK8963C CHIPs reset, but I don't really know?

I'll now re-try them in the MAIN program.

C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi, Re: COMPASS peripheral error.

I've trying different set-ups for the AK8963C COMPASS module, with no affect, so was getting the COMPASS DEG 306.22 error, which is what I get if there is no COMP attached.

I hope that I've found the area that's causing the error? When I disconnect the TRANSMITTER POT INPUTs from the 4620 MAIN PIC, the error goes.

I'll see what I can do to the MAIN program to allow re-connection, so that the COMP works consistently.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
The intermittent COMP error seems to have been caused by my use of the 18L4620, where I should have used 18LF4620. The 'L' version has been working ok at 3.3V, but the addition of the AK8963C COMP has found a chink in the voltage levels, causing this error.

I added a level shifter to the offending MISO track, and this has hopefully 'cured' the problem.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
The level shifter #539 has proved to be a temporary measure, so I've ordered 18LF4620 PICs, which hopefully will be a 'real' fix.
C
 
Top