RXD last character received

Questions on UARTs, and serial communication
Post Reply
AMDlloydsp
Posts: 99
Joined: Mon Apr 15, 2013 3:51 pm
Location: NE Central FL

RXD last character received

Post by AMDlloydsp »

Bruce,
Is there a memory location for BASIC to sample holding each Uart's last-character-received (so, also, to be able clear it) WITHOUT fetching characters from the RX buffer?

I'd like to be able to ignore messages coming in until a terminating character is received.
Of course, I can fetch them into a local buffer as received, but that's just more overhead code I'd like to avoid.

something like:
If (UART1Lastchr = LF) then
gosub fetch_the_Uart1_buffer
UART1Lastchr = -1
endif
...
go onward
...

Thanks,
Lloyd



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: RXD last character received

Post by basicchip »

No, there is no equivalent of ungetc to a serial channel.

While in theory all that is in memory, there is no standard way to do that between boards, and firmware revisions (though I doubt there will be any firmware versions any time soon).

I've often done the equivalent of gets, and it is not really that much overhead.

AMDlloydsp
Posts: 99
Joined: Mon Apr 15, 2013 3:51 pm
Location: NE Central FL

Re: RXD last character received

Post by AMDlloydsp »

Thanks,
You're right that it's not a lot of additional overhead, but it's some, and although I have tons of code space left, arrays and matrices are bumping me up against my variables limits. I guess I'll have to start storing those in flash, rather than as variables.

I have not looked at all the memory maps of all your processors. If there is any common memory across models, a pointer in common RAM would allow such to be done across all firmware revisions and models of the board (but you knew that <G>). Just a thought for future revs. No big issue.

Lloyd

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: RXD last character received

Post by basicchip »

On the SuperPRO there is a 16K bank of SRAM at &H2007C000 that is not used by BASIC, mainly because it is not contiguous with the SRAM at &H10000000. You can access that through pointers.

One fault I have with NXP is that there is almost no consistency of memory maps between parts.

Post Reply