News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_PulkoMandy

Albireo - USB/SD/Serial interface for CPC

Started by PulkoMandy, 15:54, 18 October 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



Poliander

Schneider CPC 664 • X-MEM • Vortex F1-X Drive • CTM 644 • DMP 2160
Schneider CPC 6128 • Z-MEM • M4 Board • MultiPlay + Amiga Mouse • OSSC

yannis_uno


Rennert

...KC Compact

PulkoMandy

Some precisions since I get some questions by PM (don't be shy, share your questions here so everyone can get the answers!)


There is no software available for this board currently
What you buy is only the hardware. You will have to write your own drivers for it or wait for someone to provide support (as a tool loadable from disk, a ROM, etc). While I have started some work on a ROM, I make no promises or guarantee that I will get that to work, and if I do, when it will be made available.


What will be possible with appropriate software
Some people will want to use it to load games from it. Remember that it is not a floppy emulator. This means, anything accessing the floppy disk without going through the AMSDOS system ROM, will not load.
Anything that uses AMSDOS, but initializes only ROM 7 or ignores the current drive setting, will not work.


The ROM will also use some memory for itself, which can also create some issues. It's possible to keep the RAM use quite low, but still some bytes will be used at least to store the new RSXs from the ROM.


BASIC programs should not be a problem, more complex software may need some patching. To get an idea, the games with 1 or 2 blue dots listed here will most likely work: http://cngsoft.no-ip.org/cpc_lzx.htm . The one with red dots will not (this is for the unprotected games).


What will be possible without a ROM
If you don't have a ROM expansion already (RamCard, Rom Board, MegaFlash, FlashGordon, X-Mem or similar), this board can still be used with software running in RAM. In that case, the software must be loaded from disk or tape - no autoboot support! The software will of course use some memory for itself, which possibly means even more compatibility problems if you want to use it as a game loader.


I don't plan to provide this kind of software, at all - because I don't need it myself. If someone else decides to attempt it, I can provide support, hints and technical documentation (writing the programming docs and examples is higher on my TODO list than writing the software).

HAL6128

...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

PulkoMandy

#32
Current waiting list

       
  • 0 - PulkoMandy
  • 1 - OffseT
  • 2 - TFM (x2 - what's up with people ordering two devices? do you use that much CPC to need two boards?)
  • 4 - ||C||-||E||
  • 5 - majikeyric (x2)
  • 7 - CraigsBar (x2)
  • 9 - pelrun
  • 10 - Optimus
  • 11 - AsT
  • 12 - Gryzor
  • 13 - hsimpson
  • 14 - SOS
  • 15 - tonio8bits (x2)
  • 17 - Audronic
  • 18 - gros_minet
  • 19 - Fessor
  • 20 - Sykobee (Briggsy)
  • 21 - skywalky
  • 22 - Jungsi
  • 23 - Poliander
  • 24 - Yannis_uno
  • 25 - Rennert
  • 26 - HAL6128
I have updated the first post with the info from my replies, so they don't get lost in the flow of preorders (already 27 boards to assemble! This will keep me busy during the winter at least)

CraigsBar

Quote from: PulkoMandy on 19:23, 19 October 15
Current waiting list

       
  • 0 - PulkoMandy
  • 1 - OffseT
  • 2 - TFM (x2 - what's up with people ordering two devices? do you use that much CPC to need two boards?)
  • 4 - ||C||-||E||
  • 5 - majikeyric (x2)
  • 7 - CraigsBar (x2)
  • 9 - pelrun
  • 10 - Optimus
  • 11 - AsT
  • 12 - Gryzor
  • 13 - hsimpson
  • 14 - SOS
  • 15 - tonio8bits (x2)
  • 17 - Audronic
  • 18 - gros_minet
Power supply
There was a question about the power supply required for the board. It needs 5V, and the power consumption is around:

       
  • Glue logic - 20mA
  • CH376S - 30mA
  • TL16C550D - 10mA
  • FT230X - 8.3mA
Total: 69mA, to which you need to add power for an SD card (30 to 100mA depending on the model chosen) and/or USB devices.
Well my 2 are as follows... 1 for the cpc's easily accessible and interchangeable. The other one will be lost, hidden and embedded in my just CPC tower.
IRC:  #Retro4All on Freenode

Joseman

#34
1 for me too please!! :)


Tai


Grim

+1 board, thanx.

A few more questions:
  • What's the maximum capacity of the SD card the CH376 can handle? (I haven't looked at the datasheet yet)
  • Does the announced transfer speed (128K snapshot loaded in 0.83s) theoretical or factual? (HOLYSHIFT! 0.83s?! :)
  • Do you accept payment in rum bottles?

PulkoMandy

#37

Max. Storage size

The datasheet doesn't give any limit for the SD card size. It is FAT32, so there is a limit of one partition of 2TB. I did my tests with an USB drive of 2GB and it seems to be working for now. I'm not sure how much space we need to fit the complete CPC software collection?


[edit]
After checking the chinese website of WCH, there is a size limit of "only" 32GB. It does support SDHC cards to allow this. I don't know if a larger drive can be used on USB, I'll have to test that.


Serial speed

For now everything about the serial interface is theoretical - I only drawn the schematics for it. Here is the math:

       
  • The serial controller gets a 24MHz clock
  • It divides this by 16 internally, to get a 1.5MHz clock
  • It sends/receives 1 bit per clock cycle, so 1.5Mbaud
  • Sending a byte needs 8 data bits + 1 start bit + 1 stop bit, so 0.150 MB/s or 150 KB/s
Is it reachable in real world conditions? On the hardware level, one difficult thing at such high speed on a serial link is keeping the two sides synchronized. This is why the USB adapter is integrated on the board: this way, the USB adapter and the serial controller run on the exact same clock. There is no way they can get out of sync.


On the software level, the z80 will be the limiting factor. Well optimized code could achieve this speed. To help the z80, there are a few features on the board:

       
  • Buffers: in the UART controller, a 16 byte buffer. In the USB controller, a 512 byte buffer.
  • Hardware flow control: The PC does not need to wait for the CPC to read the bytes. It can send 512 bytes at a time and wait for them to be written, without risk of a byte getting lost because the z80 was doing something else.
  • Interrupts: I don't know yet if this will be useful, the z80 can get an interrupt when the receive buffer is nearly full. This means there is no need to poll the serial port to wait for new bytes, just HALT and wait. The interrupt can also be NMI, in that case the gate array interrupts won't cause any interference (you can run in DI mode).
  • Short serial link: the actual serial link is only a few centimeters long on the board itself, this will limit the risk of data corruption. The rest of the connection is USB, which has strong protection features (CRC) and will get the data safely to the other side. Error checks on the z80 side or checksumming are thus not needed, and explicit acknowledge may not be needed either.
Everything else for the maximal speed is in the hands of people writing the z80 code. Can you write a loop tight enough to run this fast?

reidrac

I'd love to have one board, if that's possible. Thanks!
Released The Return of Traxtor, Golden Tail, Magica, The Dawn of Kernel, Kitsune`s Curse, Brick Rick, Hyperdrive and The Heart of Salamanderland for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

fastofruto


cosa_nostra-6128

Hi! One for me please!,thank very much

Targhan

Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

oratyper

Hello, one for me please  ;D  Thanks


TFM

Quote from: PulkoMandy on 06:21, 20 October 15
Max. Storage size

After checking the chinese website of WCH, there is a size limit of "only" 32GB. It does support SDHC cards to allow this. I don't know if a larger drive can be used on USB, I'll have to test that.

In the datasheet V1.0 I found (for chip version &41) the limit the size in general to 32 GB due to the file-system IIRC.


Quote from: PulkoMandy on 06:21, 20 October 15

Interrupts: I don't know yet if this will be useful, the z80 can get an interrupt when the receive buffer is nearly full.

Such an interrupt would be a great feature, because it's desirable it the CPU can do something else than data transfer in parallel.

The datasheet is written in bad english, have to browse through it again to find out how to select and load files. But there maybe a better source of information out there in the net.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

PulkoMandy

#45
CH376 programming resources

Yes, there are some resources that are helpful to better understand the datasheet.
The CooCox driver was helpful: CooCox provides free and open-source CH376 USB disk and SD card file management
My early WIP code for the AMSDOS compatible filesystem ROM: cpctools/resources/CH376 at master · cpcsdk/cpctools · GitHub The file ch376.i has description of all the commands in a more compact form, but not all the details. It should give a good overview of how things work. It includes only the FS commands for now, not the USB low level ones.
Current waiting list

       
  • 0 - PulkoMandy
  • 1 - OffseT
  • 2 - TFM (x2 - what's up with people ordering two devices? do you use that much CPC to need two boards?)
  • 4 - ||C||-||E||
  • 5 - majikeyric (x2)
  • 7 - CraigsBar (x2)
  • 9 - pelrun
  • 10 - Optimus
  • 11 - AsT
  • 12 - Gryzor
  • 13 - hsimpson
  • 14 - SOS
  • 15 - tonio8bits (x2)
  • 17 - Audronic
  • 18 - gros_minet
  • 19 - Fessor
  • 20 - Sykobee (Briggsy)
  • 21 - skywalky
  • 22 - Jungsi
  • 23 - Poliander
  • 24 - Yannis_uno
  • 25 - Rennert
  • 26 - HAL6128
  • 27 - Joseman
  • 28 - Tai
  • 29 - Grim
  • 30 - reidrac
  • 31 - cosa_nostra_6128
  • 32 - Targhan
  • 33 - oratyper
  • 34 - NiNxPe
Latest design changes
I'm still refining the routing. Today changes:

       
  • USB device (serial link) connector moved to the side of the board, instead of the top. This will make the cable less annoying when it is plugged
  • Replaced the jumpers for configuration with a DIP switch

fgbrain

Hi!

Will it be possible to connect and use USB printers or mice??
That would be great! But then one USB port is not enough ;D
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

Vandalsk

Please, count me for 2 boards please! Thanks.
- Schneider CPC 6128 & 3,5" Floppy, Multiface II, Videodigitizer, Symbiface II, Dobbertin Ram Expansion 512 Kb, Marconi Trackball, CPC Booster+, X-Board, X-Mem, HXC Floppy Emulator
- Sinclair PC 200
- Schneider PC 1640
- Atari STf
- Vtech Laser 310, 64 KB Ram, PI 20 Printer Interface,  LP 20 Lightpen, Laser JI 20 Joysticks, Erweiterungsplatine, PP40 Plotter, DD 20 5,25" Floppy, SANYO DM 2112 Monitor
Amstrad NC-100
Atari ST 1040
Amiga 500
Commodore C 64

TFM

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

PulkoMandy

Quote from: fgbrain on 21:15, 20 October 15
Hi!

Will it be possible to connect and use USB printers or mice??
That would be great! But then one USB port is not enough ;D


Hi,
"Connecting" is of course possible. Getting them to actually do something, however...  :D


More seriously, the controller chip can also handle some other USB devices, as far as I can tell anything HID should not be a problem. However, it is then acting as a simple USB controller, which means the CPC will have to do some work: reading the HID reports as they come on the wire, parsing them (the format is fairly simple), and moving the mouse cursor on screen, of course.


For printers, I have no idea if this would work. It depends on the printer, the interface it exposes and how hard it is for the CPC to generate the data to send to it.


You can read the datasheet for CH375 if you want to get a more precise idea of how the chip works for this.


CH376: usb mass storage / sd card FAT32
CH375: usb host for other kind of devices
CH372: usb device (for plugging the CPC as a "slave" device to another computer - this will probably not be used, by me at least)


The CH376 is compatible with 375 and 372 and is programmed the same way for the relevant parts.

Powered by SMFPacks Menu Editor Mod