Announcement

Collapse
No announcement yet.

Serial Tx buffer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serial Tx buffer

    I am setting up a buffering service for the serial communication. I have managed to set-up a receive buffer, so that the buffer is initialized before each incoming message and I can read the message directly from the buffer without using the serin function. This is all explained in the documentation and works great.

    I would like to do a similar thing also for the transmit buffer. So, I would like to manually prepare a buffer with the data, then assign it to the TX buffer using the com_TXbuffer function, and then MANUALLY set the number of bytes to be transmitted without the use of a serout function. Is there a way to do this?

    This operation can be simply accomplished by specifying another TX buffer and use a serout function in a loop to send each character to the TX buffer, but this takes a lot of time and memory to do an unnecessary job.

  • #2


    I have found a partial workaround for this problem.

    I place all my data to be sent in a buffer. I then use this same buffer as the TX buffer and initialize it using the com_TXbuffer function. The data seems to be retained after the buffer initialization. I then send each character in the buffer to the TX buffer using the serout function. The character is actually read and wrote back to the same location, so the only effect is the increase of the TX count. The advantage of this approach is memory efficiency, because no additional memory buffer is required, but it still requires a lot of processing time, just to set the TX count value.

    The communication seems to work fine, but is this considered to be a 'legal' approach, which will be supported in nest PmmC upgrades as well?

    Comment

    Working...
    X