I am building a laptop with a W65C02, lots of memory, SID-sound, decent graphics and a filesystem.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
plain - 32.79 kB - 06/03/2021 at 12:44 |
|
This morning I logged in to Fuzix and got the first fortune-cookie.
Thanks to the help of Alan Cox, I can now run Fuzix on real PZ1 hardware as well as emulated courtesy of the RC2014 emulator. Feels great!
Now I have a ton of work ahead to understand more of how Fuzix works.
FUZIX version 0.4pre1 Copyright (c) 1988-2002 by H.F.Bower, D.Braun, S.Nitschke, H.Peraza Copyright (c) 1997-2001 by Arcady Schekochikhin, Adriano C. R. da Cunha Copyright (c) 2013-2015 Will Sowerbutts Copyright (c) 2014-2022 Alan Cox Devboot 512kB total RAM, 448kB available to processes (15 processes max) Enabling interrupts ... ok. Mounting root fs (root_dev=0, ro): OK Starting /init init version 0.9.0ac#1 Checking root file system. Current date is Sun 2022-09-18 Enter new date: Current time is 7:17:04 Enter new time: ^ ^ n n Fuzix 0.3.1 >@< Welcome to Fuzix m m login: root Welcome to FUZIX. #
Here is my finished version of the CPLD-based HW. Works really well, using a CPLD to manage RAM-access and decode the different memory ranges. The Pico has much less to do and only needs to read the add/data if an I/O-operation is happening. This results in more than twice the speed compared to the PCB-version with buffers only.
This is clearly the way I would like to move ahead, with an ATF1504 CPLD as only glue logic between RAM, 65C02 and Pico. Due to the global chip shortage this will not happen any time soon, so I will shelf this proof of concept until sometime in the future when we can buy the chips we want,
Quick BOM:
- ATF22LV10C CPLD
- 74HC670 x2 for bank switching
- 74LVC244 for reading low byte of address
- 74LVC245 to read/write data byte
- 65C02 CPU
- 512KiB SRAM
- Pico acting as a complete and smart I/O-solution plus top-page ROM
- SD-card holder
- small speaker for SID-sound output
I was not satisfied with the performance of the previous version of PZ1_Pico, too many cycles were spent driving memory. So I went in the direction of CPLD to see how far that would take me.
It turns out quite far. With an unbuffered addr/data interface and an overclocked Pico, I could run the 65C02 @8MHz on the rats nest pictured below! The CPLD (ATF22LV10) performs RAM timing/decoding and there are 2x 74HC670 to deal with banked memory. The Pico handles top page ROM duty as well as all I/O-devices implemented. It also drives the CLK of the 65C02.
I REALLY didn't expect this to work at these speeds! I thought the 74HC670:s and the bread board would be big hurdles to reach much more than 2MHz, but I was obviously wrong.
This is not the final result, I've already built a version that adds 2 buffers for the data/addr so it is possible to get the number of used Pico-pins down to only 16 for interfacing with the 65C02 and CPLD. That leaves 10 gpio for all the I/O I want to drive, just like on the PCB-version. That is an even messier rats nest that will not show up in this post :)
There is a major problem with this implementation: the global chip shortage has most CPLDs I've looked at in severe scarcity. I have a few chips that I can make my prototypes with, but I couldn't build any more if I wanted to.
I've been trying out different ways of optimizing the code to maximize the headroom for more HW-blocks in the Pico, and in doing that I happened to read the datasheet of the SRAM. There are 2 ways of controlling the read/write cycle, and I used the more traditional with CS tied to ground, WE & OE controlled by 2 separate signals from a 74LVC373. The 373 register was needed because the Pico has too few gpio pins. The other way of controlling the read/write cycle is to tie OE to gnd, WE to R/W of the 65C02 and use CS to tell when a read OR write cycle is occuring, saving a gpio pin.
I repurposed the SYNC-pin from the Pico that I didn't use anyway and now control the SRAM directly without going through the register (which takes extra time).
4 lifted legs and 3 soldered wires is all it took to mod the circuit, no cut traces.
The SW has also been reorganized some to enhance the performance a bit further.
All in all, I went from 18500/20000 down to 14900/20000 with all these changes. Well worth it!
Now I just have to document it all and respin the schematic and layout before ordering new PCBs. Or maybe wait for further inspirations to pop up...
A second release of the Pico code is now ready on GitHub. No HW changes have been made, the PCB I ordered actually works!
This time I use my scheduler to multitask and manage the 512KiB RAM properly. Nothing new functionally compared to the Teensy-version of PZ1, only a proper port to the Pico-version. I use the second core on the Pico for sound :D
On holiday, but still coding in a few spare timeslots :)
The added SD-card reader works, files on FAT16/32 can be used now.
EhBasic with multitasking starts, still needs some more testing.
65C02 runs @1MHz with everything enabled on 133MHz Pico. SID emulation and mixing at 44100Hz, no filters. Only core 0 used so far. PIOs could probably be used to offload a significant amount of load by reading/writing the buffers.
Looking bright!
Now all the work left to get this up to snuff for a GitHub release.
The PZ1_Pico project is now available at GitHub: https://github.com/NollKollTroll/PZ1_Pico
I wrote some low-level tests to make sure the buffers worked properly before implementing the simplest system. A version of EhBasic running in 16KiB ROM (in the Pico) and 48KiB of the external SRAM with one serial port via the Pico USB connection. Runs at a bit faster than 2.5MHz without optimizations or overclocking of the Pico.
I didn't think I'd get it correct on the first try, but the PCB really works as intended, YAY!
I'll wrap it all up neatly and make a decent Github repository of code/PCB/docs before going back to porting Fuzix.
I got the PCBs from China yesterday! 5 pcs, 75x100 mm, 4 layer. They are REALLY nice and professional looking, a far cry from the double-sided stuff I did in the kitchen 25 years ago :)
So far everything seems correct. Power supply lines are correct and the first 74LVC373 buffer works correctly. More soldering to be done and a lot more test-SW to write.
PCBs front, back and partly soldered
I got stuck in trying to debug what went wrong in the Fuzix boot.
To combat that frustration I've been working on learning Kicad 6 properly, while also trying to design a PZ1 PCB around the Raspberry Pi Pico instead of the Teensy.
The Pico is really cheap and readily available but has too few gpio pins, so I use five 74-chips to expand the usage of the available pins. This should work well but requires more cycles on the Pico.
Kicad 6 is really nice to work with, though the bus/wire concept in the schematic capture could really be more streamlined and documented better. I also got Freerouter running, so the resulting PCB is a 75x100mm 4-layer card. Compared to the commercial package I used before 2000, this is a very powerful, quick and easy tool to use!
I'll do a few more inspections spread out over a few days before I feel ready to order a PCB.
This revision of PZ1 has a proper 65C02 CPU and 512KiB SRAM with the Pico acting as glue logic and 6502-I/O. The 74-chips are gpio-expanders to the Pico.
Create an account to leave a comment. Already have an account? Log In.
An enclosure will be done in the future, I've experimented with 3d-printed shells. Not high priority.
I use 3x 18650s for the power on my prototype, works well.
tree this same? I have old 18650 and AA it working?
this is trouble. small computer need flexible power. I have 18650 3Ah and 1.2Ah diffrerent size
enclosure must be tiny, not fat
can You show cc in action? for example is possible run ruby, compile it or git?
You coul;d probably make it run Fuzix but then you need decent I/O performance. The basic set up of the system is actually pretty similar to the RC2014-6502 and 65C816 based systems -down to the 74HC670 as MMU and the $FE00 I/O space.
The 6502 isn't as bad at C as people make out. It's funny when Z80 people say 'I've got an instruction for that and the 6502 needs a subroutine' and you point out the 6502 subroutine is still less clocks 8)
I've had a quick look at the Fuzix source and it sure is tempting! I still have to get to grips with how I could use my task/memory model which involves separate ZP, stack and memory for each process. I could probably use the RC2014-6502 code as-is, but I designed this HW to improve multi-tasking performance on the 6502.
Will spend some time looking deeper into Fuzix.
This project started because I wanted to code 6502 assembler. Early in the project I did some tests on code I wrote for cc65. The resulting binary runs fine, but is far from the "optimized" state of a semi-decent assembler program. So I agree, C on 6502 is very doable, just not what I wanted to use.
I'll probably have some technical questions for you later on, better suited for a PM.
Do You planing create a second revision? meybe better enclosure and power (mobility) Lipo or 18650
Yes, I am working on a better keyboard/enclosure. There is already an 18650-solution that works well. Many revisions have been done that change other aspects of the solution :)
[this comment has been deleted]
Theoretically it is very possible, but not something I have plans to port. I have a multitasking kernel of my own design that I still enjoy working on/with.
Fuzix on this platform would be a bit hampered because C-compilers on 6502 is all but effective... Works much better on Z80 or 6809 :)
such a nice project ... but a question ... at one of the pics i see a 65c02 .. but do you work with this or emulate a 6502 only with the teensy ???
It started as an NMOS 6502 emulation, and has changed into more HW. I'm using a W65C02 today. Sorry about the confusion but this page is treated as a build log, not a proper project documentation. That will come when I am sufficiently done in any sense.
[this comment has been deleted]
Yes, that is an interesting project that I follow. My current coding is all done in glorious 65C02-assembler though, it is so much fun!
[this comment has been deleted]
I'm testing out the possibilities of the Pico right now. It is very interesting in itself, but I'm not sure it is the best fit for PZ1. We'll see what happens in the future.
[this comment has been deleted]
I don't know the power draw of my current implementation. If I had low power as a requirement, the solution would be very different from the current one.
The three 18650-cells in the current version lasts >8 hours.
[this comment has been deleted]
I create this for my own amusement, I have no intention of collaborating with people to make a "product". Building real products is something I get enough of at work. The writing I do on these pages are done in the hope it will inspire or maybe teach something to someone. I appreciate reading other build blogs immensely.
The power will be handled by a simple USB power bank that I already own. Works well enough, will get more than 8 hours of runtime and can charge and run simultaneously.
The keyboard I use is in my opinion a very nice Cherry G84-4100, which will be incorporated into a laptop-esque enclosure in due time.
I absolutely don't want to be a dream breaker, but I want a laptop that runs on very little power.
I would like to have a laptop that has gcc/ssh/git/mc/ruby/lynx that will run a week on one battery charge.
Don't just think of yourself. A lot of people just need this computer. Give the possibility to put different machines in there (fpga/fom/esp etc). You will help others to use your favorite equipment.
Big corporations have completely different goals. They want to make people dependent on their equipment. You do something for ordinary hackers. Please think it over again.
nice design (similar zx88),
add potenciometer for sound, switches for turn on off whole computer or(and) component.
What You think about solar power .
The Z88 was a very nice but underappreciated laptop, I certainly have had my eyes on it design-wise. Also the Amstrad NC100.
There is a 50-turn pot for sound, which will be swapped to something decent later.
The battery bank I've tested with has its own on/off switch, which I'll use.
The total power draw is just shy of 1.5W, so I guess solar power would be feasible. However, this is not really the most efficient laptop I could think of, low power design would become a totally different beast.
Great! Just what I was hoping for so far. I plan to 3D-print an enclosure later so it will resemble a more commercial offering, but still from the 80's. I REALLY hope to be able to carry this thing around to play with :D
Become a member to follow this project and never miss any updates
please make enclosure like ELLO in wood or plexi and sel in tinde
fuzix and stepup power from 1-24V will be great. for example AA or(and) 18650