10 REM *** PROGRAM: MODCHK4.BAS 20 REM *** CUBECENTRAL LABS 2018 30 REM ***SETUP*** 40 Randomize 50 MAX=32766 : REM Set the maximum value for the integers to test 60 REM ***BEGIN LOOP*** 70 B=Int(Rnd*MAX)+1 : REM Create a pair of integers 80 A=Int(Rnd*MAX)+1 90 X=X+1 : REM simply a counter 100 C=A Mod B : REM the problem statement. C should be the "remainder" of when A is divided by B 110 Q=Int(A/B) : REM begins the alternate computation of the modulus, taking just the integer part of the division 120 P=Q*B : REM The result of the previous division is then multiplied by the divisor 130 M=A-P : REM the resulting subtraction of the dividend from the previous multiplication is the "remainder" or modulus 140 D=M : REM simply setting M to D to keep with naming convention 150 If Len(INKEY$) Then Print "CHECK: A=";A;" B=";B;" C=";C;" D=";D;" X=";X : REM print a status when a key is pressed 160 If C<>D Then GOSUB 200 : REM In theory, C should ALWAYS equal D. Always. 170 B=0 : C=0 : D=0 : Q=0 : P=0 : M=0 : REM Set the variables used back to zero, just in case 180 Goto 60 : REM Loop the program forever 190 End 200 REM ***ERROR*** The program should never get here, unless the modulus was computed wrong. 210 REM 220 Print "ERROR! A=";A;" B=";B;" C=";C;" D=";D;" X=";X : REM Show the values of the variables 230 REM STOP 240 Return
Just to be clear, line 150, the “INKEY” line, only checks to see if the user has pressed a key, and if so, print a status report. Otherwise it continues to run by itself, there is no need to press a key. That was simply put in there so that I could check on the system to see if it was still running and not to print out the results of every passed test. Printing every line slowed the program and I didn’t care about successful comparisons, only the failures.
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/f09a682f-7a43-42df-8525-49924c5ebfbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I just tied a version of the MODCHK5 program in ROM BASIC (selecting “basic” from the initial load screen) and there isn’t a modulus operator (A MOD B) in this version of BASIC. Without it, this test is useless. So much for testing it without a IDE/CF adapter.
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Cube Central
Sent: Tuesday, May 29, 2018 11:16
To: LiNC80 <lin...@googlegroups.com>
Subject: [linc80] Re: Modulus Madness
Hi Chris, thank you for running that!
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/0563f428-34fb-4f87-92dd-34d7ab4d8c75%40googlegroups.com.
OK, I now ran it for about 10 minutes with constant input (keyboard repeat <3) without issues. As I need to use the PC for other things,I have put a REM at line 150, and I'm now running it "background" to see if the error triggers.
Just to clarify, so I understand. When I boot my LiNC80 SBC1 I can go into ROM BASIC like so:*BASICMemory top?Z80 BASIC Ver 4.7bCopyright (C) 1978 by Microsoft47811 Bytes freeOkI found a PDF for the manual this version of ROM BASIC is based upon, and there is no mention of a MOD operator (or INKEY$)
Jon –
I would be happy to give a different power supply a try. I have always used the same power supply for all the testing I’ve done. As the power input to the computer is the screw terminals, where would you suggest placing the ferrite choke?
I am using a lab bench power supply at 10V going into something similar to this: https://www.sparkfun.com/products/114 … Which puts out a very nice, steady 5V, with little to no ripple that I could see on the scope. I wanted to use a regulated supply like this rather than straight from the bench power supply as this has reverse polarity and overcurrent protection. This is the same supply that I used to drive IDE/CF adapter cards requiring external power. I also used this same supply on the RC2014 before installing the on-board regulator.
The next step in my testing was going to be switching power supplies, and seeing if the problem persists, so this post is timely.
Please specify the test parameters and what you would like to see and I will make it happen here later today. Cheers!
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Jon Langseth
Sent: Wednesday, May 30, 2018 08:11
To: LiNC80 <lin...@googlegroups.com>
Subject: [linc80] Re: Modulus Madness
That does seem to correlate with my suspicion that this is noise or power-supply induced, but that makes me just as confused about why Steve's build is experiencing errors when it hasn't done so before :(
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/d5e6cd5e-9277-48e0-863d-cb162f2181e7%40googlegroups.com.

Stephan,
20 hours is pretty good! A single memory glitch like that might happen due to a cosmic ray strike. Since this memory isn’t error correcting ECC RAM it is susceptible to interference. If you live at higher altitude, the problem is worse than for those near sea level.
Stay tuned for a post detailing my testing results, which I hope to post later today. Cheers!
-Randal (at CubeCentral)
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/4d984499-cbe9-486a-8b77-c70190cca8d6%40googlegroups.com.
Hi Derry,
If you’re trying to run the MODCHK program, it won’t look like it is doing anything unless you press a key. Would you try that and let me know?
I’m afraid I disagree with you about it not being power supplies. All the testing I’ve done seems to indicate that the power supply is – if not the root cause – a major factor in the failures. All things left the same, the only variable which changed was the power supply which lead to much better outcomes.
And I agree that the cable issue is a puzzle. Right now, I am doing some tests involving the direct-connect IDE CF adapters. As soon as more time has passed I will update my post with the results later today.
I do agree that the failures are seemingly random, as they are not reproduceable by the usual means.
The problem with running the test without a CF card is that one would have to use the supplied ROM BASIC to run the test program. Unfortunately, the version of BASIC on the ROM doesn’t support the MOD operator used in the tests. I’ve considered using a “spinning rust” hard drive, but would need some way to place the CP/M image on it. I purchased an IDE/USB adapter for this purpose but haven’t yet had the opportunity to try it out. When I do, I will for sure post an update.
Thanks for your input and please do let me know if I can help with running the MODCHK test program. Cheers!
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Derry UK
Sent: Sunday, June 3, 2018 09:26
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
I wish I was able to run the basic program and test my system but sadly I do not know how too. Just download and run this basic program leaves me blank at the moment.
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/527e425a-cae8-463e-81ba-d168b6a59b84%40googlegroups.com.
And I agree that the cable issue is a puzzle. Right now, I am doing some tests involving the direct-connect IDE CF adapters. As soon as more time has passed I will update my post with the results later today.
The problem with running the test without a CF card is that one would have to use the supplied ROM BASIC to run the test program. Unfortunately, the version of BASIC on the ROM doesn’t support the MOD operator used in the tests. I’ve considered using a “spinning rust” hard drive, but would need some way to place the CP/M image on it. I purchased an IDE/USB adapter for this purpose but haven’t yet had the opportunity to try it out. When I do, I will for sure post an update.
Derry,
Not to worry, it happens to the best of us!
I’ve not tried different ICs on my board, but would be willing to do so if I knew exactly what other ICs to put in there. Unfortunately, that’s where my experience and knowledge falls a bit short, and would be terrified of guessing. If a Bill of Materials were put together with alternate ICs, I would gladly order them from Mouser or Digi-Key.
Attached, please find MODCHK5.BAS. This one differs from MODCHK4.BAS in that instead of trying random combinations of numbers, it instead loops through integers from 1 to some maximum (set by variable to 32766). This is the one that I’ve been using most recently.
On a related note, I’ve been using the MODCHK program – as you’ve all seen - to weed out what appear to be noise issues, coming from either the Power Supply or the IDE/CF Card Adapter. If this program runs for a good long while without errors, I then move to the more data-intensive “Media Mayhem” program, MM8.BAS (also attached) to determine if the IDE/CF bus and adapter are working well. I’ve found that if the MODCHK program generates errors, then the MM program is sure to fail. The MODCHK program was created due to bizarre errors encountered by earlier MM programs, which used the MOD operator (and the STRING$ function) to generate data to move back and forth from the CF card. I had made an earlier claim about the STRING$ function also not working properly, but I’ve yet to create a program just to test for it (as I did the MODCHK program) – I may do that later this week.
I look forward to seeing what PCB you’ve created and do please let me know if you have any further questions, concerns, or suggestions. Cheers!
-Randal (at CubeCentral)
I saw this posted on the RC2014 group, and thought that it might be of use to you since you said you write Z80 assembler:
https://smallcomputercentral.com/projects/small-computer-workshop/
I’ve played with it some and it looks very full featured, but might be finicky as it is homebrew software. I hope it can help?
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Derry UK
Sent: Tuesday, June 5, 2018 04:14
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
Randal I was just thinking in terms of trying another IC of the same type - just to eliminate the possibility of a flaky IC on your board.
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/fec206f7-5dd5-4c77-bf90-674f209ddbac%40googlegroups.com.
Derry,
Yup, and early on as well. The program had just started and was 4856th iteration of the first loop (B=1). Interestingly, the MOD operator returned the correct value (C=0) but the alternative calculation returned the wrong answer! (D=8).
If you have some time I sure would appreciate you running this a bit longer on your system … either a few hours or five or so errors? I just want to see if the errors are similar to what I get. Thanks!
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/bb178354-2a23-4a6b-898f-5bc536e894a2%40googlegroups.com.
Derry,
I’m sure your BASIC is fine, getting random nonsensical errors is a part of the issue. It is probably a memory location getting randomly changed by the same process that causes the MOD operation to report incorrect values.
Looking at your output now, maybe I see what you are thinking, where C and D are both equal to zero.
I’ve found that this could be BASIC reporting a very small floating point value (I do not wish to get into a discussion of floating point arithmetic here, it’s beyond the scope of the Group, but here are a couple of links)
In either case, the error is valid because if C and D are actually zero, then the comparison of C=D should be true. In the program, an error is reported if C doesn’t equal D.
I would review the program (using LIST in BASIC) and visually compare it to a known good copy to be sure that the program is intact and didn’t get altered when transferred to the SBC1.
(Not sure if you know enough BASIC to do this, but you would start in CPM, load BASIC by typing MBASIC, once there you can “LOAD x:MODCHK5.BAS” where x: is the drive letter. Once loaded you can issue a “LIST” command to view the program.
Please let me know if you have any further questions or concerns, as I am happy to help!! Cheers!
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Derry UK
Sent: Tuesday, June 5, 2018 08:56
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
At the moment I am beginning to think my basic is at fault. I am now getting errors reported where there are none! However I was poking about with my scope probe at the time...........
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/a97d45e5-4dc2-484b-9cee-2a18f503f069%40googlegroups.com.
The real trick would be to see if one of these pulses syncs up with an error in MODCHK.
Unfortunately, I don’t have a scope with dual triggers that would allow me to view a pulse over some limit, but under another. Will have to play around a bit and see if I can find another way of viewing these interim “runt” pulses.
Would it really cause an issue if the voltage is 0.9V below the lower threshold? I’ve been reading some and came across this page which talks about logic signal voltage levels and I’m just not sure a pulse at 1.2V would be outside the noise margin for the gates.
Keep up your investigations, Derry, I am also interested in your findings! Cheers!
-Randal (at CubeCentral)
PS: Jon, you’re not weird.
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Jon Langseth
Sent: Tuesday, June 5, 2018 15:20
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
I may be weird, but seeing your 'scope-trace made me really excited.
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/81bf12fe-3bac-4600-9ce0-6cb86bc91a5e%40googlegroups.com.
Derry,
Thanks for the follow up. I’ve learned the hard way to double check my oscilloscope results, especially if I see something out of the ordinary. So many small variables, like an IC clip, or using a bit longer length of wire, can add up!
You pose an excellent question about where the error might be occurring. I don’t know for sure, but I can infer a bit from the test program results. I first was thinking maybe it was RAM, but I modified the MODCHK program to immediately do the calculation again after encountering an error, and the results are always the correct value. If it were RAM, and somehow a variable was stored or retrieved incorrectly, then doing an operation on that memory location (i.e. variable) would repeatedly give the same error, or at least another incorrect value. Also, sometimes the program will stop with a nonsensical “Syntax Error” on a line that has been executed millions of times before, but if I view that line in the program, all is as it should be. If it were RAM then that program line would be mangled.
As you said, the path between does seem to be the most likely suspect. I think we could rule out the CPU as it is ROM, and an older, well proven architecture. It there was an issue with the CPU I think we would see it in the form of more repeatable errors or more serious ones (including perhaps system hangs). Having data somehow become corrupt somewhere between the RAM and CPU or RAM and other RAM could account for the types of issues we are seeing. Changing the power supplies, thus changing the “noise profile”, would certainly influence the communication paths. This is all my best guess, as I have no direct proof one way or the other.
Hope that helps and if anyone disagrees, please do let me know – I’m always eager to learn something new! Cheers!
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Derry UK
Sent: Wednesday, June 6, 2018 04:27
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
Relax all.
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/cf314783-6a92-4ecb-9555-5d97e9c89fdd%40googlegroups.com.
Derry,
I hadn’t thought about swapping parts with the RC2014, it just didn’t occur to me. Well done!
I’m currently testing yet another different power supply, an old faithful one that I’ve had for decades. I’m also testing a shielded cable to power the SBC1 but it’s too early to report any findings and will update my other post.
I would be more than happy to buy a whole set of ICs from Mouser or Digi-Key if I could get a BOM specifying exactly what to get – as I said, I haven’t the experience to know which ones for sure to get, and am not keen to guess! ;)
Out of curiosity, I wanted to ask what is this “Win10 pc in Yatze” you speak of? Is it an emulator? If you’ve a link that would be very handy as googling for it gets me results for the dice game. Cheers!
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Derry UK
Sent: Wednesday, June 6, 2018 13:58
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
Your second para has just saved me a job Randal, I was going to try a recalculation after error myself.
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/0015561c-323d-48b3-a768-a4055096ca7f%40googlegroups.com.
I presume you use the same supply with your working and non-working boards? If so then the error is with the board, all that is required is another revision and it should solve the problem (he says lightly :-)
Derry,
I’m curious about the oscilloscope used to measure this? I am wondering if we should account for the rise time of the probes as well as the bandwidth of the scope. I remember the following formula from way back, and is applied to the leading edge of a pulse in a dynamic system, related to resistor-capacitor filter time constants and settling time:
Rise time (in seconds) = 0.35/bandwidth (in Hz), or Bandwidth (Hz) = 0.35/rise time(s)
So, for an oscilloscope that has 20 MHz bandwidth:
Rt (s) = 0.35 / 20000000 = 1.75 × 10^-8 (s) = 17.5 ns
… that has 100MHz bandwidth:
Rt (s) = 0.35 / 100000000 Hz = 3.5 × 10^-9 (s) = 3.5ns
… that has 200MHz bandwidth:
Rt (s) = 0.35 / 200000000 Hz = 1.75 × 10^-9 (s) = 1.75ns
Rise time is defined as the time required for a signal to move from 10% to 90% of a rising waveform, so is your scope making that measurement for you? (if so, that’s pretty cool!) I would be suspicious of any result of 4ns even with a 200MHz scope, as that’s nearly half of the rise time of the measuring instrument.
And, of course, we should all make sure we have carefully compensated probes to minimize induced ringing.
Thanks for sharing your measurement, and I will have a look later today at any differences between a signal at the oscillator and at the Z50Bus connector. Cheers!
-Randal (at CubeCentral)
From: lin...@googlegroups.com [mailto:lin...@googlegroups.com] On Behalf Of Derry UK
Sent: Saturday, June 9, 2018 04:45
To: LiNC80 <lin...@googlegroups.com>
Subject: Re: [linc80] Re: Modulus Madness
whoops
--
You received this message because you are subscribed to the Google Groups "LiNC80" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linc80+un...@googlegroups.com.
To post to this group, send email to lin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linc80/ff7f91aa-2db0-46e5-bb97-c94d4e99642c%40googlegroups.com.
[snip]