Menu

#514 RS232 TX on IF1 converts 0x00 to 0x00+0x2a

future
open
nobody
None
5
2026-01-06
2026-01-06
No

I am using v1.6.0 spectrum 48k and interface1, redirecting tx to a fifo "/tmp/tx"

Every time my program writes the value 0x00 to the serial port, it is converted to the two bytes 0x00 + 0x2a.

I have a simple reproducer for z88dk that writes the string "Hello" followed by ascii values 0-31 to the serial port:

===

include <stdio.h></stdio.h>

include <rs232.h></rs232.h>

int main(int argc, char *argv[])
{
int i;

    if (rs232_init() != RS_ERR_OK) {
            return -1;
    }
    if (rs232_params(RS_BAUD_9600, RS_PAR_NONE) != RS_ERR_OK) {
            return -1;
    }

    rs232_put('H');
    rs232_put('e');
    rs232_put('l');
    rs232_put('l');
    rs232_put('o');
    for (i = 0; i < 32; i++) {
            rs232_put(i);
    }
    printf("foo\n");
    return 0;

}

In another console I dump the content of /tmp/tx in hex:
$ xxd /tmp/tx
00000000: 4865 6c6c 6f00 2a01 0203 0405 0607 0809 Hello.*.........
00000010: 0a0b 0c0d 0e0f 1011 1213 1415 1617 1819 ................
00000020: 1a1b 1c1d 1e1f

Discussion


Log in to post a comment.

MongoDB Logo MongoDB