All posts by Simon Martin

Commodore 64 + Raspberry Pi 4 = Synth6581

Post Syndicated from Simon Martin original https://www.raspberrypi.org/blog/commodore-64-raspberry-pi-4-synth6581/

We have a special blog today from one of our own design engineers, Simon Martin. He’s the designer of Raspberry Pi 400 and our High Quality Camera and spends his free time tinkering with electronic music.

This video is a classic. Settle in…

Simon has wanted to make his own electronic musical instrument with Raspberry Pi for some time. He designed a circuit board for the project a year ago, but it lay around in a drawer in his desk while he finished Raspberry Pi 400. Finally, the winter months gave him the incentive to get it working. 

Simon’s electronic musical journey

Simon: The Synth6581 device doesn’t look much like an electronic musical instrument, but just like circuit boards stacked on top of a Raspberry Pi 4. You have to plug a musical keyboard into a USB port and a pair of speakers into the audio jack on the bottom board to make it work.

Hefty stack ready to play some electronic music

The code is written almost entirely in Python, with a little bit of C to speed up the communications to the chips. I designed and laid out the circuit boards, which were ordered online. The first six boards cost only £20, but the components were another £100. I spent more than a day soldering the components on the boards by hand. It took much more time to check every chip and connection worked, a common problem with hand-soldering new boards.

Synth6581 — no ordinary sounding instrument

The 1982 Commodore 64 – works like Raspberry Pi 400, only slower

And Synth6581 is no ordinary sounding musical instrument. It’s based on the music chip inside a vintage computer: the Commodore 64. The microchips are almost forty years old and they have a quirky sound that kids in the 1980s loved and parents hated. By the way, did you know that the Commodore 64 was the inspiration for Raspberry Pi 400?

The SID chip sound

The MOS6581 SID chip — just a little smaller than a Raspberry Pi Pico board

I was one of many hobby programmers in the 1980s that used to attempt to program Commodore 64s. Much like people today dabble with programming on Raspberry Pi 400s, kids and adults were dabbling with the BASIC programming language on their Commodore 64s back then. Nowadays, Raspberry Pis have video, graphics, and audio readily available, but back in the 1980s, the hardware registers had to be ‘poked’ one by one into the console window. You had to get quite technical just to get the computer to make a musical sound. Those sounds came from the MOS6581 or ‘SID’ chip. It had such a famous sound character that it formed the basis of the chiptune music genre, and people are still writing music on Commodore 64s today.

Using BASIC POKE commands to control SID chips on a Commodore 64. Not the easiest thing to read.

Poking SID chips

By borrowing a few chips from broken Commodore 64s, including one or two lying around Raspberry Pi Towers, I made those 1980s ping noises into a polyphonic synthesiser controlled in Python on Raspberry Pi. The registers in the SID chips are simply being ‘poked’ by Raspberry Pi instead of Commodore 64. I also reverse-engineered the music from old games and made the sound effects and instruments work across the keyboard.

Simon with his creation
Simon with his electronic music creation

One of a kind electronic musical device

This device is unique: only one of these will ever be built, so please don’t wait for a launch date. There were over 10 million chips manufactured for Commodore 64, but production of the chips ended nearly 30 years ago. The Commodore 64s and spare parts for them are still in high demand, which is pushing up second hand prices. Nonetheless, the code and schematics are available online on GitHub, and I invite other Raspberry Pi users to use them to make musical instruments out of other games consoles. I reckon Sega Megadrive has a lot of potential for a Raspberry Pi port…

Simon Martin youtube channel
A few of the demos of the electronic instrument on Simon’s YouTube channel

For more video demos of this instrument, head to my YouTube channel.

The post Commodore 64 + Raspberry Pi 4 = Synth6581 appeared first on Raspberry Pi.

Designing Raspberry Pi 400

Post Syndicated from Simon Martin original https://www.raspberrypi.org/blog/designing-raspberry-pi-400/

It’s been a journey, but it’s finally here, and I can talk about the secret Raspberry Pi 400 project! I’ll also try to cover some of the questions you asked following Eben’s announcement of Raspberry Pi 400 yesterday.

Four years in the making

It’s been over four years since the original idea of a Raspberry Pi inside a keyboard was discussed, before I even started working at Raspberry Pi Towers. Initially, the plan was for a kit with all the parts needed for people simply to open the box and get started by connecting the accessories to a “classic” credit-card sized Raspberry Pi. The challenge was that we needed a mouse and a keyboard: if we could manufacture a mouse and a keyboard, we could make a complete kit. How hard could it be? Then, within a day of our announcing our new keyboard and mouse, we saw a blog from someone who had milled out the keyboard and integrated a Raspberry Pi 3 Model A+ into it.

Our jaws dropped – we were impressed but we couldn’t say a word. Then others did the same with a Raspberry Pi Zero, and by that point we kind of expected that. We knew it was a good idea.

The keyboard and mouse were the big things we needed to sort out: once the quality control and supply chain were in place for those, we could move to fitting keyboard matrices to Raspberry Pi 400s, and achieve final assembly in Sony’s manufacturing facility in Wales. We had first planned to make a Raspberry Pi 3-based version, but it was clear that getting such a complex item into product wouldn’t happen until after we’d launched Raspberry Pi 4, and this would make the new product seem like a runner-up. So, instead, we started work on the Raspberry Pi 4-based version as soon as the design for that was finalised.

A fresh, new Raspberry Pi 4

The board inside the housing is essentially a Raspberry Pi 4 unit, but with a fresh PCB design. It has the same USB and Ethernet system as the Raspberry Pi 4, but one of the USB2.0 ports is dedicated to the keyboard.

Left-handed?

We have already seen a few comments about the USB ports being on the left side of the unit, and the fact that this makes the mouse cable cross over for most right-handed users. The PCB shape had to be defined early on so that the industrial designers could get on with the housing design, and I then stared endlessly at the PCB layout, trying to get one of the USB ports to route to the right side without wrecking the signal integrity of the memory or the HDMI; I could not find a way to do this. Left-handed folks and Bluetooth mouse-owners will be happy at least!

Micro HDMI

Raspberry Pi 400 has dual-band 802.11b/g/n/ac wireless LAN and Bluetooth 5.0. Like Raspberry Pi 4, it has dual micro HDMI output which achieves up to 4K video. It would have been be lovely to have had full-size HDMI connectors, but in order to achieve this we would have to remove other functions, or make a bulkier unit. However, the kit does come with a micro HDMI-to-HDMI cable to cheer you all up.

We kept the GPIO connector since it is loved so much by beginners and experts alike, and this is after all a Raspberry Pi – we want people to be able to use it for tinkering and prototyping. The HAT functionality works better with an extender cable, which you can buy from numerous websites.

1.8GHz!

Raspberry Pi 400 has the same circuit layout of the power management, processor, and memory as Raspberry Pi 4, but with one major difference: we’ve adjusted the operating point to 1.8GHz! And did I mention cooling? We’ve solved the cooling challenge so users don’t have to give this any thought. Raspberry Pi 400 contains a heat spreader that dissipates the heat across the whole unit, front and back, so that no part of it will feel too hot to touch. In fact, there is enough thermal margin to overclock it, if you’re so inclined.

Why not the Compute Module?

Some folks have asked us why we did not fit the Raspberry Pi Compute Module inside. The reason is that above a certain scale, it generally makes more sense to go with a custom PCB rather than a module with a carrier board. With hundreds of thousands of Raspberry Pi 400 units in the first instance, we are above that scale.

Turn it off and on again

We also have a feature that is completely new to Raspberry Pi products: an on/off button! Power off is achieved by pressing Fn+F10. This is a soft control that negotiates with Linux to shut down, so you don’t corrupt your memory card or your USB drive. Power can be restored by holding down F10 (or Fn+F10) for two seconds.

Prototyping

An early unit going through thermal analysis

A lot of love went into making this the best possible product we can manufacture, and it has been through extensive alpha testing and compliance testing. I thought I would show you the insides of a very early prototype. There are already some teardown videos online if you want to see how Raspberry Pi 400 is put together; it has not changed much from this:

Inside one of the first Raspberry Pi 400 units – 3D-printed and CNC-machined. ~£1500 each to build!

Raspberry Pi 400 kit

The official Raspberry Pi mouse has been a lovely product to have available where Raspberry Pi 400 is concerned, because now we can provide a complete kit of official matching Raspberry Pi parts that looks fantastic on your desk. The kit comes with the SD card already programmed and inserted, so on Christmas day, you just need to plug it into the family TV and start coding. No frantic searches for somewhere that sells memory cards!

Top view of a woman's hands using the Raspberry Pi 400 keyboard and official Raspberry Pi mouse

The kit includes:

  • Raspberry Pi 400 computer with choice of six keyboard countries (more to follow)
  • Official Raspberry Pi mouse
  • Raspberry Pi USB-C DC power source, with adaptors for each country
  • SD card ready-fitted in the unit with the latest software release installed
  • micro HDMI to HDMI cable
  • Jewel box to store the SD card
  • Fourth-edition Raspberry Pi Beginner’s Guide book with instructions for getting started with Raspberry Pi 400, as well as loads of things you can do with it

Ode to Commodore

Finally, a bit of fun to finish with. On Christmas morning 1985, I opened the polystyrene box of a Commodore 64 computer and the world switched on for me. It had the best games and the best sound, and it was easy to program. We think the combination of gaming and programming still works today, but we’ve come a long way since 1985. Here’s a chart to show how a Commodore 64 and a Raspberry Pi 400 compare.

I particularly like the benchmark increase for less than half the power. This makes Raspberry Pi 4 almost a million times more efficient at processing data.

We do hope this bring smiles to the faces of those fortunate enough to get one by Christmas. The factory has been running flat-out for the last two months building up stock – order yours soon though, since they’ll sell quickly! 

Special thanks to…

Alwyn Roberts, Andy Liu, Anthony Morton, Antti Silventoinen, Austin Su, Ben Stephens, Brendan Moran, Craig Wightman, Daniel Thompsett, David Christie, David John, David Lenton, Dominic Plunkett, Eddie Thorn, Gordon Hollingworth, Helen Marie, Jack Willis, James Adams, Jeremy Wang, Joe Whaley, Keiran Abraham, Keri Norris, Kuanhsi Ho, Laurent Le Mentec, Mandy Oliver, Mark Evans, Michael Howells, Mike Buffham, Mike Unwin, Peter Challis, Phil Elwell, Rhys Polley, Richard Jones, Rob Matthews, Roger Thornton, Sherman Liu, Simon Lewis, Simon Oliver, Tim Gover, Tony Jones, Viktor Lundström, Wu Hairong, and all the alpha testers and resellers who made Raspberry Pi 400 possible.

The post Designing Raspberry Pi 400 appeared first on Raspberry Pi.