SC126 changed serial speed without my consent!

247 views
Skip to first unread message

Derry UK

unread,
Feb 23, 2022, 10:07:04 AM2/23/22
to retro-comp
I've just restarted using my SC126 again and for a short while yesterday it changed it's serial port B speed from 115200 to 38400 following a reboot. Restarting today it was still at 38400.

I checked the clock speed, OK at 18.45MHz, I reseated the CPU and RomWBW chips, change the serial - USB lead and reinstalled TeraTerm.

If I type C it will start CP/M and likewise for B and BASIC.

Id be quite happy to use 38400 but as you can see some characters are not displayed correctly.

I'm stumped, so any ideas for me to try please?

Derry.
Boot Text.jpg

Derry UK

unread,
Feb 23, 2022, 10:09:41 AM2/23/22
to retro-comp
I should have added I had to change TeraTerms serial settings to 38400 to be able to read the SC126 output.

Mark T

unread,
Feb 23, 2022, 12:56:27 PM2/23/22
to retro-comp
Did you check the serial speed while measuring the crystal frequency. Factor of three out, might be that the 18.45 MHz crystal is running at third overtone but the crystal oscilator is sometimes running at fundamental frequency.

Nick Tate

unread,
Feb 24, 2022, 1:16:43 PM2/24/22
to retro-comp
It does sound like the crystal oscillator being unreliable. There's no way CP/M will suddenly alter the baud rate of the serial port.

Mark T

unread,
Feb 24, 2022, 1:47:43 PM2/24/22
to retro-comp

I’ve only seen the problem with higher frequency crystals, 45MHz to 60MHz running at one third of the frequency as this frequency range uses third overtone and needs an LC filter to block the fundamental frequency. In those cases it was harder to get the crystal to run at the third overtone than the fundamental.

I wouldn’t expect an 18MHz crystal to be a third overtone type, but maybe there is a similar mechanism at work. Possibly the oscillator has too much gain, crystal impedance is lower than expected or some issue with the capacitors loading the crystal.

Wayne Warthen

unread,
Feb 24, 2022, 2:07:36 PM2/24/22
to retro-comp
Is port A still at 115200 baud?

Thanks,

Wayne

Steve Cousins

unread,
Feb 24, 2022, 3:21:33 PM2/24/22
to retro-comp
Hi Derry,

As Wayne has said, RomWBW is still set for 115200 baud, so that suggests a hardware issue.

Mark's comments appear to be assuming the use of a crystal, but SC126 uses a 'can' oscillator. This should rule out 'analogue' issues around the oscillator.

The character corruptions occur during the RomWBW startup sequence which would suggest it is not a software issue. By this, I mean no obscure software has run and messed things up.

The need to change the terminal to 38k baud suggests a major problem with the serial rate. I would suspect the terminal software and/or USB adapter but you appear to have eliminated those.

The character corruptions match what you would see if Tera Term's VT100 emulation's alternative character set is selected. I've seen this happen by random characters being received by the terminal during times such as powering down the Z80/Z180 system. Some combinations of USB adapter and retro hardware can be partially powered by the USB adapter when the main PSU is off. This can cause random characters to be received by the terminal. I've seen this happen lots of times. You can select Tera Term's menu item Control/Reset Terminal to reset the character set. Or you can restart Tera Term. I don't know of a way to set Tera Term to use the alternative character set at startup.
Did the character corruptions occur more than once? or is it every time you try?

As an aside: from BASIC you can select the alternative character set with: print chr$(27);"(0"

So it looks like two problems:
* Term Term is using the alternative character set resulting in some graphics characters being shown instead of lower case characters
* The baud rate of the terminal needs to be set to 38k baud

The baud rate issue seems most likely to be one of these:
* The USB adapter or Tera Term is not working as it should. Apparently already ruled out.
* If the Z180's clock input is 1/3rd of normal you would get the baud rate being 38k baud:
* * A very obscure hardware fault in the Z180 CPU whereby the baud rate generator is not working correctly.
* * A faulty 'can' oscillator, possibly suffering an internal problem along the lines Mark described.

In other words, I really don't know why it appears to be working at 38k baud instead of 115k baud!

Steve


On Wednesday, 23 February 2022 at 15:07:04 UTC giddy...@gmail.com wrote:

horus falcon

unread,
Feb 24, 2022, 3:37:51 PM2/24/22
to retro...@googlegroups.com

I see comments from Steve Cousins and Wayne Warthen pointing to some of the same possible issues I'm mentioning.  Makes me feel like I might be onto something here...


On 2/24/22 12:16, 'Nick Tate' via retro-comp wrote:
It does sound like the crystal oscillator being unreliable. There's no way CP/M will suddenly alter the baud rate of the serial port.

Nature always sides with the unseen flaw.  This might not be CP/M doing anything, but I generally hate saying "there's no way" - it can blind one to the truth of what is.


On Wednesday, 23 February 2022 at 15:07:04 UTC giddy...@gmail.com wrote:
I've just restarted using my SC126 again and for a short while yesterday it changed it's serial port B speed from 115200 to 38400 following a reboot. Restarting today it was still at 38400.
Do you have another USB module?  Might be something going on there?  A simple swap would eliminate that as a source of trouble.


I checked the clock speed, OK at 18.45MHz, I reseated the CPU and RomWBW chips, change the serial - USB lead and reinstalled TeraTerm.

What version of RomWBW are you using?  Earlier versions, I seem to recall, defaulted to a lower baud rate than 115,200 - I thought it was 38,400...  You might try flashing your ROM with the latest stable RomWBW?

Aha!  Found the version cutoff for this behavior in my notes - RomWBW 2.9.2-pre.27 and later default to 115,200, whereas earlier versions default to 38,400.


If I type C it will start CP/M and likewise for B and BASIC.

Id be quite happy to use 38400 but as you can see some characters are not displayed correctly.

That is odd... did you adjust TeraTerm to reflect the new, lower baud rate?  If not, check that both SC126 and your terminal program are set for 8 data bits, 1 stop bit and no parity, and that baud rates match.


I'm stumped, so any ideas for me to try please?

Let's review:

1.)  Check your USB module (swap in a known good one)

2.)  Check your RomWBW version.  If 2.9.2-pre.27, consider an update.

3.)  Check for and reconcile any setup mismatches


Derry.
--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/retro-comp/e4dee43a-19ca-47b2-9f65-d7f92aae3952n%40googlegroups.com.

Derry UK

unread,
Feb 25, 2022, 6:47:01 AM2/25/22
to retro-comp
Thank you all for your input.

At the moment I am leaning towards a broken z180.

A step back. From build, my system has always started at 115,200. One day at switch on TeraTerm (TT) displayed gobbledegook characters, I pressed reset and was back to normal characters. The next day at start up I was back to gobbledegook again with reset making no difference this time. This is the system's current state.

By changing TT serial speed I found that 38,400 gave an almost normal display.

I changed the serial lead and reinstalled TT. No change.

My scope reported that the clock was at 18MHz and the spectrum shows a fundamental at 18MHz also with odd frequency harmonics as expected (for a square wave.)

So, I am sure I have a spare Z180 "somewhere", if only I could find it!

I'll report back after the cpu change.

Derry.

Derry UK

unread,
Mar 4, 2022, 10:22:19 AM3/4/22
to retro-comp
No change.

Replaced Z180, no change, reflashed ROMWBW with SCZ180_126 ver 3.0.1, no change. I switched to SCM S6 in socket 1, that runs at 115,200 with no problems.

So I swapped ROM chips and sockets and although in socked 1 ROMWBW still runs at 38,400 and SCM S6 runs at 115,200 in socket 2, the keyboard text corrunption I was getting at 38,400 has now gone from WBW.

I said previously I would be happy at 38,400 for ROMWBW and now for reasons I do not know I have it!

We live and sometimes don't learn.

<sigh>

Derry.
PS I have inspected my ROM sockets soldering with my x10 and they look OK but I will run a hot iron and flux over the joints just in case .......

Derry UK

unread,
Mar 4, 2022, 11:38:16 AM3/4/22
to retro-comp
Well I am now back to 115,200 with ROMWBW.

What did I do? I inserted a battery for the clock! On reboot I got gobbledegook, set the TT serial port to 115,200, reset the SC126 and back to normal.

Derry.

Wayne Warthen

unread,
Mar 4, 2022, 4:54:31 PM3/4/22
to retro-comp
On Friday, March 4, 2022 at 8:38:16 AM UTC-8 giddy...@gmail.com wrote:
Well I am now back to 115,200 with ROMWBW.

What did I do? I inserted a battery for the clock! On reboot I got gobbledegook, set the TT serial port to 115,200, reset the SC126 and back to normal.

This is very interesting and I now think I can explain why your baud rate switched mysteriously to 38,400.

When an RTC is present (as it is on SC126), RomWBW uses it as an external time reference to dynamically determine the CPU clock speed.  Furthermore, on a Z180 using the internal serial ports, the CPU clock speed is then used to derive the baud rate of the serial ports.  So...

If the RTC was running at a strange speed, then RomWBW would compute the wrong CPU clock speed.  Then it would try to use this incorrect CPU speed to derive the desired baud rate of 115200.  However, if the CPU clock speed is really strange, this is not possible and the baud rate divisor calculation will fail.  When that fails, RomWBW goes into a failsafe mode where it just uses a fixed baud rate divisor which happens to turn out to be 38400 baud for this system.

Apparently, your RTC was running at a very strange speed and you fixed it by inserting a new battery.  The weird RTC speed is confirmed by looking at your screen dump from an earlier message which seems to show a CPU clock speed of about 3 MHz which is way off.

By the way, RomWBW does check for a non-functional RTC.  In that case, it would have programmed the 115200 baud rate correctly.  However, your RTC was just functional enough that RomWBW believed it was working correctly.  This was a very strange scenario and one to be aware of in the future.  I'm sorry I didn't notice the incorrect CPU clock speed listed on your earlier message (although it was somewhat obscured by the character corruption).

Thanks,

Wayne

Derry UK

unread,
Mar 5, 2022, 5:31:51 AM3/5/22
to retro-comp
Thank you Wayne. I was beginning to think I had a Z80 ghost in my machine, it's nice to know not!

Derry.
PS my ghost would be my soldering.
Reply all
Reply to author
Forward
0 new messages