UltiSID / KungFuSID - new STM32 SID chip replacement

C64 website updates, new releases of games, demos, tools etc.

Moderator: Lemoners

User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

UltiSID / KungFuSID - new STM32 SID chip replacement

Post by Sgw32 »

Hi everyone!

Image
Image
Image

Link to GitHub repository https://github.com/Sgw32/UltiSID/tree/hal_usid

Schematic: https://github.com/Sgw32/UltiSID/blob/h ... ltiSID.pdf

It is time to release one of my new project.
Open source SID chip replacement 8580/6581 emulator that can be executed on Bluepill boards and STM32F103

License - GNU General Public License v3 (derived from Bakisha STM32 SID player)

Introduction

Project is heavily inspired by SwinSID and ArmSID project. And is maintained as an open-source alternative to them. Now it is even working on a STM32F103C8T6 on an overclocked freq 128 MHz with 8 MHz crystal. With some errors in behavior - some readings/writings from CPU are missing. I'm looking for contributers(I can even pay for the work) who will add some assembler optimization magic into my code. Also I plan releasing Altium Designer PCB hardware files publicly available right after I'll sell 10 copies of UltiSIDs to public.

Working in a time-stretched and computation-intensive environment of C64 requires hardcore optimization of code. We have only 500ns for interrupt processing. Project is still in a very early stage of development

So why UltiSID? Why Ulti? I think that open-source contributions make our planet better, and since, the open-source alternative to SwinSID and ArmSID is still better than closed solutions. In 2021 there are still no any good SID emulators publicly available. 2021, Carl!

Chip support - it supports STM32F103C8T6 and STM32F405RCT6 both(but not at the same time :D )

Credits and special thanks:
Tolaemon's NanoSwinSID page with open-hardware PCB available: http://www.tolaemon.com/nss/ My PCB is a modified version of SwinSID PCB

ArmSID page with schematic: https://www.nobomi.cz/8bit/armsid/index_en.php

Teensy SID emulator (huuuge, not really good): https://www.pjrc.com/c64-sid-chip-replacement/ and https://github.com/kokotisp/6581-SID-teensy

SID BluePill emulators: https://github.com/Bakisha/STM32-SID-PLAYER - my code is 80% based on this repository https://github.com/dkm1978/BluePillSid - references

Swinkels page - dead http://www.swinkels.tvtom.pl/swinsid/ Available on Archive.org - please check it, there is a SID emulation source for SwinSID atmega8515.

Kung Fu Flash - https://github.com/KimJorgensen/KungFuFlash I am inspired by simplicity of it and its power.

Special greetings to Protovision Games

Future plans

STM32F103 has a very long delay between CS fall down and interrupt routine begin - about 200ns. With a 500 ns window at all. I plan migrating to STM32F405RCT6(still, very cheap on Aliexpress) my PCB also supports it. Also, I should optimize RW&CS routines to enhance performance.

Limitations
  • We have a 256b buffer for SID data, and it is processed in main cycle. Seems enough, but sometimes I hear that it is not.
    Pitch is not calibrated
    Data readings are not correct at event-intensive tunes(where there are a lot of write-to-SID activities)
    No 6581/8580 switch
    No paddles(sorry, no reads)
Support us
PayPal Me:
https://paypal.me/sgw32
Or buy something here (3d print models):
https://www.cgtrader.com/sgw32

Video(and audio) PoC:
https://www.youtube.com/watch?v=_ROxem-S0Jo
Last edited by Sgw32 on Fri Aug 04, 2023 9:08 pm, edited 1 time in total.
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
User avatar
mrsid
Zorro
Zorro
Posts: 1429
Joined: Mon Jan 27, 2003 2:17 pm
Location: Netherlands

Post by mrsid »

The UltiSID name is already used by the Ultimate64 board. It's probably a good idea to come up with a different name...
dmantione
Rick Dangerous
Rick Dangerous
Posts: 1553
Joined: Mon Feb 12, 2018 8:40 pm
Location: Purmerend, Netherlands
Age: 47

Post by dmantione »

Very interresting! I think an open easy to build SID implementation makes a lot of sense and I think there are currently quite a lot of C64 boards with plundered SIDs. With a good low-cost SID those can be made fully functional again!
User avatar
Gorack
Rick Dangerous
Rick Dangerous
Posts: 1502
Joined: Tue Nov 12, 2013 9:46 am
Contact:

Post by Gorack »

Nice work. :hatsoff:
Have you considered using a STM32H7 series?
It is much faster with massive amounts of memory compared to the F series for only a couple of dollars more.
dmantione
Rick Dangerous
Rick Dangerous
Posts: 1553
Joined: Mon Feb 12, 2018 8:40 pm
Location: Purmerend, Netherlands
Age: 47

Post by dmantione »

Using more expensive components is exactly what you should not do. The less advanced hardware you need to do the job the better. And we C64 gurus know how to optimize software :D
Tobias
Jumpman
Jumpman
Posts: 4612
Joined: Sun Oct 28, 2018 12:46 pm
Contact:

Post by Tobias »

It will have to move to a faster controller at some point anyway :)

Nice project, looks interesting. And what MrSID said :=)
Individual Computers Support Forum - WIKI - Shop
VICE Binaries
User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

Re: UltiSID - new STM32 SID chip replacement

Post by Sgw32 »

Hi everyone, this project is not dead :)

I've released rev0 PCBs (with errors however - do not order them)
https://github.com/Sgw32/UltiSID

And now I've released Kung Fu SID firmware for Kung Fu Flash and later revision of UltiSID.

https://github.com/Sgw32/KungFuSID

Kung Fu SID is a cycle-exact emulator of SID which runs(for now) as a cartridge (on Kung Fu Flash) and you can remove SID from your board, add one wire from the cartidge to SID socket - and listen to SID emulation from STM32F405RGT6 chip from Kung Fu Flash. Later it will be moved to new UltiSID board and UltiSID project will be finally done. Also I am using a cheaper alternative to STM32 -GD32 chip . It makes a real open source alternative for ArmSID.

There are still significant flaws in a firmare - some tunes sound too slow and odd, however in some tunes it is good.
The firmware is still based on Bakisha STM32 player: https://github.com/Bakisha/STM32-SID-PLAYER

But does all emulation in real-time from the data from Address/Data bus.
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
User avatar
Gorack
Rick Dangerous
Rick Dangerous
Posts: 1502
Joined: Tue Nov 12, 2013 9:46 am
Contact:

Re: UltiSID - new STM32 SID chip replacement

Post by Gorack »

I am also trying making an open source SID, CIA and CPU replacements using STM/GD32F4 series. Perhaps we can collaborate?
The CPU can reflash parts of its flash memory with ROM images and therfore optionally replace any or all of the ROMs.
au_chadl
Zorro
Zorro
Posts: 1127
Joined: Fri Jan 06, 2017 11:30 pm
Location: Australia

Re: UltiSID - new STM32 SID chip replacement

Post by au_chadl »

does it supports paddles?
User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

Re: UltiSID - new STM32 SID chip replacement

Post by Sgw32 »

Gorack wrote: Sat May 06, 2023 5:15 am I am also trying making an open source SID, CIA and CPU replacements using STM/GD32F4 series. Perhaps we can collaborate?
The CPU can reflash parts of its flash memory with ROM images and therfore optionally replace any or all of the ROMs.
Yes, sure. I plan to release a new PCB publicly.
Also - kung fu flash code for reading Address/Data is really good, I recommend it as a starting point.
au_chadl wrote: Sat May 06, 2023 7:57 am does it supports paddles?
For now it is only planned. But it can be done.
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

Re: UltiSID - new STM32 SID chip replacement

Post by Sgw32 »

Hi!

Image

UltiSID is released publicly and is now tested:

https://github.com/Sgw32/UltiSID

You can also order PCBs almost assembled using JLCPCB order files provided in the repository.
New UltiSID is highly inspired by Kung Fu Flash - and commonly, it is a Kung Fu Flash with a special firmware(Kung Fu SID, included as a submodule)

Video:

https://youtube.com/shorts/YMMjhMZqSjQ?feature=share - small video of new hardware and software working on a real C64.

By the way, I have 4 extra chips and I can send/sell them somewhere if someone wants to check them out.
As it was declared initially, UltiSID is completely free and open-source even for commercial purposes (GPLv3 license)
I will be happy if someone will improve the project or add some new functions to it. It still lacks paddles, but new hardware supports it.
As well, there is an OpAmp on output cascade, and output is completely generated by DAC, not PWM as on SwinSID - which ensures smooth and good generation of sound. I still need some optimization of code.

There are no hard flaws as it was before on the previous revision of the hardware. It processes data and it is possible to read it back, it works stable.

I would also be happy for any donation:
PayPal is unfortunately banned in Russia, as Russia resident I am unable to use it, even if I'm not in Russia actually(as it is)
0xeDc17cb23241eACe19DF3617291aa7d2d92E62DC - USDT/ETH ERC20
TKSPmVWoCgQky8umDUcR7oivJKNzAXueSB - USDT TRC20
0x77c411fdedc72b034432571ae9aee10330b72d6c - USDT BSC20
https://www.cgtrader.com/sgw32 - or buy something here(my 3d models of C64 for 3d printing)
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
hof
Joe Blade
Joe Blade
Posts: 204
Joined: Fri May 31, 2019 2:07 pm
Location: Sweden

Re: UltiSID / KungFuSID - new STM32 SID chip replacement

Post by hof »

Hi,

I've built a couple of these and have a few questions.

1. There's a constant loud beep at power-on. It goes away as soon as the SID has been initialized by a program but it's extremely annoying. Why is that?
2. It runs quite hot. Is that expected?

I've tried one with a GD32F405 and one with an STM32F405. They both behave exactly the same in two different C64's (250407 & 250469 mainboards).
User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

Re: UltiSID / KungFuSID - new STM32 SID chip replacement

Post by Sgw32 »

hof wrote: Sat Aug 19, 2023 12:25 pm Hi,

I've built a couple of these and have a few questions.

1. There's a constant loud beep at power-on. It goes away as soon as the SID has been initialized by a program but it's extremely annoying. Why is that?
2. It runs quite hot. Is that expected?

I've tried one with a GD32F405 and one with an STM32F405. They both behave exactly the same in two different C64's (250407 & 250469 mainboards).
Hi!

Sorry for the late reply.

1) Yep. Please cut the reset pin to avoid that. That's seems like an error.
2) I'm not sure. My prototypes are neither hot nor cool. Precise measurement will be better, but if it runs below 60C or at temperature of CIA/CPU of C64 that's ok.

BTW yes, they are compatible with STM32 and probably AT32 two. Maybe other and cheaper alternatives also exist
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

Re: UltiSID / KungFuSID - new STM32 SID chip replacement

Post by Sgw32 »

Hi everyone! Since a good some funding from my models recently, I've made a major update to the firmware:

Check commits here:
https://github.com/Sgw32/KungFuSID/commits/master


​Changelog:

- OSC3 is now functioning perfectly
- I've fixed a major ADSR bug, and after that, most of the remaining tunes started sounding correctly
- I've done some optimizations to the code, and it allowed me to increase the SID sound ISR timestep. That leads to a more smooth emulation of sounds.
- No more need to not solder RST pin, now SID initializes with empty registers and has no boot sound.

The next stop is probably the paddles.

I'll share the binaries soon, if someone has ordered boards I encourage you to update the firmware.
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
User avatar
Sgw32
William Wobbler
William Wobbler
Posts: 78
Joined: Thu Feb 07, 2019 10:48 pm
Location: Yerevan, Armenia (form. Moscow)
Age: 28

Re: UltiSID / KungFuSID - new STM32 SID chip replacement

Post by Sgw32 »

hof wrote: Sat Aug 19, 2023 12:25 pm Hi,

I've built a couple of these and have a few questions.

1. There's a constant loud beep at power-on. It goes away as soon as the SID has been initialized by a program but it's extremely annoying. Why is that?
2. It runs quite hot. Is that expected?

I've tried one with a GD32F405 and one with an STM32F405. They both behave exactly the same in two different C64's (250407 & 250469 mainboards).
And thanks a lot to hof, who found a bug in the JLCPCB BOM file, now it is fixed.
Bug was that R7=R9=33 Ohm , but in the schematic it is R7=470, R9=33 Ohm - which is correct

https://github.com/Sgw32/UltiSID/tree/m ... tion_files
4x C64C,2x VIC-20,1x C64,2xAmiga 500, 1x Amiga 600
I sell parts and accessories
https://instagram.com/phol_labs
https://phol-labs.ru
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests