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 4 Guests are viewing this topic.

PulkoMandy

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.

TotO

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)

PulkoMandy

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

reidrac

Quote from: PulkoMandy on 13:41, 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, The Dawn of Kernel, Kitsune`s Curse, Brick Rick and Hyperdrive for the CPC.

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

TotO

Quote from: PulkoMandy on 13: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.
Sure. It is why the MiniBooster is CPC Booster compatible, The X-MEM is CPC/DK' compatible and the X-MASS is Symbiface compatible.  :-\

Quote from: PulkoMandy on 13:41, 16 February 16I 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)

PulkoMandy

Quote from: TotO on 14:37, 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)

TotO

Quote from: PulkoMandy on 14:55, 16 February 16Well, 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

Quote from: PulkoMandy on 14:55, 16 February 16For 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)

PulkoMandy

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).

TotO

Quote from: PulkoMandy on 16:19, 16 February 16for 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)

TFM

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

PulkoMandy

Quote from: TotO on 17:31, 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.

TotO

Quote from: PulkoMandy on 18:52, 16 February 16With 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.

Quote from: PulkoMandy on 18:52, 16 February 16Also, 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)

ukmarkh

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  ;)




CloudStrife

#238
Quote from: TotO on 21:35, 16 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:

    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:

    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...

||C|-|E||

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  :-* .

remax

Ca bouge avec la poste !


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


@PulkoMandy : T'es du 31 aussi ?
Brain Radioactivity

PulkoMandy

@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.

gerald

Quote from: PulkoMandy on 21:16, 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

remax

#243
Quote from: PulkoMandy on 21:16, 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
Brain Radioactivity

PulkoMandy

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!

Sykobee (Briggsy)

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.

TotO

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)

CloudStrife

Quote from: PulkoMandy on 21: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.

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]

PulkoMandy


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!

||C|-|E||

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.

Powered by SMFPacks Menu Editor Mod