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

TotO

I have never understood why it was required to swap the buttons for left-handled peoples, when the brain already do that.  ;D
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

PulkoMandy

Well my main mouse is left-handed in hardware which adds even more confusion to this, so... (but it also wouldn't work with this code, too many mousewheels)

GUNHED

Hi, Slarti (#66 on the waiting list) just asked me to guess how long it could take to get his Albireo.
It there any plan in making more boards? Any kind of time schedule or guess? It would be great to get some kind of hint.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

PulkoMandy

I think I mentionned it earlier, I transferred all the production efforts to CloudStrife. He has the PCBs and chips and should be assembling them. So this is not under my control.
If anyone else wants to assemble boards, all the hardware schematics and PCB designs are available, as well (there are small chips, so it needs some skills and/or appropriate tools).
I don't currently plan to assemble more of these myself.

Targhan

#454
@PulkoMandy Watch out for a terrible bug in your annotated code! "AlbireoReadDat": I typed "rre" instead of "ret"!!!

As for the mouse buttons, it seems it's "all right" now. Bit 0 is left button, bit 1 is right, bit 2 is middle. I don't understand what was going on.
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

PulkoMandy

Thanks, updated :)


I also included the note about "boot mode" there.

Targhan

@PulkoMandy I think there is another bug somewhere. On CPC cold start, when starting the code, the Albireo's mouse is not responsive at all (though, thanks to the white border, we can see it "see" something (a few scanlines are white). The rest of the code works fine (cursor, joystick, etc.).

I do a reset (via a reset button), run the program again and it works fine this time. Something wrong on the init maybe?
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

GUNHED

Quote from: Targhan on 12:56, 17 April 20
@PulkoMandy I think there is another bug somewhere. On CPC cold start, when starting the code, the Albireo's mouse is not responsive at all (though, thanks to the white border, we can see it "see" something (a few scanlines are white). The rest of the code works fine (cursor, joystick, etc.).

I do a reset (via a reset button), run the program again and it works fine this time. Something wrong on the init maybe?


Actually, that's pretty much the same problem I had for a long time. Slowly we're getting closer... Hope this problem can be addressed.

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

PulkoMandy


1) According to the docs, changing USB modes can take 10us, so maybe a few NOPs at lines 32 (where you have "basic: 110") will help with that.


Extra safety:
After waiting for command #15, you can also read the data register, which should return #51 (success) or #5f (failure). This can happen if no USB device is connected to the Albireo.
Likewise, after calling command #22 in AlbireoWaitForCommandEnd, you can read the data register and check bit 5, which is set if the command failed.


2) You can try to do a complete reset sequence for the USB device:



        ld a,#15 : call AlbireoCmd
        ld a,#5 : call AlbireoDat
        ; ... wait 10 NOPs ...


        ld a,#15 : call AlbireoCmd
        ld a,#7 : call AlbireoDat
        ; ... wait 10 NOPs ...
        ld a,#15 : call AlbireoCmd
        ld a,#6 : call AlbireoDat



3) You can also try to start with a complete reset of the Albireo at the start, to make sure it is in a known state. Write 5 to the CMD port and wait at least 35 milliseconds (3 times call &bd19 would do).


4) If you use a reset button, is switch n.2 on your Albireo set to ON (this is the default when the boards are shipped, but maybe you changed it)? This would let the reset button reset the Albireo as well, so it doesn't need to be done in software (at least step 3 above shouldn't be needed then)

Targhan

Thanks!

Plan 1 worked:
I added
ld b,180 : djnz $
Just after

        ;Basic: 100
        ld a,#15 : call AlbireoCmd
        ld a,#7 : call AlbireoDat

I used 180 to be on the safe side: something like 130 is minimum.

QuoteAfter waiting for command #15, you can also read the data register, which should return #51 (success) or #5f (failure). This can happen if no USB device is connected to the Albireo.

I tried to do that after the first command #15 (and #7 on DAT), but the result was unpredictable: the mouse didn't response after a short while. Reading the "data register" is simply calling AlbireoReadDat, right?
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

PulkoMandy

Yes, right. So I don't understand the docs (badly translated from chinese, it's not always easy)

Targhan

Have a go if you want :).
But with all that we have, I think the result is now fairly good! And it looks reliable to me.
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

VintageAdvantage

Not really interested in a mouse interface.
Can I put in a SD card into the Alberto and use it as a DF1 disk drive?


PulkoMandy

It does not emulate a floppy drive. There is a work in progress ROM allowing access to the SD-Card in AMSDOS compatible way. So software that uses the AMSDOS ROM for access works, but not anything that programs the floppy controller directly.

Tone-la

@PulkoMandy re post  [size=0px]#453[/size] can you point me to the gerber and BOM info is for the latest Albireo board, I'd happily have a go at some construction.  I'm not a professional (it's not my trade), but am competent and keen.  This is a fantastic project / concept and I'd love to help with the hardware and if possible the firmware / software too


PulkoMandy

I apparently didn't store the Gerber files anywhere, but they can be generated from the Kicad project which is here: https://github.com/pulkomandy/avrstuff/tree/master/CPC stuff/ch376

VintageAdvantage

There is a lot that can go wrong with Gerbers export in kicad. It is not that simple!!
You should provide an official version and then pass on the work. You can also send it to China for assembly service.

PulkoMandy

I agree, but I forgot to save the file back when I ordered the boards (that was 3 years ago) and there isn't a lot I can do about it right now except hoping that I can still load this fine in kicad and export it again. But then it will be as untested as if anyone else does it.

OffseT

AlbiDOS support ROM for Albireo file operations was updated today (v0.65).  8)

Download it here

User and developper documentation there

Don't hesitate to ping me if you have questions or bugs to report.

Catch us on IRC #cpc channel
(freenode network)

French people can use #cpc-fr too


OffseT

AlbiDOS support ROM for Albireo file operations was updated again (v0.84).  8)

Download it here

User and developper documentation there

Don't hesitate to ping me if you have questions or bugs to report.

Catch us on IRC #cpc channel
(freenode network)

French people can use #cpc-fr too

GUNHED

Thanks for the update. However, you could add an checksum to byte &FFFF (the sum of bytes &C000 to &FFFE in one byte). This would enable us to check for download / transfer errors.


Of course this can be done by hand or using a ROManager too, but it's nasty.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

OffseT

FYI, AlbiDOS is now cancelled as it was turned into a "DOS Node" for the bigger UniDOS project. 8)

Targhan

#473
@PulkoMandy Now with UniDos I can start using more Albireo!!

I'm especially interested in the USB transfer stuff. I don't know the current state of things, so please allow me to ask these questions:
- Is it possible to receive a SNA from PC via USB? I remember there was some troubles with SNArkos.
- If possible, sending a SNA from a command FROM the PC (including a Reset). I can do that with the M4 Board, but if I can ditch the Wifi network, I will.
- Would it be possible to use the USB transfer as a drive in UniDOS? Then all I would have to do would be to update a PC folder to get the result on CPC. It would be soooo great (it would require a client PC side, I guess).

Thanks!
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

PulkoMandy

In theory, all of this is possible. But someone has to write the software.


For SNArkos and the Arkos ROM pack, the code is here: https://github.com/cpcsdk/unofficial_arkos_rom_pack
I havec ùGF and ùSF working. WriteDSK/ReadDSK was crashing last time I tried. I did not find why. Probably my UART driver code is touching registers or stack that it shouldn't.


SNArkos is a bit tricky because it needs to work with almost no CPC memory and z80 registers. On the CPC booster it used an internal buffer in the hardware, but there isn't an exact replacement on the Albireo. I can think of two alternatives:
- It is possible to put the uart in loopback mode at the end of the transfer, and use its internal send and receive buffers
- It is possible to peek and poke to the USB controller as well


Resetting the CPC from the PC is possible. You need to enable that on the Albireo (switch nº 3 to ON position). Then the DTR signal on the serial port will reset the CPC. Alternatively it can also be configured to trigger an interrupt or NMI.


Using the USB drive as an UniDOS drive is also a good idea. It could be done as an extension of the AFT protocol or using a more standard protocol (XMODEM or YMODEM). CloudStrife has been working on an YMODEM client which is available here https://framagit.org/shinra/albireo/albireo but not as an Unidos node yet.


I think Zik is already using some parts of this in his current development setup, maybe you can ask him what he does.

Powered by SMFPacks Menu Editor Mod