![]() |
Forum Index : Microcontroller and PC projects : CMM2 Serial Interrupt
Author | Message | ||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
(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 KingdomPosts: 10310 |
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: CanadaPosts: 1132 |
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 KingdomPosts: 10310 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |