How to direct select an image

General discussion forum - for all that doesn't fit in any other category.
Post Reply
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

How to direct select an image

Post by AdmDecker »

SD Card HXC Rev. C

Hi, I'm working on an alternative way to select images without the need of pressing the up / down keys.
Well I figured the pins for selecting up and down at interface J2 having the same behaviour than pressing directly the keys.
I tested to pulse up and down by using an arduino uno.
Obviously it takes takes too much time for switching to the desired image, because a key press needs a high to low duration of about 170ms and needs a delay of about 170ms to pulse again.
Another way would be to communicate directly to the emulator via the floppy cable.
Does anyone know the method and the specific protocol for this communication? (I assume it's a serial RX/TX communication over 2 unused wires of the floopy cable)

Thanks.
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

Re: How to direct select an image

Post by AdmDecker »

Okay, I browsed the forum and found some interesting topics to this.
Now, I think I understand the principle of how the communication works.

Is there a way to let an arduino select an image by communication over the floppy cable?
Does anyone has some experiences on this?

Thanks
Jeff
Site Admin
Posts: 8247
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: How to direct select an image

Post by Jeff »

AdmDecker wrote: Sun Nov 19, 2023 1:05 pm Okay, I browsed the forum and found some interesting topics to this.
Now, I think I understand the principle of how the communication works.

Is there a way to let an arduino select an image by communication over the floppy cable?
Does anyone has some experiences on this?

Thanks
This is the host system that should control the emulator.
Some technical documentations :

https://hxc2001.com/download/floppy_dri ... s_mode.pdf
https://github.com/jfdelnero/HXCFE_file_selector
https://github.com/jfdelnero/HXCFE_file ... a_access.c
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

Re: How to direct select an image

Post by AdmDecker »

Thank you, but I knew these documents before.
I just have to get into the idea on how the communication is working. So my first step is to read the status on sector 0.
After once the direct access mode is active, I figured that I have to wait for the index signal. But how do I read the information?

Just to clarify for myself. LBA is equal to sector, right?
Why does the manual differentiate between LBA and sector?
Jeff
Site Admin
Posts: 8247
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: How to direct select an image

Post by Jeff »

AdmDecker wrote: Mon Nov 18, 2024 1:02 am Thank you, but I knew these documents before.
I just have to get into the idea on how the communication is working. So my first step is to read the status on sector 0.
After once the direct access mode is active, I figured that I have to wait for the index signal. But how do I read the information?

Just to clarify for myself. LBA is equal to sector, right?
Why does the manual differentiate between LBA and sector?
LBA : Logical block addressing (LBA) is a technique to specify the addresses of blocks of data on a storage device, here the sector.
Sector : The physical sector.

Just to understand : What are you trying to achieve ? it seems that you are trying to control the hxc with the Arduino through the floppy interface with the direct access mode ? If so this is definitively not the way the whole stuff was designed.
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

Re: How to direct select an image

Post by AdmDecker »

Yes, my goal is to select an image via an arduino.
Well there are libraries for reading floppies like FATFs. So the Arduino turned into a floppy drive controller.

Let's assume the content of the SD card is known. There is theoretically no need to ask for the content, right?
The point ist, after I got access to the direct mode,
I'm leaving the common way to read the content of the disk.
How can I transmit the command to select an index of an image ?
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

Re: How to direct select an image

Post by AdmDecker »

Jeff wrote: Mon Nov 18, 2024 9:49 am It seems that you are trying to control the hxc with the Arduino through the floppy interface with the direct access mode ? If so this is definitively not the way the whole stuff was designed.
You explained in the technical information of "SD HxC Floppy Emulator Direct Access mode" the following:
"...This feature allows the development of file images selector software or hard disk driver."

I think, I'm exactly using this device in the way it was designed for by communicating via the given protocol.
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

Re: How to direct select an image

Post by AdmDecker »

AdmDecker wrote: Sat Nov 18, 2023 12:19 am Well I figured the pins for selecting up and down at interface J2 having the same behaviour than pressing directly the keys.
I tested to pulse up and down by using an arduino uno.
Obviously it takes takes too much time for switching to the desired image, because a key press needs a high to low duration of about 170ms and needs a delay of about 170ms to pulse again.
Another approach would be to realize a faster way for selecting the desired index. The current FW doesn't allow fast pulsing, though. And it would be great if there was a way to automatically stop at index 0 when decrementing.
Jeff
Site Admin
Posts: 8247
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: How to direct select an image

Post by Jeff »

AdmDecker wrote: Mon Nov 18, 2024 12:00 pm How can I transmit the command to select an index of an image ?
you mainly need to be able to decode (read) and encode (write) mfm sectors to browse the sdcard fat partition to edit the CFG file.
AdmDecker
Posts: 10
Joined: Fri Nov 17, 2023 11:49 pm

Re: How to direct select an image

Post by AdmDecker »

Ok, lets get step by step through this.

By moving to track 255 the emulator is providing the status informations (ID=0 Status / control) continuously with each index signal indicating the beginning of the track.

To get these informations I just have to read 512 bytes of Track 255, Sector 1, Side 0 ?
Post Reply