PDA

View Full Version : Debugging the Vector Graphic Monitor 4.0



MarsMan2020
October 18th, 2015, 09:04 PM
Recently, I acquired a Vector Mindless Terminal to go with my Vector MZ. This allowed me to switch the monitor ROM in my ZCB over from a modified version using the ZCB serial port for the console (helpfully created for me by Mike Deramp in my original thread (http://www.vintage-computer.com/vcforum/showthread.php?40587-Bringing-Up-a-Vector-Graphic-MZ) and based on the VG 4.0C monitor) to the stock Flashwriter II-enabled monitor ROM that was included on my board as I received it.

This monitor boots up and states that it is the "Vector Graphic Monitor 4.0". Not 4.0C or 4.3. Trying to use this monitor with Mike D's PCGET/PCPUT XMODEM transfer programs - the latest versions designed to use the serial port on data port 04h / control port 05h - was not successful. The commands hung. Using the OUTPUT/INPUT commands to send single characters over the serial port did not work either, nor did the "External Communication" dumb terminal mode built into the monitor.

Reviewing the datasheet for the 8251 USART and looking at the source code for the 4.0 monitor (http://maben.homeip.net/static/s100/vector/software/assembler/Vector%20Extended%20Systems%20Monitor%204.0%20User s%20Guide.pdf), I noticed that it is sending three commands to the USARTS to initialize them:
27317

However, the OTPRTS subroutine looks like this:
27318

On the ZCB board, the data port 04h and control port 05h are mirrored on 06h/07h. So when this code sends the same outputs to ports 3, 5, and 7 in parallel, it is actually sending the same command to the USART on the ZCB twice. So instead of receiving 40h (reset), CEh (mode), and 27h (command), the USART on the ZCB recieves 40h (reset 1), 40h (reset 2), 27h (mode), 27h (command), CEh (data out), and CEh (data out). The 27h is being repeated twice and interpreted by the 8521 as BOTH the Mode and Command bytes, leaving the USART in a misconfigured, non-working state.

Looking at the later VG 4.3 Extended System Monitor (http://altairclone.com/downloads/vector_graphic/vector-graphic.info/Manuals/Vector-Monitor-43-LST.pdf) source code, this routine has been put into a loop such that each serial port receives all the reset commands once before moving on to the next:
27319
For the ZCB, this will initialize the USART twice in a row, but the end state will be a correctly initialized port. I can only imagine that the 4.0C monitor (which I couldn't find a PDF listing of) does the same, and the 'C' stands for 'Corrected'.

After figuring this out, I busted out my pad and paper and wrote up a quick routine that I could enter using the monitor PROGRAM feature at FC00, which allowed me to re-initialize the USART properly. Since this is pretty simple stuff and I needed to able to enter it into the monitor manually, I just wrote it out by hand:
27320
After running this routine and then booting into CP/M, PCGET/PCPUT now work perfectly. Since I'd like to keep my system as original as possible, I'll also go ahead and assemble this into a CP/M .COM that I can run to reset the port from inside CP/M without having to enter it into the monitor every time. (I'm not sure if the XTHL instructions which basically act as a delay are needed for my particular ZCB, I included them since I was basically un-rolling the loops from the 4.3 monitor. The last three characters sent to the data port are to test if this all worked by looking for good characters on a serial terminal).

This was a neat bit of debugging. I'm glad I had the terminal and monitor to figure out what was going on and enter the correction, switches and lights would have been kind of a pain.

MarsMan2020
October 18th, 2015, 09:20 PM
Oops - meant to post this in S-100 - not sure if there anyone with admin powers could move it over.

mbbrutman
October 19th, 2015, 07:13 AM
Oops - meant to post this in S-100 - not sure if there anyone with admin powers could move it over.

Done ... and nice job!

deramp5113
October 19th, 2015, 07:32 AM
Good job - sounds like fun!

The typical Vector Graphic MZ configuration used a Bitstreamer II board for I/O which has three serial ports at 2/3, 4/5, and 6/7. In turn, the serial port on the ZCB was then disabled by pulling U2 (or lifting p2 of U2 out of the socket). In this configuration, the initialization you found in the 4.0 monitor would work. So based on your description, I assume you're using the ZCB for serial I/O and don't have a Bitstreamer II installed - correct?

The 4.0 and 4.3 monitor ROMs use the Flashwriter and parallel keyboard for console I/O. The "c" on the 4.0c revision indicates it uses the serial port at 2/3 for console I/O. This is a nomenclature carry-over from the 2.0 monitor series.

If you were previously using a 4.0c ROM and a terminal for console I/O, this would normally not work unless the 4.0c ROM was modified to use port 4/5 instead of 2/3. I've done this in the past - did I do it for your system? I forget a lot of things these days :)

I'll get around to putting up the Vector Graphic section on deramp.com someday soon. I'll include the 4.0c source and the modified 4.0c for ZCB I/O.

Mike

MarsMan2020
October 19th, 2015, 08:24 PM
Good job - sounds like fun!

The typical Vector Graphic MZ configuration used a Bitstreamer II board for I/O which has three serial ports at 2/3, 4/5, and 6/7. In turn, the serial port on the ZCB was then disabled by pulling U2 (or lifting p2 of U2 out of the socket). In this configuration, the initialization you found in the 4.0 monitor would work. So based on your description, I assume you're using the ZCB for serial I/O and don't have a Bitstreamer II installed - correct?

Correct - no Bitstreamer II in this system. It wouldn't surprise me if there was one at one point in time, but it didn't make it to me anyway.


The 4.0 and 4.3 monitor ROMs use the Flashwriter and parallel keyboard for console I/O. The "c" on the 4.0c revision indicates it uses the serial port at 2/3 for console I/O. This is a nomenclature carry-over from the 2.0 monitor series.

If you were previously using a 4.0c ROM and a terminal for console I/O, this would normally not work unless the 4.0c ROM was modified to use port 4/5 instead of 2/3. I've done this in the past - did I do it for your system? I forget a lot of things these days :)

You did make me a custom modified 4.0C ROM - but that was in December 2013. It took me a while to locate a Mindless Terminal for this system.




I'll get around to putting up the Vector Graphic section on deramp.com someday soon. I'll include the 4.0c source and the modified 4.0c for ZCB I/O.

Mike

Cool! Let me know when you do.

deramp5113
October 25th, 2015, 02:04 PM
I have filled out the Vector Graphic section on deramp.com. See the ROMs and ZCB serial links at http://deramp.com/downloads/index.php?dir=vector_graphic%2Fsoftware%2F

Mike

glitch
November 1st, 2015, 08:34 AM
Not entirely relevant, but you can also use the 4.0C monitor in the ZCB by simply rejumpering the ZCB's serial port address. For whatever reason, the ZCB's serial port was designed to appear twice in I/O space, so if you jumper it for 0/1 it appears at 2/3 as well. This has the advantage of making it North Star compatible, and you can plug a North Star monitor ROM in or use North Star DOS and CP/M directly, if you have a North Star controller kicking around.

deramp5113
November 1st, 2015, 09:33 AM
Not entirely relevant, but you can also use the 4.0C monitor in the ZCB by simply rejumpering the ZCB's serial port address. For whatever reason, the ZCB's serial port was designed to appear twice in I/O space, so if you jumper it for 0/1 it appears at 2/3 as well. This has the advantage of making it North Star compatible, and you can plug a North Star monitor ROM in or use North Star DOS and CP/M directly, if you have a North Star controller kicking around.

MarsMan2020 and I looked at that option first, but his goal was to eventually run the system with a FlashWriter and Mindless Terminal. If the ZCB is updated to put the serial port at 0/1 and 2/3, then the ZCB overlays the FlashWriter keyboard input port at 0/1. So in his case, we made a small patch to the 4.0c monitor instead of cutting jumper traces.

Mike

deramp5113
February 7th, 2018, 07:28 PM
I have filled out the Vector Graphic section on deramp.com. See the ROMs and ZCB serial links at http://deramp.com/downloads/index.php?dir=vector_graphic%2Fsoftware%2F

Mike

Updated link for the above information:

I have filled out the Vector Graphic section on deramp.com. See the ROMs and ZCB serial links at http://deramp.com/downloads/vector_graphic/software/

Mike