While the virtual 80 scrolling is a life saver on the eye using the left right keys to visualize 80 columns on the VDP output; some times you just need 80 columns at a glance. Here is the 8251A keybaord UART TX side redirecting the CON out to TTY via Cloud CP/M. This a free and easy way to get 80 column serial output from Cloud CP/M as well as doing logging and screen scraping. Add debug output to VDP programs for debugging etc. You can still experience the NABU keyboard input too. With SW CP/M 2.2 redirection along with the 8251A HW mod this can be accomplished.
Follow the attached U4 8251 diagram for connections. Connect TxC (pin9) jumper to system's 1.79HMz CLK (pin 20) to provide a baud clock for TX. Serial TX out (pin 19) and the 8251A ground (pin 4) or from another ground source. This mod should be solderable from the top side of the PCB board with very little effort with basic soldering skills. Connection to a +5V compatible USB serial dongle for use with devices that are capable with USB based serial COM port support from the host OS, i.e. Linux/Windows etc. or a RS232C converter for a PC computer or dumb terminal with a DB9 or DB25 connector which usually means RS232C. Using a real ADM3 might be a challenge since the max baud rate is 19.2k baud since this HW mod will only provide 115.k baud. Many VTxxx terminals support faster speeds. (see below for option explanation*) An emulated ADM3 PC based terminal program will handle a wide range of what the USB serial and PC can do.
This mod only runs at 115.2k baud rate (or 111.875k baud to be exact with 1.79 MHz clock) But is close enough for terminal to receive ok at 115.2k baud rate.
*If another baud is needed then the TxC needs to be changed to 16 times the desired baud. For instance a real ADM3 terminal max baud is 19.2K. So a TxC clock needed is 19200 x 16 = 307.200k KHz. This clock is needed instead of 1.79 MHz. The are devices that can be used to generate baud clock with dip switches and some that are programmed via Z80 CTC or other programmable counter/timer chips. The reproduction NABU TX/RX serial card uses a CTC for example.
The example test C code is based on DJ's homebrew bouncy NABU example code on his site along with NABU_LIB on DJ's github NABU repo and z88dk C compiler environment. This could be used to verify the mod or you can just try the CPM redirect. Snippet of the test code is shown below.
To redirect screen output in Cloud CP/M:
stat CON:=TTY:
at the CP/M command line prompt.
1) Write 91h with 05h once (tx enable with rx enable for keyboard continued input)
2) Read keyboard port status 91h for bit 3 to be to 1 (check tx empty).
3) Write char at 90h.
4) back to step 2 to repeat.
Code: Select all
//Once
IO_KEYBOARD_STATUS = 0x05;
//loop
if(*msg_ptr != '\0')
{
if(0x04 & IO_KEYBOARD_STATUS)
{
IO_KEYBOARD = *msg_ptr;
msg_ptr++;
}
}
else
{
if(0x04 & IO_KEYBOARD_STATUS)
{
IO_KEYBOARD = 0x0D; //carriage return
}
if(0x04 & IO_KEYBOARD_STATUS)
{
IO_KEYBOARD = 0x0A; //line feed
msg_ptr = name;
}
}
NABU_U4_8251_TX Github
[youtube][/youtube]
Greg