Remote control by location (PIC in Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi E,
hi C,
You appear to be using the same get_val subr for both messages,by finding the csv value.
The two message strings are different in their construction.
Two different get_val subr and csv subr are required,
E
Hi E,
Indoors on a rainy day, is not good for testing GPS DATA.

I think I'll need to separate the two DATA signal as you suggest, where the DATASWITCH would be switched after each process.
(Let me know if that's not clear)
C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi E,
Does the TXT look ok?

The GPS only 'looks' at the RMC NMEA sentence, but should parse the GGA sentence, although in simulation it works ok, also the $BASE works.

C.
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi C,
You appear to be using the same get_val subr for both messages,by finding the csv value.
The two message strings are different in their construction.
Two different get_val subr and csv subr are required,
E
Hi E,
Here is the latest PARSE section. It works in compilation, but not LIVE. Note the DATASWITCH and LEDs
C
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
Just had a thought!

The GPS has a TIME at the beginning of the $GPGGA sentence, could this be used to switch the DATASWITCH?

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi,
But the GPS message is at a 1 second rate anyway.
So get the GPS msg, then at the end of the msg, service the BASE.
E
Hi E,
Yes, I meant use the GPS time plus 'some time' to coincide with after the GPS has been RECEIVED, to TRIGGER BASE. Is this what you are suggesting?

EDIT: With the GPS accurately timed, all of the rest of the time can be left to BASE.
C.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi, [REMOTE RX]

Here is the latest program:

There was a TIMER for SERVO control, but I've removed it by commenting it out (I'll delete it all later once working)

Now I only need an INTERRUPT, for every time a '$' is received from either the GPS or the BASE TX.

I have RC0 and RC1 as SWITCHES for the 5110 SCREEN, and they don't switch, which seems to be something to do with this. (From D/S)

When Timer1 is enabled, the RC1/T1OSI and RC0/ T1OSO/T13CKI pins become inputs. This means the values of TRISC<1:0> are ignored and the pins are read as ‘0’.

Any ideas please. (I have to re-design the PCB soon, and could easily switch from RC0 and RC1 to other PINS if easier.)

All the other modules: GPS.........ALTIMETER.........COMPASS........AND RADIO are talking to the PIC ok, but need some tidying.

[NOTE: If testing in Oshonsoft SIMULATOR, use the $BASE STRING]

C.
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi.
What is TMR1CS value set too.?
E
Hi E,
There's no TMR1CS ! I think this implies TMR1 being used?
Is it possible to have an INTERRUPT without a TIMER?
C.
P.S. I was just looking up your explanation about HSERIN from 2004, I'm still not clear. Don't give up hope:eek:

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi,
If its a 18F4620, this is TMR1CS
View attachment 167384
Hi E,
Am I correct that this still implies there is a TIMER involved, even if behind the scenes.

It got me wondering about the INTERRUPT, and I traced back years, and found that it was added when the MAIN PIC was also dealing with SERVOS. As now the SERVOS are dealt with by another PIC, I tried removing the INTERRUPT, and all TIMERS in the CODE. The program still appears to work, and all MODULES are showing, apart from the 5110 SCREEN. Still the RC0 and RC1 PINS are not working.

A couple of days ago I tried a simple MAIN LOOP with 'only' all of the PORTS TOGGLING. All of the expected PINs switched ON/OFF as expected. Perhaps there's something else in the program that is stopping RC0 and RC1?

C.
 

ericgibbs

Joined Jan 29, 2010
21,452
What is TMR1CS set to '1' or '0'.?

You said you are having problems with TMR1 pins.
When Timer1 is enabled, the RC1/T1OSI and RC0/ T1OSO/T13CKI pins become inputs. This means the values of TRISC<1:0> are ignored and the pins are read as ‘0’.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
What is TMR1CS set to '1' or '0'.?

You said you are having problems with TMR1 pins.
When Timer1 is enabled, the RC1/T1OSI and RC0/ T1OSO/T13CKI pins become inputs. This means the values of TRISC<1:0> are ignored and the pins are read as ‘0’.
Hi E,
To clarify: I'm using RC0 and RC1 for RESET and DATA/COMMAND switches on the 5110 SCREEN, these two PINs are not switching.
The only way to get them to switch was by writing a simple program where only TOGGLING all of the PORTs in a LOOP.
It seems that something in the program is stopping them. NOTE: NO TIMER or INTERRUPT CODE, in this case.

Later I thought about it and realised that the TIMER was for SERVO/GPS/BASE instruction INTERRUPTING use. Since then I've added a SWITCH between GPS and BASE RX, and a second PIC for the SERVOS.

I just tried the program without INTERRUPT or TIMER, and it seems to work ok (I'll check again) However the RC0 and RC1 are still not switching.
C.
 

ericgibbs

Joined Jan 29, 2010
21,452
hi jjw,
Thank you answering the question I have asked twice, with no response.:)
E

@camerart
Unless you are using Timer1 to count External input pulses, set TMR1CS =0, then you can access RC0 andRC1
E
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,837
hi jjw,
Thank you answering the question I have asked twice, with no response.:)
E
hi jjw,
Thank you answering the question I have asked twice, with no response.:)
E

@camerart
Unless you are using Timer1 to count External input pulses, set TMR1CS =0, then you can access RC0 andRC1
E
Hi E and J,
J, Thanks for being my eyes, I couldn't see T1CON.

E, When I removed the TIMER and INTERRUPT I missed the T1CON T2CON and T3CON. With those removed the program appears to be working ok, and RC0 and RC1 are now switching. I'll look closer tomorrow, and try again to get the 5110 working.
Thanks, C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,837
Hi All,
A milestone has been reached! All of the modules including LCD screen are now working :) Thanks to all that helped so far, much appreciated.

Here is the latest program: (REMOTE)

Next I'm switching to the BASE PCB.
I'm hoping to add a [ 360P/R AB phase Incremental Rotary Encoder ] for channel 3 (Mode 2) as a Compass. When the BASE compass is turned, then the REMOTE turns to that bearing.
C.
 

Attachments

Top