Home » RBC Forums » General Discussion » Interested in a Z280 SBC (Z280 SBC retrobrew (CPU280 Revival))
( ) 1 Vote
|
Re: Interested in a Z280 SBC [message #5153 is a reply to message #5150] |
Sat, 08 September 2018 19:42   |
 |
lowen
Messages: 226 Registered: August 2016 Location: Western NC USA
|
Senior Member |
|
|
Now, I did start my statement with "back in the day" or at least words to that effect. 
For the TRS-80 case specifically, the limits had as much to do with the IRQ setup in that hardware as anything else. That and floppy I/O, which was NMI driven programmed I/O. For direct text to the screen, the frame buffer was memory mapped and required software scrolling and remapping. Oh, and the software-scanned keyboard, with timer IRQ driven typeahead....
So, while the Z80 might have been able to run those speeds, it only could do that if it had nothing else to do, at least in the TRS-80 case. I don't remember any of the file transfer programs doing RAM buffering of downloads, but I do remember doing downloads into RAMdisk to keep the transfer rates up. But the keyboard scan task alone used up many cycles, and that would be present just to be able to hit the BREAK key to interrupt the transfer....
These modern Zx80's are much nicer machines, and leave the TRS-80's in the dust in many ways.
--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
|
|
|
Re: Interested in a Z280 SBC [message #5154 is a reply to message #5144] |
Sat, 08 September 2018 20:03   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
wsm wrote on Sat, 08 September 2018 10:34With all this discussion about data rates, I'm going to be a bit of a devil's advocate. The default speed I use on my Z180's is 115,200 to/from Win7/HyperTerm and I've never had an issue. That got me thinking about how fast a very basic 4MHz Z80 could handle XMODEM data. My conclusion is that 115,200 should NOT be a problem nor should 230,400. The 10MHz SIO should support 115,200 and I'd have to look at other UARTs for 230,400. The only assumption is that the UART has both a data register and a receive register i.e. additonal data can be received while valid data is still pending a read.
The real key is the software. While the original XMODEM certainly works it is *FAR* from optimized code with a subroutine call and extra logic PER BYTE. By definition, the XMODEM protocol has a built-in handshake to limit data flow and the sender should not be sending any additional data after a packet until it receives an ACK or NAK. The only real timing issue is with the receipt of a 132 byte packet.
The following snippet shows how a 4MHz Z80 can get a serial data byte in 15.5uS or 23us if the status check just misses the change and causes an extra loop. By my calculation, that equates to 43,478 Bytes/sec worst case. At 8,N,1 that's 434,782 baud!
Perhaps someone can show me why my theoretical calculations are wrong.
The XMODEM is version 2.7 by Martin Eberhard.
https://groups.google.com/forum/#!searchin/comp.os.cpm/xmode m%7Csort:date/comp.os.cpm/qLgOkknsnO8/zZZhO7L_AwAJ
The source code is attached below. Alas, it is in 8080 assembler and I'm afraid to read it because it will surely muddle my already tenuous grasp of Z80 assembler.
Bill
Edit: This is Martin Eberhard's comment when he released version 2.6 of XMODEM:
https://groups.google.com/forum/#!searchin/comp.os.cpm/xmode m$202.6%7Csort:date/comp.os.cpm/XVjRHuzT5jc/L1ogAJXjCQAJ
Version 2.6 is a pretty significant rewrite, focused on speeding up transfers. By far the biggest speedup came from changing the CRC calculation to a table-driven algorithm. But I also flattened the code a bit, eliminating several layers of subroutine calls, as well as a few other speed enhancements. The resulting code can now send and receive at 76.8K baud with a 2 MHz 8080. It can theoretically go twice as fast with a 4 MHz Z80. However, I was only able to test it at 115.2K baud on my 4 MHz Z80 machine, since this is the maximum baud rate for the Z80-DART. (Still this is more than 3 times as fast as version 2.5!)
[Updated on: Sat, 08 September 2018 20:07] Report message to a moderator
|
|
|
Re: Interested in a Z280 SBC [message #5155 is a reply to message #5154] |
Sat, 08 September 2018 20:58   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Circling back to hperaza's original comments that started this flurry of conversation:
1. CF byte-swap is still a problem although if XMODEM transfer at 115200 can be reliably achieved, the need of moving CF disk back and forth between PC & Z280RC may not be so pressing. In view of the number of existing Z280RC hardware out there, I want to find a software solution. I'm still thinking about byte swapping in Z280 software or use CF interface in 8-bit mode and enable DMA to make up for the lost performance.
2. The discussion on UART hardware handshakes are instructive. Initially I thought about bring out two discrete I/O from CPLD as hardware handshakes, but they are interrupt driven and if the lower priority console task is preempted by higher priority task, the interrupt driven hardware handshake won't work. Since I do have 256K of uncommitted memory, I'll pin my hope on massive size DMA buffers base on the argument that if 64K of DMA buffers are still not sufficient, perhaps the problem is too big for Z280RC to solve.
3. There is a chicken way out: Z280RC is RC2014 compatible, so if the problems can't be solved with the resources on-board, perhaps it is time to utilize the numerous RC2014 I/O modules.
In all cases, a lot of things for me to try...
Bill
PS, you guys may not know this, but September is wine-making time in New Mexico. I have about 70 gallons from my vineyard and need to bottle up 50 gallons of last years' wine to free up carboys. One can write seriously wicked codes with the help of 50 gallons of wine--or not.
|
|
|
Re: Interested in a Z280 SBC [message #5157 is a reply to message #5150] |
Sun, 09 September 2018 01:52   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
wsm wrote on Sat, 08 September 2018 18:54I don't use this code myself as the 33MHz Z8S180 is fine with extra overhead at 115,200 and has a four byte buffer. After the various comments this was just a quick-n-dirty curiosity wander to see what the maximum XMODEM baud rate on a 4 MHz Z80 MIGHT be and whether 115,200 could be supported.
You'll gain some additional speed if you leave out the test for error flags and rely on XMODEM's packet validation capabilities (CRC).
Quote:Through the years I've seen a LOT of inefficient code and lots of bloat that lead people to believe there are hardware limitations when in fact it's software.
You can always achieve the best and most impressive performance if your program talks directly to the hardware while the CPU does nothing else (e.g. no interrupts, no DMA), but as Alan mentioned, your code will not be portable. If you are targeting your application for an existing OS, then you may have no other option than to use the OS services, and that means lots of overhead. And if the OS is a multi-tasking one (MP/M, UZI, etc.) then you have to take into account also additional factors like context switching, time-slices, preemption, concurrent interrupts, DMA, etc. Those are the factors that set in practice the upper limit of the character rate your application can handle. Note character rate and not baud rate; as nothing stops you from using e.g. a mega-bit baud rate (except, perhaps, the quality of the transmission line) if there is enough delay between characters or if you have a way to control the data flow, the last being the reason all this discussion started. You can use the baud rate as a way to control the character rate, but without flow control you can't guarantee that no characters will be lost.
|
|
|
Re: Interested in a Z280 SBC [message #5158 is a reply to message #5153] |
Sun, 09 September 2018 02:15   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
lowen wrote on Sat, 08 September 2018 19:42For the TRS-80 case specifically, the limits had as much to do with the IRQ setup in that hardware as anything else. That and floppy I/O, which was NMI driven programmed I/O. For direct text to the screen, the frame buffer was memory mapped and required software scrolling and remapping. Oh, and the software-scanned keyboard, with timer IRQ driven typeahead....
Those were the days! I loved those little systems where the CPU really did everything. Don't forget the cassette I/O: bit-banged, FM- or phase-modulated by the same CPU... I guess that's showing my age 
My first machine was a home-brewed 8080 system, also with software-scanned keyboard (via 8255 PPI) and memory-mapped video (8275 CRT + 8257 DMA), 8259 interrupt controller and 8253 timer for sound. The CPU was able to handle all that and in addition could run a simple multitasking OS with decent performance!
|
|
|
|
Re: Interested in a Z280 SBC [message #5160 is a reply to message #5155] |
Sun, 09 September 2018 03:31   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
plasmo wrote on Sat, 08 September 2018 20:581. CF byte-swap is still a problem although if XMODEM transfer at 115200 can be reliably achieved, the need of moving CF disk back and forth between PC & Z280RC may not be so pressing. In view of the number of existing Z280RC hardware out there, I want to find a software solution. I'm still thinking about byte swapping in Z280 software or use CF interface in 8-bit mode and enable DMA to make up for the lost performance.
How about the idea of the small PCB in-between? Existing Z280RCs could be upgraded that way.
As one of my P112s has a CF adapter and my CPU280 will have one too, it will be nice if I could move the CF card from one machine to another without having to byte-swap anything. Right now I'm working on modifying the CPU280 ROM code so it will recognize dynamically (and boot from) the different disk partitions like the P112 does.
Quote:2. The discussion on UART hardware handshakes are instructive. Initially I thought about bring out two discrete I/O from CPLD as hardware handshakes, but they are interrupt driven and if the lower priority console task is preempted by higher priority task, the interrupt driven hardware handshake won't work. Since I do have 256K of uncommitted memory, I'll pin my hope on massive size DMA buffers base on the argument that if 64K of DMA buffers are still not sufficient, perhaps the problem is too big for Z280RC to solve.
Not sure I understand the above well. Two simple I/O lines should do the job, and they don't have to interrupt the CPU. The DMA solution still looks to me like shooting a fly with a cannon.
Quote:3. There is a chicken way out: Z280RC is RC2014 compatible, so if the problems can't be solved with the resources on-board, perhaps it is time to utilize the numerous RC2014 I/O modules.
I've been considering that, specially since my main interest is multi-terminal multitasking, and for that the Z280RC will need more communication channels anyway.
Quote:PS, you guys may not know this, but September is wine-making time in New Mexico. I have about 70 gallons from my vineyard and need to bottle up 50 gallons of last years' wine to free up carboys. One can write seriously wicked codes with the help of 50 gallons of wine--or not.
Second that!
|
|
|
|
Re: Interested in a Z280 SBC [message #5162 is a reply to message #5161] |
Sun, 09 September 2018 07:26   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
etchedpixels wrote on Sun, 09 September 2018 05:26You need the DMA because you don't have any FIFO. The DMA +RAM is the FIFO on the Z280 systems so avoids any overrun problems when the CPU is required to disable interrupts for something else like floppy disk I/O.
Other DMAs taking place (e.g. disk DMA) could preempt UART DMA as well. Likewise, if you disable interrupts for too long, or at a critical moment, then you'll not be able to flip the DMA buffers either, and you are back to square one. Unless you lower the CTS line before disabling interrupts, which brings us back to the original point: we need handshake lines.
At the end, we don't have to use 115200 baud if the system can't handle it, but handshake lines are always desirable, even at low speeds.
[Updated on: Sun, 09 September 2018 07:27] Report message to a moderator
|
|
|
Re: Interested in a Z280 SBC [message #5163 is a reply to message #5141] |
Sun, 09 September 2018 10:25   |
stefan_n
Messages: 11 Registered: June 2018
|
Junior Member |
|
|
hperaza wrote on Sat, 08 September 2018 05:05Depends on what you are doing. A text editor, for example, is not the most demanding sort of application. But if you are using a RT OS (UZI280 is not), then you know that any task can be blocked by a higher priority one; and if the lower priority task was receiving data from the UART, then chances are that the input buffer will overflow if the task is blocked for too long, resulting in characters lost unless hardware handshake is used.
As for the terminal, my VT520 starts missing characters at 9600 baud when scrolling in 132x50 mode.
Just a note, the 38400 baud limit was under heavy system load running several processes like:
- cat dumping out characters at full speed to an ECB bus connected parallel terminal
- compiling the UZI kernel
- file copy from one HD partition to another partition
- and so on...
and receiving escape sequences send from a hardware terminal.
But you are right UZI280 is no RT OS so there is no guaranty this works under all circumstances, even it never failed for me. On a non RT OS handshake lines are the only way to warrant non character losses on serial IO.
|
|
|
|
|
Re: Interested in a Z280 SBC [message #5226 is a reply to message #5225] |
Thu, 27 September 2018 04:47   |
 |
fritzeflink
Messages: 80 Registered: January 2017 Location: germany
|
Member |
|
|
hperaza wrote on Thu, 27 September 2018 13:23I knew I had seen that somewhere. Just searched for 'stevie.taz' from UZI280.zip and found this on znode51. Is it the same thing?
Hi hperaza,
I don't know if it's identical as I'm not a programmer, stefan_N may take a look.
The znode51 is well known and there is a long friendship with the owner of the website.
znode51 is a part of www.gaby.de and the contact goes to back into the 90th.
As the owner of znode51 belongs to the CPU280 users it may be that he got a copy for preservation.
stefan_N told me that he send the source for UZI280 to Alex who even had a CPU280 at that time.
I even mailed the zip files to Stefan_N as I don't know if he got information about new posts.
Thanks for your hint.
/*-----
fritz
-----*/
[Updated on: Thu, 27 September 2018 04:47] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Interested in a Z280 SBC [message #5331 is a reply to message #5330] |
Mon, 15 October 2018 11:57   |
zenxyzzy
Messages: 14 Registered: September 2017 Location: san francisco
|
Junior Member |
|
|
so, my first and second prototypes of the s100-z280 board. strange build method, I know...
build notes, as far as it goes:
the buffered proto board has drivers that make pretty strong assumptions that you are building a bus slave, with the address lines using
244's in the wrong direction, so I can't use them.
the switching reg is pretty good, but has a highish cutoff. I have to run switchers in my power supply at 7.5 volts, and when I was using 2940's,
I could get away with 6.8V.
the z280 clock is a mess, with a bare rock I couldn't get it stable, so I used a socketed oscillator.
all these pins on the front mean I don't get confused about pin numbers when I wire wrap; i used to do it on the back and kept getting bit by
mixing up the pin numbers.
also, makes plugging in the logicport much nicer. I wish intronix would finally release a linux version or some way of plugging in protocol analyzers.
the sigrok stuff isn't quite ripe enough with respect to triggering.
The power on clear is still broken; that's the cap on the top right. gotta break out the scope on that one. probably I'll just lift the circuit from John M's many cpu's.
and a few questions that might be germane to getting a high quality mod:
1) none of the 16 bit recent boards do the serial byte transfer if sxtn isn't answered from xtrq. is that because of the tight timing or just the circuit complexity?
2) how is the clock (phi) switching supposed to work? this is not in the S100 spec, but there's been a few different implementations. do we have a spec for this?
I'm happy just grabbing the circuit from known good designs, but which is the best, as in robust?
3) does anybody know how the later compupro 80286 cpu did their 2-cycle memory access? this is definitely outside the spec.
4) cromemco supposedly did some bizarre double speed stuff with the XXU to move 32bits over the s100. anybody have details on this?
my deadend first prototype:

my second prototype, much better
yellow is address bus, blue is data, green is wait, orange is clock and strobes, red is reset.
white is ground and black is +5, except on the cpu, where it is breakout on the back. If I add it, purple will be dma/master/slave logic.
almost everything is wire wrap on short headers. i can get 2 wraps per post, but this almost never a problem.

and the back:

maybe I'll finish it this weekend. we'll see. then I need to transcribe it to kicad. ugh.
--curt
|
|
|
|
|
|
|
|
|
|
Re: Interested in a Z280 SBC [message #5402 is a reply to message #5394] |
Sat, 27 October 2018 18:35   |
b1ackmai1er
Messages: 396 Registered: November 2017
|
Senior Member |
|
|
geowar1 wrote on Sat, 27 October 2018 09:21MOOF!
I've pored over the code multiple times and I'm just not seeing the problem... Probably something really stupid... ;-) 
I'm playing with some SBCV2 banking stuff at the moment.
The two things that caught me out ...
Overwriting running code when moving between banks.
Overwriting the stack when moving between banks.
What helped me ...
Some debug code that output verification that the first couple of bytes of transferred code were the same as the source.
Regards Phil.
[Updated on: Sat, 27 October 2018 18:36] Report message to a moderator
|
|
|
|
|
Re: Interested in a Z280 SBC [message #5405 is a reply to message #5394] |
Sun, 28 October 2018 02:06   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
geowar1 wrote on Sat, 27 October 2018 09:21Anyway, I've got a quick question: Did the zsm sources ever get uploaded anywhere (GitHub?)? For some reason it doesn't support the "SET" directive. It's like EQU but allows the value to change; it's useful in REPT, IRPC & IRP groups to count iterations, etc. (See the MAC documentation at www.cpm.z80.de/manuals/mac.pdf section 4.4 (IIRC)).
SET is a Z80 instruction (set bit, like in "set 7,a") and therefore cannot be used as a pseudo-op. What you want is DEFL and is supported by ZSM4. For compatibility with M80, ASET is also implemented, which does the same thing.
Remember that MAC is an 8080 assembler, while ZSM4 is a Z80 relocatable assembler, and thus there are subtle differences between the two (I would suggest using the M80 documentation instead as a guide). When I get some free time I'll prepare some docs, perhaps using the M80 manual as starting point.
[Updated on: Sun, 28 October 2018 02:07] Report message to a moderator
|
|
|
Re: Interested in a Z280 SBC [message #5407 is a reply to message #5405] |
Sun, 28 October 2018 10:49   |
geowar1
Messages: 41 Registered: October 2018
|
Member |
|
|
hperaza wrote on Sun, 28 October 2018 02:06geowar1 wrote on Sat, 27 October 2018 09:21Anyway, I've got a quick question: Did the zsm sources ever get uploaded anywhere (GitHub? ? For some reason it doesn't support the "SET" directive. It's like EQU but allows the value to change; it's useful in REPT, IRPC & IRP groups to count iterations, etc. (See the MAC documentation at www.cpm.z80.de/manuals/mac.pdf section 4.4 (IIRC) .
SET is a Z80 instruction (set bit, like in "set 7,a") and therefore cannot be used as a pseudo-op. What you want is DEFL and is supported by ZSM4. For compatibility with M80, ASET is also implemented, which does the same thing.
Remember that MAC is an 8080 assembler, while ZSM4 is a Z80 relocatable assembler, and thus there are subtle differences between the two (I would suggest using the M80 documentation instead as a guide). When I get some free time I'll prepare some docs, perhaps using the M80 manual as starting point.
Excellent! Just what I needed to know. ;-)
(Thou I'm trying to keep my machines Micro$oft clean... ;-)
|
|
|
|
Re: Interested in a Z280 SBC [message #5430 is a reply to message #1189] |
Mon, 05 November 2018 15:53   |
 |
agn453
Messages: 68 Registered: June 2018 Location: Newcastle, NSW, Australia
|
Member |
|
|
Greetings fellow Z280 tinkerers.
Having put aside my Z280RC for a few months, it resurfaced last week and I thought I'd try to iron out the remaining bugs in my CP/M-Plus BIOS routines.
I'm still having problems with the Banked version - which loads and lets me run programs, but blows up (technical term for "hangs" or exhibits "memory corruption") when I (for example) try to copy large files with CP/M 3 PIP - but it works fine if I use SWEEP (NSWEEP 2.07 from the public domain archives).
I suspect either a typo somewhere in my source-code, a stack overflow, or an issue with the way CP/M is handling data buffers (old GENCPM bug perhaps?Wink.
Anyhow, I've uploaded my BIOS280 source files to my GitHub repositry for your perusal.
You'll find them at
https://github.com/agn453/Z280RC
in the system/bios280 subdirectory.
If you've got time to look at them and see something wrong - let me know.
In the mean-time - I'm about to try hard-coding the disk parameter blocks / allocation headers / buffer control blocks (away from using the macros in my CPM3M80.LIB)...
Tony
--
Tony Nicholson
[Updated on: Mon, 05 November 2018 19:52] Report message to a moderator
|
|
|
|
|
Re: Interested in a Z280 SBC [message #5433 is a reply to message #5432] |
Mon, 05 November 2018 19:49   |
 |
agn453
Messages: 68 Registered: June 2018 Location: Newcastle, NSW, Australia
|
Member |
|
|
plasmo wrote on Tue, 06 November 2018 14:02Tony,
I downloaded your files and assembled them on my Z280RC without errors. When I run the banked software using the test.sys/test.com method or cpm3.sys/cpmldr3.com method, I got lots of diagnostic messages (a sampe of the message below), but I am not able to issue CP/M commands. How can I work around these diagnostic messages?
Bill
[snip]
?BNKSL Select Bank 01
?BNKSL Select Bank 00A
?BNKSL Select Bank 01
?BNKSL Select Bank 00>
?BNKSL Select Bank 01
MOVE from 010DF4 to 01F12A 234
DMAXFR using DMA3 from P010DF4 to P00F12A count 234
?BNKSL Select Bank 00[/code]
I can see the A> prompt 
As I said, I left full debug messages on - and they come out interspersed with console output. To disable the Kernel debug messages, edit the CONFBANK.LIB file and set KRNL$DEBUG to FALSE, then rebuild with BANKBIOS.SUB
With debugging on - you can type commands and they should echo (maybe with more debugging mixed in). I find that using Simeon Cran's ZCPM3 replacement BDOS works better (and does far less bank selection). To use this, do a USE-ZPM3.SUB to load this instead of the standard CP/M 3 BDOS.
Tony
--
Tony Nicholson
|
|
|
|
|
Current Time: Wed Mar 19 02:09:01 PDT 2025
Total time taken to generate the page: 0.01231 seconds
|