Remote control by location (PIC in Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,730
The old bias values were very different from #396.
Is it the same chip and calibrated in the same place?
Hi J,
True.
When I run MAGMASTER, and as I click through the results,the compass output is fluctuating quite a bit. I wondered if this was a problem and it appears, it is. A second program, VIEWER shows before and after results, so it ;looks like I'm going to look closer at the process.

I recall settings on the compass that average the outputs, so maybe this will help.

One problem is, that due to me choosing a recent compass chip, there isn't much online about it, for this type of application.

Also there is a DATA ready PIN, that I've avoided so far, but it's possible, I'm collecting DATA before it's been collected??
C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,730

jjw

Joined Dec 24, 2013
823
Have you done the self test of the chip?
I guess the data rdy should be polled before reading.
Looked some code in the net and all were checking the RDY. It can be done by polling the Rdy pin or by reading a register bit ( check the AK8963C d/s)
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Looked some code in the net and all were checking the RDY. It can be done by polling the Rdy pin or by reading a register bit ( check the AK8963C d/s)
Hi J,
I suppose it's obvious but does 'polling = If RDY = 1 then'

Can you clarify this line please? :To get the angles CW: DEG=360- atn(x, y)
Where does it go in the calculation?

EDIT: I have started a separate post for the setting up of the Compass module here: https://forum.allaboutcircuits.com/threads/setting-up-ak8963c-compass-chip-spi-oshonsoft.158644/
C.
 
Last edited:

jjw

Joined Dec 24, 2013
823
Hi J,
I suppose it's obvious but does 'polling = If RDY = 1 then'

Can you clarify this line please? :To get the angles CW: DEG=360- atn(x, y)
Where does it go in the calculation?

EDIT: I have started a separate post for the setting up of the Compass module here: https://forum.allaboutcircuits.com/threads/setting-up-ak8963c-compass-chip-spi-oshonsoft.158644/
C.
DEG = 360 - atn() goes into your program, where it was
DEG = atn()
It can be done also inside the atn() function.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
I was having a lot of trouble navigating the AK8963C Data sheet, because when I jumped backwards and forwards, I'd forget what I was doing, even though I had marked pages with colours and tags. I have added HYPERLINKS into the D/S for me, which has helped very much, and I hope it helps others.

If I change it I will update it.

See
#254.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi, TRANSMITTER
Just got the program to READ all of the modules and PRINT them on the 5110 screen.
NOTE: The TEMP word has been overwritten by the LON result overflowing, needs curtailing.

Next fit the TX into the TRANSMITTER, then attach the INCREMENTAL ENCODER and STICK POTS
C.
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi, [ TRANSMITTER ]
From another THREAD:
hi,
If you intend calling get_msg at a 0.5Sec interval, where the get_msg data may require a time longer than 0.5S to acquire, you should Disable the TMR1 interrupt.
Then Reload TMR1 and Re-Enable the Interrupt.
Consider having the get_msg outside of the interrupt routine, test for Int_cnt > 7 outside the Int subr.
E


Hi E,
I've yet to figure out how the TMR1 INTERRUPT will be implemented yet.
You may recall that there is a DATA SWITCH on the PCB, the TIMER may switch it over.
Thanks
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
hi,
This what I see.
Please post an example of what you see, also the actual $ strings.
E

View attachment 177947
Hi E,
I had the TIMER set-up in the wrong place, now I've moved it, and replaced the program in #414.

You should now see this: (The $sentences are as you see them)

EDIT: The TIMER is not being used, at the moment.

C.UART.jpg
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
Just had a thought, regarding a kind of SYNCING. The BASE and the REMOTE both have GPS modules, which give the accurate time, I wonder if, as time is precious in the programming sense, that the checking of sentences, could be predicted by implementing this.
C.
 

ericgibbs

Joined Jan 29, 2010
18,849
hi C,
You cannot sync the Base and Remote serial input sources, they are running asynchronously.

The DataSw you have, will select the desired Base or Remote into the UART, but the unselected serial source will not stop sending data, so when you switch the DataSw over, you may have missed part of that unselected message.[ say you are half way thru for example]
You need to read any partial serial message upto the LF code, keep that source selected and wait for the $ for the start of the message you have selected.
This applies to both messages Base and Remote.

E
 
Top