English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware > Hardware mods

 
 
Thread Tools
Old 18 November 2022, 13:59   #1
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Open source A500 simple SPI controller

I have been working on this idea for a very simple SPI controller for the Amiga 500 and I am pleased to announce that it is ready for release!

Called the "A500 simple SPI controller", this small internal device plugs into the 68K CPU socket and allows you to connect an internal SD card and an internal/external ENC28J60 ethernet controller to your Amiga 500.
This SPI controller is designed to be as simple as possible so that anyone can build it, hence the "simple" SPI controller. The design uses no programmable logic chips but only jellybean 3.3V 74LVCXX logic chips and a jellybean quad analog switch. It also uses readily available cheap modules for the ethernet and SD-card interfaces. This design was done in Kicad 6.0 and all the files plus a lot more pictures can be found here: https://github.com/Mathesar/a500-simple-spi-hardware.

Drivers are also provided and can be found here: https://github.com/Mathesar/a500-simple-spi-drivers
The drivers are build upon the excellent previous work by Niklas Ekstrom and Mike Stirling.

Hardware:




Internal/external ethernet, I have to print some nice 3D enclosure for this...




AmiTCP in action! Downloading some stuff from Aminet, pinging my favourite website...



The SD card is more than 200% faster than a standard Amiga 500 floppy drive!

Mathesar is offline  
Old 18 November 2022, 18:13   #2
Niklas
Registered User
 
Join Date: Apr 2018
Location: Stockholm / Sweden
Posts: 129
Very cool! It's always nice to see new open source Amiga hardware. Nicely done.
Niklas is offline  
Old 18 November 2022, 19:19   #3
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Quote:
Originally Posted by Niklas View Post
Very cool! It's always nice to see new open source Amiga hardware. Nicely done.
Thanks! But most of the work was actually in the software. Luckily I had some great examples
Mathesar is offline  
Old 18 November 2022, 21:26   #4
utri007
mä vaan
 
Join Date: Nov 2001
Location: Finland
Posts: 1,653
Nice! Zorro version would be nice, but maybe too much to wish.

Though there are open source Zorro II passthrough for a Amiga 500 to use with sidecars. Which would mean more possible users?
utri007 is offline  
Old 19 November 2022, 08:08   #5
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Quote:
Originally Posted by utri007 View Post
Nice! Zorro version would be nice, but maybe too much to wish.

Though there are open source Zorro II passthrough for a Amiga 500 to use with sidecars. Which would mean more possible users?
The goal with this design was to make it as simple as possible, just like the 14MHz accelerator I posted before.

It wouldn't be too hard too make a Zorro-II version but then I would probably use a CPLD or something similar. SPI interfaces are among the simplest interfaces to implement. The hard work is always in the software. A Zorro-II version could be a more sophisticated design with a hardware shifter and autoconfig logic contained within a small CPLD. That would easily be at least 10 times faster even on a 7MHz 68000. And the only thing that would have to change are the lowlevel SPI functions.
Thinking about it.... an open source ethernet controller for big box Amiga's would be nice. I don't think any exist right?
Mathesar is offline  
Old 19 November 2022, 17:26   #6
utri007
mä vaan
 
Join Date: Nov 2001
Location: Finland
Posts: 1,653
Quote:
Originally Posted by Mathesar View Post
Thinking about it.... an open source ethernet controller for big box Amiga's would be nice. I don't think any exist right?
There is this

https://github.com/MHeinrichs/Zorro-LAN-IDE

SPI could be lots of more than LAN, or mass storage.
utri007 is offline  
Old 19 November 2022, 22:04   #7
SukkoPera
Mighty Pirate
 
SukkoPera's Avatar
 
Join Date: Dec 2017
Location: On the borderline
Age: 44
Posts: 177
Nice work, keep it up!
SukkoPera is offline  
Old 19 November 2022, 22:35   #8
orphan264
Registered User
 
Join Date: Apr 2018
Location: Maine, USA
Posts: 51
Nice! Well Done!
orphan264 is offline  
Old 20 November 2022, 05:06   #9
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Bravo!
tygre is offline  
Old 20 November 2022, 08:42   #10
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Quote:
Originally Posted by utri007 View Post
There is this

https://github.com/MHeinrichs/Zorro-LAN-IDE

SPI could be lots of more than LAN, or mass storage.
A design by Matze so should be good! No need for a new design then.

Maybe the next project for me is to combine the 14MHz accelerator and the SPI controller in an nice external GVP HD8+ like design that plugs into the side expansion slot. Sort of like an ACA500+ but then good looking. I tried stacking the 14MHz accelerator stacks upon the simple SPI controller and that worked like a charm. Made everything go much faster but the low amount of fast ram (only 1MB) is a limiting factor so a new external design would need 4MB or more.

What else would be interesting on SPI btw? An RTC clock? MP3 decoder?

Last edited by Mathesar; 20 November 2022 at 08:48.
Mathesar is offline  
Old 20 November 2022, 12:52   #11
utri007
mä vaan
 
Join Date: Nov 2001
Location: Finland
Posts: 1,653
Quote:
Originally Posted by Mathesar View Post

Maybe the next project for me is to combine the 14MHz accelerator and the SPI controller in an nice external GVP HD8+ like design that plugs into the side expansion slot. Sort of like an ACA500+ but then good looking. I tried stacking the 14MHz accelerator stacks upon the simple SPI controller and that worked like a charm. Made everything go much faster but the low amount of fast ram (only 1MB) is a limiting factor so a new external design would need 4MB or more.
I have GVP HD8+ and it looks really looks good. How you gonna get cases for these? I like the idea, would like to have one.


Quote:
What else would be interesting on SPI btw? An RTC clock? MP3 decoder?
MP3 decoder would be nice, BT module would be too much to wish, but there are also, USB hosts, LCD displays, radio receivers, etc. Would be cool to have status messages to LCD screen, etc.

I think that most import part would be make a standardized SPI control and library system with GUI, which would allow others make drivers for what they want.
utri007 is offline  
Old 20 November 2022, 13:29   #12
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Quote:
Originally Posted by utri007 View Post
I think that most import part would be make a standardized SPI control and library system with GUI, which would allow others make drivers for what they want.
Absolutely, this is a key think for SPI, I2C and similar add-ons that are appearing. There are already some device driver libraries out there, it would make sense to keep things consistent and present a standard API so that one driver for e.g. an SD card reader can be used with any SPI interface by setting the appropriate options.
Daedalus is offline  
Old 20 November 2022, 15:08   #13
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Quote:
Originally Posted by utri007 View Post
I have GVP HD8+ and it looks really looks good. How you gonna get cases for these?
3D printing! I got inspired by this one:
https://www.thingiverse.com/thing:4830638. That one looks a bit "boxy", but imagine it with a GVP HD8+ design but then a bit smaller...
We don't need to house a whole 3.5" drive, just a (micro) SD card and some RAM chips....
Mathesar is offline  
Old 20 November 2022, 15:14   #14
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Quote:
Originally Posted by Daedalus View Post
Absolutely, this is a key think for SPI, I2C and similar add-ons that are appearing. There are already some device driver libraries out there, it would make sense to keep things consistent and present a standard API so that one driver for e.g. an SD card reader can be used with any SPI interface by setting the appropriate options.
We talked about this before right? I would love something like this. For me, as a hardware developer I would only have to build a "spi.device" or something and then everything would work. We could then also have some standard, fully developed, stable and feature-complete SD, Ethernet and whatever drivers. Now anyone (like me) who has dedicated a few gates to an SPI controller has to re-invent the wheel.
Mathesar is offline  
Old 20 November 2022, 17:40   #15
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Yep, I'm sure we have writing drivers and developing APIs is something I really need to get into. Every time I sit down to do something like that though I think "boring!" and instead cobble together a quick hardware-banging proof-of-concept and leave it at that :/
Daedalus is offline  
Old 20 November 2022, 18:45   #16
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 695
Quote:
Originally Posted by Daedalus View Post
Yep, I'm sure we have writing drivers and developing APIs is something I really need to get into. Every time I sit down to do something like that though I think "boring!" and instead cobble together a quick hardware-banging proof-of-concept and leave it at that :/
First thing to determine is what this shared SPI thingy should be, a device? a resource? a library?
Personally I think the overhead of a device may be too large.
Just look at the SD or ENC28J60 driver code, lots of small consecutive read/write operations happening. I think the overhead of calling DoIo() or BeginIo() which then calls BeginIo(), message passing, task switching, etc would slow the system down too much. Or am I missing something and is the overhead manageable if we only do QUICKIO or something?
I think a library or a library masquerading as a resource is way leaner. A library function can be called directly without any overhead. But a resource needs to be loaded by some application while a library is automatically loaded from disk by the OS....
So I would think it needs to be a library or maybe a device.....
Mathesar is offline  
Old 20 November 2022, 23:50   #17
nikosidis
Registered User
 
Join Date: Jan 2020
Location: oslo/norway
Posts: 1,607
Mathesar: Nice I like to use this with your accelerator. Did you build any extra for sale?
nikosidis is offline  
Old 21 November 2022, 01:01   #18
Niklas
Registered User
 
Join Date: Apr 2018
Location: Stockholm / Sweden
Posts: 129
Quote:
Originally Posted by Mathesar View Post
We talked about this before right? I would love something like this. For me, as a hardware developer I would only have to build a "spi.device" or something and then everything would work. We could then also have some standard, fully developed, stable and feature-complete SD, Ethernet and whatever drivers. Now anyone (like me) who has dedicated a few gates to an SPI controller has to re-invent the wheel.
I wrote together this wiki page just now: https://github.com/niklasekstrom/ami...-device-driver

Let me know what you think about this proposal. The wiki is publicly editable if you want to edit there directly, or comment here and I can update later.
Niklas is offline  
Old 21 November 2022, 09:55   #19
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Mathesar View Post
First thing to determine is what this shared SPI thingy should be, a device? a resource? a library?
Personally I think the overhead of a device may be too large.
Just look at the SD or ENC28J60 driver code, lots of small consecutive read/write operations happening. I think the overhead of calling DoIo() or BeginIo() which then calls BeginIo(), message passing, task switching, etc would slow the system down too much. Or am I missing something and is the overhead manageable if we only do QUICKIO or something?
I think a library or a library masquerading as a resource is way leaner. A library function can be called directly without any overhead. But a resource needs to be loaded by some application while a library is automatically loaded from disk by the OS....
So I would think it needs to be a library or maybe a device.....
For such an SPI interface API to be useful, I think it should cover move than a "simple" SPI implementation such as yours (sorry ;-).
Won't this mean that it should support asynchronous transfer of larger buffers, which an exec device is perfect for (compared to a library) ?
hooverphonique is offline  
Old 21 November 2022, 10:16   #20
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 922
@Niklas:

Could the spi.device itself handle the aquire/relinguish when appropriate? It should be the one who knows if there is a separate spi bus for each unit, or if it is shared, right?
patrik is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
SukkoPera's Open Source Hardware: A500/A600 Chip/Fast RAM Expansions SukkoPera Hardware mods 208 05 February 2023 02:41
SPI controller for A1200 (clock port) spidi Hardware mods 85 02 September 2022 15:23
Simple CLI program to close all open windows? DEAT support.Apps 7 31 March 2020 05:49
Open Source A500 accelerator cooking nicely Pat the Cat News 23 02 January 2017 01:39
psp as simple game controller in Windows Falcon Flight Retrogaming General Discussion 16 25 January 2010 22:59

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:12.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13108 seconds with 13 queries