Positron16 - Commodore 64 SID chip emulator using a dsPIC33 or PIC24 device

Started by top204, Jan 20, 2025, 08:26 PM

Previous topic - Next topic

top204

Here is a video I made of the SID sound chip emulator I created, running on a dsPIC33 device, and it sounds excellent. The code also emulates the old, 8-bit, 6510 (6502) microprocessor, so it can run the contents of a SID file as if it is running in a Commodore 64 machine.

You will need to forgive me for my commenting in the video, as I am not used to talking on videos, and users from the UK will recognise my Geordie accent, even after all of the years away from the North East of England it still stays in my voice. :-) The phone seems to try to mask out the sound of the SID emulator, because it was actually quite loud, but it can still be heard. It is running on one of my old Amicus24 boards, but it runs nicely on John's Amicus16 board as well.


I am going to try and commercialise it somehow, with a PCB and the source codes and the "SID file to include file" creator program, and a booklet on how to build the PCB, and what the program is doing, and how to use it in applications, and a free compiler version that includes the dsPIC33 device that I will eventually use in it etc... It would make an excellent door bell for us nerds from the 1980s. :-)

Notice the lovely Philips speaker from one of my 1960s electronics sets? It was the only speaker I could find. LOL.

I have attached a hex file for the player that will run on a dsPIC33FJ128GP802, and uses pin 'RP8' for the audio out. The dsPIC33 device uses its internal oscillator, so all that is required is power to the dsPIC device, and the 'RP8' pin connected to an amplifier to hear the theme tune from the 1980s Commodore 64 game called "1942". You can add a 47nF to 100nF capacitor connected from the 'RP8' pin to ground and it will operate as a very simple low-pass filter, or use an op-amp as an integrator/ low pass filter for a bit better quality, but the 10-bit PWM gives a good sound, and I will be converting it to 16-bit using two OC (Output Compare) peripherals operating as high frequency 8-bit PWMs, combined to give a really good 16-bit DAC.


JonW

1942 tune brought back some memories.  I was always a C64 over the spectrum in those days and progressed to the Amiga.

Really nice job Les!


top204

I originally started with a ZX81, bought from WH Smiths, then moved up to a Spectrum. I then got bored with the Spectrum when I had learned enough Z80 machine code and saved up and moved to the "beautiful" Atari 800, with its cast aluminium innards and lovely casing and keyboard. With the wonderful 810 disk drive. Ohhh how I wish I had kept them, they were so beautiful. :-(

I then moved on to the commodore 64 when I heard its SID chip sounds, then the Atari ST. I dabbled with the commodore Amiga but could not quite see its charm, so moved on to the boring 286 onwards computers.

The computers now are actually very boring, and "much the same of the same", and lack any charm whatsoever.

That's what first got me interested in PIC microcontrollers. They were a step back to the good old 8-bit days where computers and electronics mixed tightly. But that is now also fading, and the large 'Arm' microcontrollers now are just small computers doing the same of the same with dreadfully bloated languages and copy and pasting. They have also lost their charm.

JonW

If you have emulated the 6502, could you do the full C64 on a DSPIC and a GLCD and run the games?

Now that would be cool!

charliecoutas


magic_gun

Lesssss !!!   nice job congrats !!  :) ATARI and COMMODORE forever ! 
i learned the assembler language in 6502,  my first computer was ATARI 800 n ofc  the basic language
love n respect from Turkiye ( in all atari forums my nickname magic_gun also )

Sommi

I got started 1982 with MPF1 Plus, with Z80 compiler

WF9HPTf.jpg

Also that year the Sharp PC 1500 with basic compiler, we attached A/D coverters

s-l1600.jpg
KISS - keep it simple and stupid

top204

What a beauitiful object that MPF1 Plus is. Is it a form of Micro Professor unit?

I just wish I had not had to sell my small, but lovely, computer collection after my brain injury. It still haunts me, as to what I had to sell.

I still remember wanting a Sinclair Mk14 in the late 1970s, but could not afford it. Then I was saving for a Sinclair ZX80 computer, but the better ZX81 computer came out, so I was saving for one of them instead, when I had a stroke of luck one evening.

I was out one Saturday night having a few drinks with mum and dad at the local working mens club in 1982 (The Whiteleas Club), and there was a letter draw competition, so I thought I would have a go at it, and picked the letters/numbers "ZX81A", because it needed five numbers or letters. And, blow me!, they came up and I won a pot of £300, which was quite a lot of money for me back then! I couldn't believe it... I had some spare money!! and my lovely mum and dad would not take a share of it. It shows how important an event in my life it was, when I remember those few hours in my life so clearly. :-)

So I waited for the monday, and during my lunch break, I went to the WHSmiths shop and bought a ZX81 computer with its 16K RAM pack for the princely price of £149, which was a lot of money for me back then as well, and bought mum and dad a nice bottle of whisky as a 'thank you'.

And so I started on my journey into computers. I was never happy with just using a computer, I needed to learn how they worked and how to program them. I was fortunate that I had an electronics and technically minded background thanks to my lovely dad, so I taught myself programming from books, and was not happy with the interpreted languages, so learned assembler language ('Machine Code' as it was known then) for the computers I had over the years, by selling a computer I had finished with, to pay some of the money for another computer, or buying a broken computer and repairing it. From microprocessors; Z80 to 6502 to 68000 onwards...

I could make the ZX Spectrum do things it should not have been able to do according to the "experts?". The same with the Commodore 64, and I created a filing system for games on the 5.25" disks, based upon the wonderful Atari 800 Multi-Boot idea that loaded a list of the games on the disk at disk bootup, so no "load" command needed, and with a display image that did not have the borders, and filled the screen with the image while the programs on the disk were listed, then loaded, and the 1541 disk drive operating at around twice its normal speed of 300 Baud... Yes, you read that correctly... 300 Baud for a disk drive, due to the stupidity of the commodore designers of it and its serial interface, with not enough RAM to use as a buffer for higher Baud rates!.

I speeded it up by creating a new floppy disk formatting program and reading/writing mechanism, that placed the sectors on the disk based upon the disk's speed in the 1541 drive, so when it was time to read a sector, it was already in place under the head and it did not have to wait for the disk coming around again for the next sector to read/write. I was known on the programs as "The Happy Hacker", which scrolled on the bottom of intros of programs I had written, and games I had hacked. But I have never had a business head, so never commercialised my natural talent for electronics and computers as much as I should have done. Hence my life now. :-(

Wow... How nerdy does that sound? But I also had a social life with two wives (not at the same time) and a few kids, and multiple girlfriends between marriages (some girlfriends at the same time as each other :-) ), so I was not a Sheldon Cooper, just a silly person who did not know how to promote my natural talents and intelligence. LOL. As my dad used to say when I was in my late teens/early twenties... "You're bloody clever lad, but you have very little common sense", and he was soooooo right, and I never have had much common sense, hence I have been exploited by companies I have worked for most of my life either in electronics, computers, and sometimes both at the same time.

Sommi

Yes, it was the Micro Professor 1 plus

Here is a pretty good description of it, there was even a thermoprinter!

https://electrickery.nl/comp/mpf1plus/

Got me into Assembler
KISS - keep it simple and stupid