Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:57 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 Serial Interrupt

Author Message
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 04:08pm 03 Jun 2020
Copy link to clipboard 
Print this post

(I have no real hardware yet so I can't test these things... postal service grrrrr...)

Geoff announced a Micromite beta version on 2018-12-11 that featured the ability to trigger the serial port interrupt routine when a particular character was received.

In reading the CMM2 manual, I see no evidence that this feature has been included. If that is the case, could it be added? Pretty Please?   ;-)

Regards.
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 04:25pm 03 Jun 2020
Copy link to clipboard 
Print this post

Give me an actual  use case and if I can't explain how to do it without then I'll consider it for a later release
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 05:14pm 03 Jun 2020
Copy link to clipboard 
Print this post

There's always a alternate method. :-)

I see it as a matter of efficiency. Many devices send a complete string of information with some sort of termination character. A GPS module was mentioned, with variable line lengths. Thus, an interrupt when, for example, 0x0D (carriage return) arrives instead of for each character, is far more efficient.

In my case, I know a fixed length string will be arriving so the existing method will work fine. Until a single character is lost due to garbled data and the receive buffer gets out of sync. Then extra code is required to check what has happened.

Suppose my serial input string is of the (never changing) format:
"000+000+000+000\r"

I want to extract the 4 values. (numerical value 000-255, last 3 can be + or -) It's not the end of the world if the occasional message is lost. The messages arrive irregularly. I could grab each inbound character, buffer it if it isn't a <CR> and then process the whole thing when <CR> arrives. But that just seems ... inefficient.

Maybe I'm too used to working at the processing limits of tiny chips and should embrace the modern world of over-powered computers and software bloat.  ;-)

Regards.
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 05:31pm 03 Jun 2020
Copy link to clipboard 
Print this post

  Quote  A GPS module was mentioned, with variable line lengths. Thus, an interrupt when, for example, 0x0D (carriage return) arrives instead of for each character, is far more efficient.


The CMM2 contains a fully worked automatic GPS parser

OPEN "COMx:nnnn" as GPS

This is the standard example of why you might want the interrupt feature but the built in code is much more efficient as it automatically breaks out the various fields
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025