USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!

Started by ikonsgr, 08:17, 01 December 20

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Fran123

#1250
Quote from: ikonsgr on 10:49, 04 September 23First give |WROM,"file.bin" to load binary into eeprom. Then you can access your code by giving a simple basic line:

10 |LROM,&8000:CALL &8000

Optionally you can also access your code from assembly, using an RST3,&FC00

Also, if you want to execute multiple functions, you can create a single binary file and use the output of compiler to determine what memory address to use for calling each function. For example lets say you have the following code:

WinAPE Z80 Assembler V1.0.13

000015  0000                write"FILE.BIN" 
000016  0000  (8000)        org &8000
000018  8000  47                ld    b,a
000019  8001  AF                xor    a
000020  8002  32 CD 84          ld    (tracks),a
000021  8005  3E FB                LD    A,&FB
000022  8007  DB DE                iN    A,(&De)
000023  8009  B7                or    a
000024  800A  CA 96 82          jp    z,usb_dis_err
000026  800D  78                ld    a,b
000027  800E  FE 01            cp    1
000028  8010  28 14            jr    z,continue_routine
000029  8012  FE 02            cp    2
000030  8014  28 03            jr    z,continue2_routine
000031  8016  C3 90 82          jp    no_file
000033  8019                continue2_routine
000034  8019  DD 6E 02          ld    l,(ix+2)            ;image name is on the 2nd argument
000035  801C  DD 66 03          ld    h,(ix+3)
000036  801F  CD D7 82          call    get_arg2
000037  8022  3E 41            ld    a,65
000038  8024  18 04            jr    cont5
000039  8026                continue_routine
------END OF 1st function/command-------------------------------------
000041  8026  CD D1 82          call    get_arg                ;e=image name size, hl=address of name
000042  8029  AF                xor    a
000044  802A                cont5
000045  802A  32 C4 84          ld    (multi_files),a
000046  802D  22 C5 84          ld    (image_name),hl
000047  8030  7B                ld    a,e
000048  8031  32 C7 84          ld    (image_name_size),a
000050  8034  3E FB            ld    a,&fb
000051  8036  DB D8            in    a,(&d8)                ;a=USIfAC II Rom number
000052  8038  32 91 83          ld    (set_dir+2),a
000054  803B                ;;------------------------------------------------
000055  803B                ;; find BIOS: READ SECTOR command
000056  803B                ;;-------------------------------------------
000057  803B  21 69 83          ld hl,cmd_bios_read_sector
000058  803E  CD D4 BC          call kl_find_command
000059  8041  D0                ret nc
000060  8042                ;; command found
000061  8042                ;; store address of command
000062  8042  22 66 83          ld (bios_read_sector),hl
000063  8045                ;; store "rom select" of command
000064  8045  79                ld a,c
000065  8046  32 68 83          ld (bios_read_sector+2),a
000066  8049                ;;------------------------------------------------
000067  8049                ;; find BIOS: move track command
000068  8049                ;;-------------------------------------------
000069  8049  21 6D 83          ld hl,cmd_bios_move_track

You use |LROM,&8000 to load all your code to ram, and then using CALL &8000 access the 1st function, and CALL &8026 ,access 2nd function. This is an easy way to develop multiple functions/commands using a simple piece of code ;-)

But, I want to create a |WGET command.  Is it possible?

Have I write |LROM,&8000:CALL &8000 all times I want to use?

ikonsgr

No,i'm afraid you can't create new rsx commands, at least not by yourself.
New rsx commands require to alter the boards Rom code, which is flashed into PIC flash program memory.
BUT, with ULIfAC board, you can create your own custom ROM (with whatever you want and with any rsx commands you like) and then simply add it to ULIfAC's rom board, even on cold boot, using the "auto rom loading" function i recently developed ;-)

Devlin

I want to take the mx4 connector off my usifac2 and replace it with a right-angle edge connector instead of using the extension cable (because mine's been acting up)
Is it as easy as just taking the old mx4 off, and putting the edge connector(f) on it?
CPC464 & CPC6128 + USIfAC II + Revaldinho 512k(universal cpld ver) - Schneider CRT TV
Administrator of Amstrad Discord : https://discord.gg/ksWvApv

Fran123

Hi John,

What about "HS06F014 ESP-01S.bin"?  Is it an standard AT firmware from Espressif?  Or is it programmed by you?  In that case, what functionality have you added?

Thank you

ikonsgr

Quote from: Fran123 on 08:34, 11 September 23Hi John,
What about "HS06F014 ESP-01S.bin"?  Is it an standard AT firmware from Espressif?  Or is it programmed by you?  In that case, what functionality have you added?
Thank you
No, it's just an older ESP firmware that is tested and works 100%, so if you got a newer esp module and doesn't work with the current fw, you can try flash it with this.

Fran123

Does data traffic between the Amstrad and the Usifac2's serial port pins go through the microcontroller?

Another question:

In manual, you say if we want to send a byte we must write:


ld a, x
ld bd, &fbd0
out (c), a

but OUT instruction (http://z80-heaven.wikidot.com/instructions-set:out) "Writes the value of the second operand into the port given by the first operand".
So,  what is register B used for?
If B is not used we could use OTIR to write faster to serial port

eto


GUNHED

Quote from: Fran123 on 17:49, 11 September 23Does data traffic between the Amstrad and the Usifac2's serial port pins go through the microcontroller?

Another question:

In manual, you say if we want to send a byte we must write:


ld a, x
ld bd, &fbd0
out (c), a

but OUT instruction (http://z80-heaven.wikidot.com/instructions-set:out) "Writes the value of the second operand into the port given by the first operand".
So,  what is register B used for?
If B is not used we could use OTIR to write faster to serial port

B is used, because the CPC is - not an 8 - it is an 16 bit I/O computer.
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)

Fran123

Hi

I'm working in a set of programs for UsifacII. I do that with Winape.
When I was going to try some  parts, the real CPC reboots.
The program first at all installs some RSX commands when I do CALL &8000.  In Winape doesn't reboot.

The BIN file I load is in USB-DRIVE and it hasn't AMSDOS Header.

ikonsgr

Quote from: Fran123 on 19:15, 22 September 23When I was going to try some  parts, the real CPC reboots.
The program first at all installs some RSX commands when I do CALL &8000.  In Winape doesn't reboot.
The BIN file I load is in USB-DRIVE and it hasn't AMSDOS Header.
In order to load a bin file into Amstrad's memory it must have a header. An easy way to do that is to use cpcdiskxp utility. You create a dummy dsk image and then add your headerless binary (created by winape assembler), you will get a prompt window to add header:

You cannot view this attachment.

You place 0x8000 on both addresses (fisrt is the memory address for placing code, 2nd is the execution address) and then extact the file from dsk image to usb stick. After that you can load and use your code with a couple of Basic commands:

10 MEMORY &7fff  ;this must always be address-1, in your case &8000-1=&7fff
20 LOAD"FILE.BIN",&8000:CALL &8000

d_kef

It's easy to add an AMSDOS header with WinAPE assembler:

;--------- BIN file AMSDOS header -----------------
    org   0
    checksum reset
    db    0,"MYPROG  BIN"
    ds    6,0
    db    2
    dw    0
    dw    binstrt
    db    0
    dw    binend-binstrt
    dw    binstrt
    ds    #24,0
    dw    binend-binstrt
    db    0
    dw    checksum()
    ds    #3b,0

;--------------------------------------------------
    org    binstrt

; some code

binend:
end

d_kef

Fran123

Hi

How much current does UsifacII need?

If I use it with no external PSU, CHT376 module is recognized, but, if I use an 1.5A external PSU is not recognized.
When I use it with out external PSU I can't use ESP01 and USB-drive at same time.

Thanks

ikonsgr

Quote from: d_kef on 08:31, 23 September 23It's easy to add an AMSDOS header with WinAPE assembler:

;--------- BIN file AMSDOS header -----------------
    org  0
    checksum reset
    db    0,"MYPROG  BIN"
    ds    6,0
    db    2
    dw    0
    dw    binstrt
    db    0
    dw    binend-binstrt
    dw    binstrt
    ds    #24,0
    dw    binend-binstrt
    db    0
    dw    checksum()
    ds    #3b,0

;--------------------------------------------------
    org    binstrt

; some code

binend:
end

d_kef

It gives "undefined symbol error",binstrt, binend should be defined as binstrt: and not as: dw binstrt

d_kef

Nope. You have to define the load address of your .bin file (eg. &2000) preferably in the start of your code, like this:

binstrt   equ #2000

d_kef

Devlin

Quote from: Fran123 on 09:56, 23 September 23Hi

How much current does UsifacII need?

If I use it with no external PSU, CHT376 module is recognized, but, if I use an 1.5A external PSU is not recognized.
When I use it with out external PSU I can't use ESP01 and USB-drive at same time.

Thanks
As I understand it, I'm led to believe that you can only have one active at the same time?
CPC464 & CPC6128 + USIfAC II + Revaldinho 512k(universal cpld ver) - Schneider CRT TV
Administrator of Amstrad Discord : https://discord.gg/ksWvApv

Fran123

Quote from: Devlin on 17:32, 23 September 23
Quote from: Fran123 on 09:56, 23 September 23Hi

How much current does UsifacII need?

If I use it with no external PSU, CHT376 module is recognized, but, if I use an 1.5A external PSU is not recognized.
When I use it with out external PSU I can't use ESP01 and USB-drive at same time.

Thanks
As I understand it, I'm led to believe that you can only have one active at the same time?
I don't know. But when I use the external power supply (3A) neither the wifi module works nor the usb. module.

poulette73

This is normal operation (nothing to do with PSU voltage), @ikonsgr has already explained it, both cannot work simultaneously 😉

When using serial communication:
- serial with USB cable.
- serial with bluetooth module.
- serial with wifi module.

=> USB module CH376 (USB key) is disabled.

Fran123

When I use external PSU (3A) and USB-drive and NO Wifi module, CHT376 module is not recognized.

UsifacII ROM message appears at booting.

poulette73

Quote from: Fran123 on 22:15, 23 September 23When I use external PSU (3A) and USB-drive and NO Wifi module, CHT376 module is not recognized.

UsifacII ROM message appears at booting.
Yes I understand, your problem is different : either a voltage problem, or a USB key problem...
Many USB keys are either not recognized, or poorly recognized, or take a long time to initialize.
In this case I recommend deactivating the "Auto USB" function, and manually activating USB at startup with |USB.
And try with few others USB keys.

I was just responding to the previous message, to confirm that Wifi and USB key do not work simultaneously.

ikonsgr

@Fran123, mind also that you must remove the cap from internal power jumper next to external 5V connector, when you want to use external power.

Fran123

Quote from: ikonsgr on 09:08, 24 September 23@Fran123, mind also that you must remove the cap from internal power jumper next to external 5V connector, when you want to use external power.

do you mean the jumper next to the P_S label?

Fran123


ikonsgr

Quote from: Fran123 on 15:14, 25 September 23
Quote from: ikonsgr on 09:08, 24 September 23@Fran123, mind also that you must remove the cap from internal power jumper next to external 5V connector, when you want to use external power.

do you mean the jumper next to the P_S label?
I mean the jumper with cap next to 5V external connector:
You cannot view this attachment.


ikonsgr

Quote from: Fran123 on 17:22, 25 September 23But I have the UsifacII, not Ulifac
USIfAC II doesn't have external power connector and so it doesn't support external power supply.

Powered by SMFPacks Menu Editor Mod