Skip to content

romprg for the NEC V25 port#2454

Merged
ghaerr merged 1 commit intoghaerr:masterfrom
swausd:master
Nov 14, 2025
Merged

romprg for the NEC V25 port#2454
ghaerr merged 1 commit intoghaerr:masterfrom
swausd:master

Conversation

@swausd
Copy link
Copy Markdown
Contributor

@swausd swausd commented Nov 14, 2025

Minor changes to the nice 8018x romprg code from @cocus to get it working on my NEC V25 system. Just a "quick and dirty" job, as there is only a small audience for this tool. Made a "how to" for my own reference. May be helpful for others too, so I added it. I can verify that the original version can be used unmodified for SST39SF040 flash ROMs.

Minor changes to the 8018x romprg code to get it working on my NEC V25 system.  Just a "quick and dirty" job, as there is only a smal audience for this tool. Added a "how to" for my own reference. may be helpfull for others to, so I added it.
@ghaerr
Copy link
Copy Markdown
Owner

ghaerr commented Nov 14, 2025

Thanks for testing out this utility and porting it to another platform along with some bug fixes. Cool!

@ghaerr ghaerr merged commit 5731569 into ghaerr:master Nov 14, 2025
Comment thread elkscmd/romprg/main.c
};

void set_baud_rate(uint8_t idx) {
outw(0x8000 | baudrate_compares[idx], PCB_B0CMP); // 38400bps
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to the fact that this is being called with an index of 17, the 38400bps is not true anymore. I think it has jumped to 115200 as well as on the V25

Copy link
Copy Markdown
Contributor Author

@swausd swausd Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cocus, yes you are right. I use 115200 baud. The comment should be deleted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine :) I never tried that baudrate, not sure why though. probably the error rate was high. I forgot :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No errors for me. I use 20 cm to a TTL to USB converter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no no, I meant the error rate due to the baudrate being too off from the actual 115200, due to the crystal I've used on my SBC

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cocus, are you saying the 8018X (and possibly V25) don't map to the baud rate indices setup by termios.h in ELKS?

The IBM PC serial handler in serial-8250.c sets the baud rate using a divisor, and takes two steps to compute a baud rate index:

    /* set baud rate divisor, first lower, then higher byte */
    cflags = port->tty->termios.c_cflag & CBAUD;
    if (cflags & CBAUDEX)
        cflags = B38400 + (cflags & 03);
    divisor = divisors[cflags];

The termios.h value for B38400 is 0000017, which is actually 15 decimal. 17 decimal would correspond to B115200.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, that's probably why I couldn't get 115200 reliable on mine, I've used a 20MHz crystal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cocus, are you saying the 8018X (and possibly V25) don't map to the baud rate indices setup by termios.h in ELKS?

The IBM PC serial handler in serial-8250.c sets the baud rate using a divisor, and takes two steps to compute a baud rate index:

    /* set baud rate divisor, first lower, then higher byte */
    cflags = port->tty->termios.c_cflag & CBAUD;
    if (cflags & CBAUDEX)
        cflags = B38400 + (cflags & 03);
    divisor = divisors[cflags];

The termios.h value for B38400 is 0000017, which is actually 15 decimal. 17 decimal would correspond to B115200.

Right, but in here decimal 17 is being used. 15 was used before

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a pull request to change the comment...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! it was a small nit pick :) It'll probably bite me in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants