Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Oshonsoft INTERRUPT test

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
I have been having problems with the INTERRUPT section of a program, so had to have another go at improving it. I'm not a confident programmer, so would like anyone to test it on their simulator please.

It PARSEs out VARIABLES from these type of sentences, entered into the SEND STRING of the Hardware UART:

$GPRMC,123519,A,4807.038,N,01131.000,W,W*6A? [STRTIM, STRLAT, STRLON]
$QEIDEG,123,W [QEIDEG]
$REMOTE,12,20,50,W [remvolt,remalt,remdist],?

Cheers, Camerart.
 

Attachments

  • 18LF4620 8MHz XTL BASE PCB_4 INTERRUPT-PARSE 290420 0830.txt
    7.3 KB · Views: 361
Seems to work fine..

I tested all three sentences.. The strings seemed to hold the correct data.. It appears that the byte locations of the received data isn't filled..

ie remvolt, remalt.. etc... are not populated..
 
Seems to work fine..

I tested all three sentences.. The strings seemed to hold the correct data.. It appears that the byte locations of the received data isn't filled..

ie remvolt, remalt.. etc... are not populated..
Hi I,
Thanks for testing.

A bit puzzling, as mine does fill the VARIABLES, see screen shot.

Can you describe the error that you're getting please. If you mean when the NMEA sentence is being READ, then that one does run on, but the relevant DATA has been READ by then.
C.
 

Attachments

  • SIM.jpg
    SIM.jpg
    196.5 KB · Views: 348
The strings are filled... But the byte locations are not... ( locations 70 71 and 72...)
Hi I,
I can't remember what REMVOLT, REMALT and REMDIST are for :mad: I'll have to have a think and report back.

Can you explain the You are getting an error on the last character and the serial port is restarting... You'll need a way of clearing err as once set is always set. again please?
C.
 
I'll check it again.. But the OERR flag is set after transmission.. I think I had this before with Oshonsoft.. It still works okay but you cant send twiceuntill the err variable is cleared..
Hi I,
REMVOLT, REMALT and REMDIST aren't necessary at this stage, as this is what the REMOTE might send. i,e, Battery voltage etc I'll remove the VARIABLES.

What happens is there's a DATA switch on the PCB, that switches beteen those 3x $Sentences, and set as they are each PARSED.
Actually all 3x messages will be queued up waiting to RX. Perhaps you could try to simulate that, by joining messages with errors in them, and some correct ones, and put them in the SEND STRING box. See if you get the same as I do.
If it looks ok, then I'll add the MAIN program to it. (I didn't notice the OERR problem.)

EDIT: when the OERR bit is set, do you get [ ERROR ] in the Harware UART?
Thanks,
C.
 
Last edited:
EDIT: when the OERR bit is set, do you get [ ERROR ] in the Harware UART?
Yes but you deal with it...… All I'm saying is.... Once there is an error.. You don't clear it..

Your code said:
If err = 1 Then Hserout "ERROR", CrLf
PIE1.RCIE = 0 'Switch off INTERRUPT

So when there is an error, its final...
 
Yes but you deal with it...… All I'm saying is.... Once there is an error.. You don't clear it..



So when there is an error, its final...
Hi I,
I don't get an error, and you say that it happened before, which is interesting.

I'll try to figure out how to clear it, thanks.
C.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top