How to stop a program HSERIN blocking

jjw

Joined Dec 24, 2013
823
Have you thought about the timings?
I assume, that the remote is sending the controls pretty fast at least 10 times (maybe more, because the servos need to update ~ 50 times) / second.
You have to receive the whole remote message before switching to GPS.
Then the GPS message may be at random phase and you can't wait the start of message before switching to remote.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Have you thought about the timings?
I assume, that the remote is sending the controls pretty fast at least 10 times (maybe more, because the servos need to update ~ 50 times) / second.
You have to receive the whole remote message before switching to GPS.
Then the GPS message may be at random phase and you can't wait the start of message before switching to remote.
Hi J,
I should clarify on each POST, which PCB I'm working on, TRANSMITTER at the moment, this has been for a while now.

The HC-12,AK8963C,BMP280 and 5110 'modules' are all working. Next is to connect the INCREMENTAL ENCODER and STICK/POTS, once this bit of the program is working better. Then it will need to be programmed with the CONTROL section.

Today I upped the clock speed to 32Mhz from the 8MHz XTL, and eliminated the second STRING STR2().

I've tried to stop the HSERIN from blocking for a couple of days, but I can't get GPS INPUTS unless the GPS signal is working inside. (It is today) I can send TEST REMOTE signals (They mean nothing at the moment, even though they look like SERVO DATA) I've set the program for the GPS to switch the DATASWITCH to REMOTE and Visa versa.

Hi I, I also tried HSERGET, which may work, but didn't get clear results. So next I'm going to use an INTERRUPT.

C.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,872
hi C,
First section debug.
E
'TTTTTTTTTTTTTTTTTTTTTTTTTTTT TIMER 1 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
T1CON = %00111101 '1:8
;RD16 =0
:T1RUN=0
;DIV by 8 ,1,1
;T1OSCEN 1= ON "You are not using the T1osc circuit!"
'T1 /SYNC
;INT CLOCK/4
;TMR!ON =1
 

ericgibbs

Joined Jan 29, 2010
18,872
hi C,
There are so many problems.
Please post you TMR1 calculations for a 0.5Sec interval.
E

Dim tmr1word As Word; Declared but not used,

;what is this count value???
TMR1L = 0x00
TMR1H = 0xff

Save System '????????????????????????????????????????????????????????????

PIR1.TMR1IF = 0 'clear the TMR1 IF flag
'int_cntr = int_cntr + 1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Hserout "TMR1 Int Cnt= ", #int_cntr, CrLf%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Hserout "TMR1 test", CrLf '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Goto get_data '< What time period will this take to complete.?

TMR1L = 0xff '0xdc 'what is the count value.?
TMR1H = 0xff '0xf0


Resume
 

ericgibbs

Joined Jan 29, 2010
18,872
hi C,
I would recommend this dev/debug procedure.
Write a TMR1 debug program, just showing the commands for TIMER1, with a Hserout when Interrupt.
E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
I can clear the STR and MSG, but this still shows. I can SEND 'wrong' sentences and block it, how do I clear it?
C.
 

Attachments

Last edited:

ericgibbs

Joined Jan 29, 2010
18,872
hi,
In the real project, the incoming serial will not stop, it will keep sending all its bytes.
However after the first 2Bytes [ which the program may have not Read, the OERR flag will be Set.]
This is why I have OERR test in the program.

For simulation you could write a debug routine that tests if the OERR is set, if so, keep reading and dumping the incoming message until the LF code.
OK?
E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
hi,
In the real project, the incoming serial will not stop, it will keep sending all its bytes.
However after the first 2Bytes [ which the program may have not Read, the OERR flag will be Set.]
This is why I have OERR test in the program.

For simulation you could write a debug routine that tests if the OERR is set, if so, keep reading and dumping the incoming message until the LF code.
OK?
E
Hi E,
Ok, I not quite sure how to do that, but I do have an idea!!

I have re-written the TEST $ sentences, so that both have 'W' Ascii 86 in STR1(37)
HERE is a modified program
________________________________________________________________
$GNRMC,123519,A,4807.038,N,01131.000,W,022.4,084.4,230394,003.1,W*6A?
'$REMOTE,1100,1200,1300,1400,1500,1600W,?_____________________________________________________________

In 'LIVE' tests, as we are WEST of the meridian, the $GNRMC sentence will have 'W' at STR1(37) if it has correctly arrived, and the $REMOTE sentence can also have 'W' EDIT: Then this can be used for check filter.

If the INTERRUPT could OERR be READ? (Also I would TOGGLE the PCB DATASWITCH) 'Say' 1x/SEC.
C.
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,730
hi,
In the real project, the incoming serial will not stop, it will keep sending all its bytes.
However after the first 2Bytes [ which the program may have not Read, the OERR flag will be Set.]
This is why I have OERR test in the program.

For simulation you could write a debug routine that tests if the OERR is set, if so, keep reading and dumping the incoming message until the LF code.
OK?
E
Hi E,
Note #36
I've been testing with corrupt $sentences, and with the OERR in the program, it's possible to block it.

I'm also testing LIVE, and it also blocks, but I don't know what is actually causing this.

I'm guessing that an alternative is needed.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
hi,
What program coding did you use in the REAL test, to clear any blocking of the serial message.?
E
Hi E,
I used the program at #36. I don't know how to stop blocking.

With the TIMER sections in the program, I get the INT image only.
With the TIMER sections commented out of the program I get the NO INT image.

[NOTE: I understand that the TIMER sections are from the other thread and not set-up yet, but just there while I test, before introducing into the program.]

The REMOTE sentences are sent from a TERMINAL/MACRO via a radio, and the NMEA sentences are from a GPS. (Indoor poor signal)

At the bottom of of NO INT are only REMOTE sentences, I think it is blocking here.
C.
 

Attachments

Last edited:
Top