Author Topic: Albireo - USB/SD/Serial interface for CPC  (Read 55510 times)

0 Members and 1 Guest are viewing this topic.

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #225 on: 14:21, 16 February 16 »
None of which run on a CPC464 (without X-MEM) so in reidrac's case it doesn't really help.


Also, BDOS is easily hacked to support more devices (including Albireo), but the author explicitly disallowed me from doing this.

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #226 on: 14:30, 16 February 16 »
Today, a ROM board is a must have.  8)
By the way, a new hardware require softwares to be used.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #227 on: 14:41, 16 February 16 »
Yes, but the people who can write hardware can't always write good software.
And people who can write software need hardware to test it with.


I think I was clear enough about the status of Albireo, if people are ready to pay for a barely tested hardware without software, that's their problem  :D

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 690
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 1185
  • Likes Given: 729
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #228 on: 14:45, 16 February 16 »
I think I was clear enough about the status of Albireo, if people are ready to pay for a barely tested hardware without software, that's their problem  :D

Well, that's not a nice way of putting it. I don't see it as a problem but as an opportunity, and also I like to support the development of new hardware.

Of course I'd be better off giving my money to TotO as his boards are already tested by a lot of happy customers.
Released The Return of Traxtor, Golden Tail, Magica and The Dawn of Kernel for the CPC.

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

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #229 on: 15:37, 16 February 16 »
Yes, but the people who can write hardware can't always write good software.
And people who can write software need hardware to test it with.
Sure. It is why the MiniBooster is CPC Booster compatible, The X-MEM is CPC/DK' compatible and the X-MASS is Symbiface compatible.  :-\

I think I was clear enough about the status of Albireo, if people are ready to pay for a barely tested hardware without software, that's their problem  :D
:D
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #230 on: 15:55, 16 February 16 »
Sure. It is why the MiniBooster is CPC Booster compatible, The X-MEM is CPC/DK' compatible and the X-MASS is Symbiface compatible.  :-\


Well, it is nice in some ways, but also means we have to live with the limitations of the old designs: slow speed, hard to find components, and simple design problems. For example, it is not possible to run GitHub - EtchedPixels/FUZIX: FuzixOS: Because Small Is Beautiful on the CPC because the memory banking scheme is too limited. It is great that the X-devs make these existing designs more polished and easily available, but at the same time, I think it's possible to go further and make better devices, and in some cases the improvements are worth some compatibility breakage. This is also why I'm putting efforts in publishing all the schematics and PCB routing files, so people can build on the work and improve it. Maybe some day there will be an X-USB based on Albireo design?  8)

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #231 on: 17:01, 16 February 16 »
Well, it is nice in some ways, but also means we have to live with the limitations of the old designs: slow speed, hard to find components, and simple design problems.
The speed limitation is on the CPC side. Your Albireo chips will be sold out before 80s parts. Design problems are part of the challenge.  :D

For example, it is not possible to run FuzixOS on the CPC because the memory banking scheme is too limited. It is great that the X-devs make these existing designs more polished and easily available, but at the same time, I think it's possible to go further and make better devices, and in some cases the improvements are worth some compatibility breakage.
The more difficult is to keep the compatibility, not to break it. It is easy to handle a MMU or anything else...  ;)
But, I think that we have better to do with the CPC specifications, before looking to port things not designed for it.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #232 on: 17:19, 16 February 16 »
for the slow speed I was referring to the MiniBooster, which is far from the CPC speed limitations for its serial port. This is one of the problems I hope to solve with Albireo.


As for the chip used, the TL16C550D is the same UART that is fitted on old PC hardware, only rated for faster speed ratings. It is essentially 80s hardware, but still in production  :laugh: . There is already a version which doubles the speed again available, but in packaging too small for my soldering skills.
The CH376 is a microcontroller (8051 based) with a pre-programmed custom firmware, and even if they stop manufacturing it, there are replacement options (either the CH378, or writing an open source equivalent on another suitable microcontroller).

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #233 on: 18:31, 16 February 16 »
for the slow speed I was referring to the MiniBooster, which is far from the CPC speed limitations for its serial port. This is one of the problems I hope to solve with Albireo.
With the fano transfert program, we was able to use the MiniBooster up to 230400bps but failled at 460800bps. If I remember well, it was more a CPC limitation that not allow to reach the expected speed when doing IN/OUT data exchange.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1976
  • Likes Given: 4650
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #234 on: 19:15, 16 February 16 »
To stay compatible is a great thing! Please do also consider the new features of the 6128 Plus if possible (thinking of enhanced banking for example). The SF2 for example offers extended ROM banking (a ROM can be banked in at &C000 or at &4000), but it's not compatible to the Plus.


IMHO it's ok to "break compatibility" / add something new when it really has an advantage, but it the gain in speed is lower than let's say 50% then I would stick with compatibility. There is no perfect advice / solution, it all depends on the single case!  :)


Great to see so much new hardware for the CPC emerging.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #235 on: 19:52, 16 February 16 »
With the fano transfert program, we was able to use the MiniBooster up to 230400bps but failled at 460800bps. If I remember well, it was more a CPC limitation that not allow to reach the expected speed when doing IN/OUT data exchange.


The main problem with the Minibooster is the lack of hardware flow control, which makes things more complex both for the CPC and for the other side of the link. With Albireo, the other computer can just send a huge chunk of data (128K, for example), and the CPC can read it at its own speed. The hardware flow control and FIFO buffers will do all the hard work of making sure no bytes are lost. This means the serial link can be much faster even if the CPC can't handle the flow directly. This allows to operate as close as possible to the CPC limitations of a tight optimized IN loop, not having to check if bytes are available.
Also, the serial link is kept as short as possible (about 2 centimeters on the PCB) and the long wire to the other computer uses USB, which has a lot more solid error checking, retry on error, etc.

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #236 on: 22:35, 16 February 16 »
With Albireo, the other computer can just send a huge chunk of data (128K, for example), and the CPC can read it at its own speed.
Curious to see the result.

Also, the serial link is kept as short as possible (about 2 centimeters on the PCB) and the long wire to the other computer uses USB, which has a lot more solid error checking, retry on error, etc.
I think that is not a problem. The Minibooster with the blutooth module (2cm too) fail at the same speed.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline ukmarkh

  • 6128 Plus
  • ******
  • Posts: 1.417
  • Country: england
    • Classic Replay
  • Liked: 301
  • Likes Given: 75
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #237 on: 00:24, 17 February 16 »
If this new device comes with software that enables me to play my entire collection of CPC games from a USB stick, then sign me up.


Things I would like to see added, or in the future:


- New games being developed, support CPC link for multiplayer purposes i.e. play each other at Battleships or Chess for example. 
- Scrap 64K, All games with option of 128K and 256K
- Use Plus graphics where possible, but also include stock CPC version.
- All new hardware designs, must come ready to go, with built in PSU and case. Or integrate / replace the board inside of the CPC. Fitting perfectly.


Thanks in advance  ;)




Offline CloudStrife

  • CPC464
  • **
  • Posts: 31
  • Country: fr
    • Shinra Team Website
  • Liked: 16
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #238 on: 19:47, 18 February 16 »
Curious to see the result.
I think that is not a problem. The Minibooster with the blutooth module (2cm too) fail at the same speed.

On the CPC Booster if your speed is faster than the CPC you loose bytes. And if is too slow you need to do pooling to know if a new byte is available.

So you end with something like that:
Code: [Select]
    LD  BC,&FF06 ; 4µs
wait_flag:
    IN  A,(C)   ; 4µs
    JP  P,wait_flag ; flag on bit 7 so sign flag work - 3µs
    DEC C       ; 1µs
    IN  A,(C)   ; 4µs
    LD  (HL),A  ; 2µs
    INC L       ; 1µs
    INC C       ; 1µs

    JP  NZ,wait_flag    ; 3µs

Some unrooling can be done, but for the main part is at least of 16 NOP. So in theory 62500 octet/s.
The problem is that at 460800 baud the interval between two characters is: 1 / (460800 / 10) = 21.7µs
So 21.7 - 16 = 5.7µs of margin. And just the jitter introduce by the flag waiting is enough to made you loose bytes !

And even with a slightly lower speed, you have no time to support border case (looping over 256 octets block, test if transfere is finished, etc.)


On the Albireo with the help of the FIFO we can do burst read of 14 bytes without problem. And if the baudrate is too high, the sender just wait.
So plenty of time for support border case scenario

We end with some code like that:
Code: [Select]

    LD  DE,&4000    ; Start address
    LD  HL,&02BC    ; Size, only work for multiple of 14 for the moment.
read_hl_bytes_to_de:
    ADD HL,DE
    EX  DE,HL       ; HL: current DE: end addr
    LD  B,&FE
read_loop_begin:
    LD  C,&B3   ; 2µs
wait_fifo_flag: ; Test if FIFO trigger level is reach
    IN  A,(C)   ; 4µs
    AND 1       ; 1µs
    JP  Z,wait_fifo_flag    ; 3µs                                                                                                                         

    LD  C,&B0   ; 2µs

    IN  A,(C)   ; 4µs
    LD  (HL),A  ; 2µs
    INC HL      ; 2µs
    ; unroll
    IN  A,(C)   ; 4µs
    LD  (HL),A  ; 2µs
    INC HL      ; 2µs

    LD  A,L     ; 1µs
    CP  E       ; 1µs
    JR  NZ,read_loop_begin  ; 3(2)µs
    LD  A,H     ; 1µs
    CP  D       ; 1µs
    JR  NZ,read_loop_begin  ; 3(2)µs
   
    RET
(Code is not yet tested...)


The main reading part is at 8µs per character. So 125 ko/s. (By working with 256 octets chunk we can probably speed up it a bit with only incrementing L and go down to 7µs, 142ko/s, but more complexe, so for another time)

Well if we add the flag waiting and the loop we use less than (10 + 14*8 + 5 + 5) = 132 µs for 14 bytes. So > 100ko/s

And during this time we can have interruption without corrupting data...

And in theory if the sender is always faster than the CPC, we can even remove the FIFO flag test and just always read and we will always have data...
« Last Edit: 02:14, 19 February 16 by CloudStrife »

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.817
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1017
  • Likes Given: 1072
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #239 on: 20:15, 18 February 16 »
It seems that my unit is still in transit  :picard: . It arrived yesterday to GB  :-X

La Boutique : suivi des envois - recherche par numéro

it took them 17 days to ship it to this island. This is, of course, not Pulko´s fault  :-* .

Offline remax

  • 6128 Plus
  • ******
  • Posts: 1.071
  • Country: fr
  • Liked: 381
  • Likes Given: 419
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #240 on: 20:25, 18 February 16 »
Ca bouge avec la poste !


"La Poste" is on the move (old french slogan).


@PulkoMandy : T'es du 31 aussi ?

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #241 on: 22:16, 18 February 16 »
@Cloudstrife: actually, even if the sender is slower, you can remove the test for the FIFO because the TL16C550D can provide a "fifo empty" interrupt. But this may not always be a good idea for maximal speed, we'll have to test and see what works better. Maybe using the NMI, disabling firmware interrupts and using EXX in the interrupt handler would be faster than testing in the read loop? I forgot how much time it takes to handle an interrupt.


@||C||-||E||: well, standard "international letter" shipping is that way. There are faster options but I don't think they are worth the extra cost. A proof of this: you will probably still get your card before any useful software is released for it  ::)


@remax: installé à Aussonne depuis un peu plus de 2 ans oui. Avant j'étais Palois, puis Breton.

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #242 on: 22:28, 18 February 16 »
@||C||-||E||: well, standard "international letter" shipping is that way. There are faster options but I don't think they are worth the extra cost. A proof of this: you will probably still get your card before any useful software is released for it  ::)
I think they screwed up there. I usually take 6 days from France to UK with tracked international letter.
At least that letter did not make a two week trip to Italy before going to UK  :-X

Offline remax

  • 6128 Plus
  • ******
  • Posts: 1.071
  • Country: fr
  • Liked: 381
  • Likes Given: 419
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #243 on: 23:31, 18 February 16 »
@remax: installé à Aussonne depuis un peu plus de 2 ans oui. Avant j'étais Palois, puis Breton.


Ah c'est marrant ça, on est plus que voisins alors, je suis à Merville !!!


Peut-être que si tu le permet, un jour je viendrais t’embêter 5 minutes pour tester ma XMEM sur autre chose que mon CRTC4  ;)


Translation : We live perhaps no more than 5 kilometers each other  :o
« Last Edit: 23:34, 18 February 16 by remax »

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #244 on: 00:00, 19 February 16 »
Avec plaisir! CRTC1 et 3 disponibles pour tester!


Translation (not quite): if you are near Toulouse/France, you can always come visit me and say hi!

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 697
  • Country: gb
  • Liked: 238
  • Likes Given: 354
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #245 on: 00:09, 19 February 16 »
I emailed ToTo a while ago and never got a reply, and the website said out of stock. Maybe it went into his spam :/


Obv. need the motherx4 and the rom thinger for it for this. Luckily I'm in no particular rush overall.

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.463
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2635
  • Likes Given: 1565
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #246 on: 00:14, 19 February 16 »
Hey!

You can send me a PM too... What is your message, please?
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline CloudStrife

  • CPC464
  • **
  • Posts: 31
  • Country: fr
    • Shinra Team Website
  • Liked: 16
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #247 on: 01:58, 19 February 16 »
@Cloudstrife: actually, even if the sender is slower, you can remove the test for the FIFO because the TL16C550D can provide a "fifo empty" interrupt. But this may not always be a good idea for maximal speed, we'll have to test and see what works better.

Well it have one for the transmitter FIFO yes. But as I understand the datasheet not for the receiver :/
For the receiver the interrupt is when FIFO size > 14 (or 1 or 4 or 8...)
And in fact for the DA (data available) flag I use maybe active if FIFO is not empty, so don't know if it is 1 or 14...
(So maybe with deactivating the transmission of the interrupt to the CPC and test the interrupt flag it's working, need futher investigation...)
But in all case we are around ~10µs / octet without risk of loosing data... The 100 ko/s is reasonable speed target...

Quote
Maybe using the NMI, disabling firmware interrupts and using EXX in the interrupt handler would be faster than testing in the read loop? I forgot how much time it takes to handle an interrupt.
4 NOP if I remember correctly (same for INT and NMI because of the GA...). And 4 NOP for the the RETI/RETN

Quote
@remax: installé à Aussonne depuis un peu plus de 2 ans oui. Avant j'étais Palois, puis Breton.

[troll]Nantes is in Brittany ? It's like saying Rennes is in Brittany ! Pure nonsense :) [/troll]

Offline PulkoMandy

  • 464 Plus
  • *****
  • Posts: 338
  • Country: fr
  • Liked: 269
  • Likes Given: 1
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #248 on: 08:03, 19 February 16 »

Quote

4 NOP if I remember correctly (same for INT and NMI because of the GA...). And 4 NOP for the the RETI/RETN


A normal RET will do, the z80 interrupt chaining scheme is not recognized by the devices (unless you want to handle CTC interrupts from the PlayCity, of course).

Quote
[troll]Nantes is in Brittany ? It's like saying Rennes is in Brittany ! Pure nonsense :) [/troll]


I was thinking about Lannion, of course!

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.817
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1017
  • Likes Given: 1072
Re: Albireo - USB/SD/Serial interface for CPC
« Reply #249 on: 13:58, 19 February 16 »
I finally received mine today!

Long story short, they opened the envelope for inspection and then they closed it again in the worst possible way, with some crappy tape. When it arrived to me, the envelope was just a bit more than a few shreds of paper  :picard2: . Luckily, the board was still inside and it seems intact as well. Maybe they thought that it was part of a bomb or some kind of hi-tech device for world domination.