STM32 SID Player - with STM32F103C8 ( Blue Pill ) and Arduino IDE

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024
  • SID chip (6581 and 8580) and 6502 CPU emulator, with audio output on pin PA8, for STM32 line of microcontrollers, compiled with Arduino IDE, uploaded with ST-LINK V2.
    Source code:
    github.com/Bak...
    My personal project that i was having fun for some time now. Mainly done for STM32F103C8 (Blue Pill). Should work with other STM32 microcontrollers that Arduino IDE support. Tested also at STM32F401CCU6 dev board (and as i see, they all have same pin (PA8) for Timer1,channel1)
    -Only IRQ based sids can be played (no digis, emulator is not fast enough).
    -Maximum size of sid is limited by microcontrollers RAM (16384 bytes for STM32F103C8T6, 62464 bytes for STM32F401CCU6).
    -Sid load address must be at $0400 or greater.
    -Filter emulation is far from real SID chip, but, for me, it sound enough "SID-ish".
    -For now, it plays sid from internal flash memory. Sid file is converted to array. Converter used is bin2c that can be found at sourceforge.ne...
    -It is configurable. On first tab in Arduino IDE is values that can be changed to match microcontroller used. Currently it's set for STM32F103C8.
    I'm not good at C, so code is maybe a mess, but it works :-)
    Code used for emulator is found at rubbermallet.or...
    reSID can be found at en.wikipedia.o.... This is not reSID port, but i did used some parts of reSID code.
    Much more details are in the sketch.
    HAVE FUN :-)
    Ps: Sry for low-res video

ความคิดเห็น • 21

  • @Aomedmon
    @Aomedmon 3 ปีที่แล้ว +1

    So cool! I really love this, great work!

    • @bakisha
      @bakisha  3 ปีที่แล้ว +1

      Thank you. I was really having fun while doing this project :-)

  • @sgw32
    @sgw32 4 ปีที่แล้ว +1

    I'll schedule my next project - "bluepill2SID" adapter :D
    NIce job!)

    • @bakisha
      @bakisha  4 ปีที่แล้ว

      Thanks and good luck with your project :-)

  • @cbm80amiga
    @cbm80amiga 4 ปีที่แล้ว +1

    Great project! I will have to play with SID player too.

    • @bakisha
      @bakisha  4 ปีที่แล้ว

      I'm glad you like it :-)
      Still have few stuff to add, but mostly to player's code, SID emulation code is already as best as i can. Maybe adding LCD for showing sid file info, or file manager to select file from sd card. Or both, just like in your videos :-)

    • @cbm80amiga
      @cbm80amiga 4 ปีที่แล้ว

      @@bakisha I wanted to use my protoboard with ST7735 (look at my channel for more details) which already has SD socket for displaying some menu, maybe even equalizer bars :)

    • @bakisha
      @bakisha  4 ปีที่แล้ว

      @@cbm80amiga Yeah, i also have ST7735 with SD on protoboard, and i tested almoust all codes from your github (thanks again for sharing) . The problem is that once sid file is playing, there is very little time for CPU to do anything else. SID emulation is all done in interrupts, while 6502 emulation is done in main loop (and is very often interrupted by interrupt). There is small time (around 7mS, every 20mS) when 6502 emulation is not running, but that is very little time for LCD to show heavy anymation (because it is still interrupted by interrupt). Overclocking bluepill helps a lot, but for now, i'm using that speed boost to improve sound quality of SID emulation (meaning interrupts are triggered more often). LCD is on my TODO list, for now i'm focused on improving (and simplifing) code for file loading .

    • @cbm80amiga
      @cbm80amiga 4 ปีที่แล้ว

      @@bakisha Good to know. I expected that this emu stuff takes most of MCU time. Very nice project. Good luck with improvements! Did you consider to use other cheap MCU like ESP8266 which has little more resources?

    • @bakisha
      @bakisha  4 ปีที่แล้ว

      @@cbm80amiga ESP8266 have lot of RAM and CPU power, but unfortunately it doesn't have hardware PWM. And with Bluepill's hardware PWM it can go down to 1/72 microseconds pulse on a pin. Some lowpass filter on output, and it is as true analog output.

  • @borayurt66
    @borayurt66 ปีที่แล้ว

    Can this project be turned into a low cost SID replacement for C64?

    • @bakisha
      @bakisha  ปีที่แล้ว

      In theory, yes. It won't be best SID emulation like ArmSID, but it would do the job.
      Check github.com/Sgw32/UltiSID/tree/hal_usid , that guy tried, i don't know the details.
      I was thinking to try it with WeAct board with STM32G431CBU6, it had 12bit DAC, and is cheap enough to try and mess around with it.

    • @borayurt66
      @borayurt66 ปีที่แล้ว

      @@bakisha I think it is worth a shot because SwinSID is still selling and it is terrible. ArmSID is good but it sells almost for the price of a real 8580. There is a huge market gap for something that costs similar to a SwinSID but performs better. Doesn't need to be as good as ArmSID (even that has tiny glitches) as long as it is significantly better than SwinSID (not a hard competition there) it will do very well in the C64 community.

    • @bakisha
      @bakisha  ปีที่แล้ว

      @@borayurt66 I don't think ArmSID is expensive (i can't cay about shipping costs), considering time and effort put in designing and manufacturing hardware, plus software is still getting upgrades. I don't say it can't be done, but surely i am not able to do it. This (and all my other projects), are just messing around on breadboard with cheap chinese modules. And i'll support anyone who tries it. At least, moral support, financial support is not my thing 🙂

    • @talideon
      @talideon 11 หลายเดือนก่อน

      ​@@borayurt66If you can get a SID for the same price as an ArmSID, you've _very_ lucky! I see SID chips going for about 80EUR+, while the ArmSID varies between 35EUR and 45EUR.