CF Card Issues - DIY Z80 COMPUTER from scratch

216 views
Skip to first unread message

Matheus Yan

unread,
Apr 21, 2025, 7:35:57 PM4/21/25
to retro-comp

Hello, has anyone here ever had a similar problem? I'm basically trying to use my CF card interface board that used to work with another memory card, which unfortunately got damaged (my fault). Now I only have this one card, which seems to require more accurate timing to function properly.

I've already tried two different circuits: one using capacitors (the first tested in the video) and another using flip-flops to introduce proper delays (the second shown in the video). With the first circuit, the card passes memory tests and can be formatted, but it doesn't even boot into CP/M. With the second one, it does all that and even boots into CP/M, but I can't interact with the system after that.

It used to work perfectly with my other CF card. Fortunately, I have a backup image of it, with several programs and even Colecovision games already installed. However, I can't use that image on the new card because the old one was 256MB and this one is only 128MB — so I'm having to reinstall CP/M from scratch.

What matters most to me is understanding what's causing the issue and making my project compatible with more CF cards. I checked with an oscilloscope, and in both circuits (capacitor-based and flip-flop based), the DL_RD and DL_WR signals are coming significantly after the CF_CS signal, which I believe meets the CF timing requirements. Still, it doesn't work properly.

If anyone wants to know more about that like full schamtics and another stuff: https://hackaday.io/project/195954-the-homebrew-handwired-z80-computer-h2z80


491920803_3039498509532675_4769145206175440656_n.jpg

492510477_3039498362866023_6440495029205894870_n.jpg

490345031_3039498146199378_1559091256079398034_n.jpg

492002346_3039500996199093_6142978837467178741_n.jpg

Bill Shen

unread,
Apr 22, 2025, 12:08:43 AM4/22/25
to retro-comp
I don’t quite understand your flip-flop delay logic.  What you want to achieve is delaying CF-RD and CF-WR with respect to CF for the start of CF access; and negate CF-RD or CF-WR at the same time or before negation of CF at the end of CF access.  A reasonable modification for IC37A is disconnect the RD to pin 2 and connect CF to pin 2; also disconnect OR gate output to pin1 of IC37A and connect pin1 to VCC

Similar modification to IC37B; disconnect pin12 from VCC and connect pin12 to CF; disconnect pin13 from IORQ and connect pin13 to VCC.   Good luck!

Matheus Yan

unread,
Apr 22, 2025, 9:04:35 PM4/22/25
to retro-comp
Hi Bill, I modified the capacitance circuit and its looks great now, Im thinking that I dont need to test the Flip Flop ono at all. I stil modifyed the circuit as you say, but not builded it. Here down are the new circuits (its the same to RD and WR delayed) and the timings im geting now. But, after it enter the CP/M i cannot type any char, its frozen when I try and looks its geting the INT pin on and stopping the Z80, I not know why.Captura de tela 2025-04-22 215604.pngCaptura de tela 2025-04-22 220231.pngCaptura de tela 2025-04-22 215853.pngCaptura de tela 2025-04-22 215718.png

Matheus Yan

unread,
Apr 22, 2025, 9:35:04 PM4/22/25
to retro-comp
I tryed to just cut off the INT wire that goes from from the SIO to the z80, it do not get on more, but the sistem seems to stop reponding, it no more get the CF on all time when frozes, just stop reponding after launch CPM. What can be happening here? Im really confused, as it was working before, Its possible that CP/M B is not the one I should be using here?

Bill Shen

unread,
Apr 22, 2025, 11:12:39 PM4/22/25
to retro-comp
 It seems to me you need to rewind and re-trace your software development leading up to CP/M.  CF is not absolutely needed to run CP/M; you can load the BIOS/CCP/BDOS manually into high memory, then jump into BIOS entry point to get CP/M prompts.  Working CF is not needed to reach this point, so you can at least check the console IO routines are working.
Bill

Matheus Yan

unread,
Apr 25, 2025, 5:43:34 PM4/25/25
to retro-comp

Hi Bill, thanks again for your help earlier. I wanted to share an update and ask for your input on this new issue I’m facing.

The system used to work perfectly, including CP/M 2.2 B running from the CF card. I had a working image with several programs installed, and I even saved a backup. Now, even using that same image (or doing a fresh install), CP/M freezes right after it boots and I press any key. The CF card LED stays on, and the system becomes unresponsive.

I'm using Small Computer Monitor as the ROM monitor and loading CP/M from the CF card (CF at 0x10h, SIO at 0x80h). I made some changes to the delay logic, and the CF interface seems more stable now — no errors during the monitor stage.

I’ll attach logic analyzer screenshots showing what’s happening on the bus:

  • Before loading CP/M (system stable) - first image

  • Right after loading CP/M (still OK)  - seccond image

  • Right after pressing a key and the system freezes (INT goes active and stays stuck)  - third image

Could you help me understand what might be going wrong now? I really want to get this working again with CF properly integrated. Thanks in advance.Problem.pngSCM boot.jpg

After boot CPM - BEFORE FREEZE.jpg

After CPM Freeze.jpg

Bill Shen

unread,
Apr 25, 2025, 8:08:58 PM4/25/25
to retro-comp
 At least you have small computer monitor to help you.  SCM has commands to display and set IO space.  You can use these command to peek and poke CF registers at locations $10-$17.  I don’t know how much you know about CF disk, but you can manually set CF to read mode and read out 512 bytes of data; you can also manually set CF to write mode and write 512 bytes of data into CF.  If you are successful with manual read/write, you can create a small diagnostic program to read, write CF.  You need to do these without errors before booting CP/M.

Matheus Yan

unread,
Apr 25, 2025, 8:28:18 PM4/25/25
to Bill Shen, retro-comp
I already used this two prgrams from Small Computer central to test the CF card, They say the card are responding ok (the tests goes ok all the way by the CF sectors) I think the problem is elsewhere, with the INT pin. going low and never being reseted after boot CPM and I press any key. image.png

--
You received this message because you are subscribed to a topic in the Google Groups "retro-comp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/retro-comp/RNnA3mhrXnc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to retro-comp+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/retro-comp/a281c42a-cd1c-4e12-8b06-299797d0ca96n%40googlegroups.com.


--
Y>A>N>
Compact_flash_test.rar
Compact_flash_information.rar

Bill Shen

unread,
Apr 25, 2025, 10:52:44 PM4/25/25
to retro-comp
You’ve mentioned that your 128meg CF is not working, but I see you are testing a 256meg CF which seems to work OK.  Is it the 3rd CF?  Have you initialized it with CP/M data and it still does not boot?  There is a procedure for transferring CP/M to new CF disk, it has been a long time since I use it last, so I don’t remember the details.

Matheus Yan

unread,
Apr 26, 2025, 8:57:33 AM4/26/25
to retro-comp

This 256MB CF arrived yesterday, it’s identical to the old one I had (that burned). This new CF tolerates imperfect RD and WR timings better (even though I already fixed the circuit to improve access timings, and now even more sensitive CFs are working too).
With 256MB I can restore my backup that I saved last year on my Windows PC, with all my CP/M programs and files.

I'm not installing CP/M through Windows — I format the CF using the Small Computer Monitor with its own format tool, then I run the PutSys program to install CP/M B, just like I did a year ago.
The backup I have on Windows is just a .bin file exactly the same size as the CF card. Windows can't read it, but I can restore it perfectly anytime using a disk recovery tool (ImageUSB), which copies the disk byte-by-byte without changing anything.



Captura de tela 2025-04-26 094959.pngCaptura de tela 2025-04-26 095122.pngSem título.png

Dave White

unread,
May 7, 2025, 1:32:47 PM5/7/25
to retro-comp
Could it be that the "identical" card is actually slightly smaller due to manufacturer's bad block count?
Reply all
Reply to author
Forward
0 new messages