User Tools

Site Tools


pi1541

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pi1541 [2019/10/08 02:32]
210.18.207.206 Wrong part link for DIN sockets. Fixed.
pi1541 [2021/02/02 01:24]
Line 1: Line 1:
-====== Building the Pi1541 ====== 
  
-{{ :​wiki:​pi-5165.jpg?​nolink&​300|}} I first heard about the [[https://​cbm-pi1541.firebaseapp.com|Pi1541]] created by Steve White on [[http://​www.chickenlipsradio.org|Chicken Lips Radio]]. There had been other solutions in the past for hooking up an SD card to a C64/128 but nothing for the average hacker that would fully emulate a 1541 or daisy chain to another real 1541.  
- 
-Discovering that this project ran bare metal on the Raspberry Pi without any underlying OS was impressive to say the least, exactly what I was hoping someone would eventually produce. ​ 
- 
-I figured I could build this on perf board easily enough. Later, I was delighted to discover that CG had kindly created a [[https://​www.pcbway.com/​project/​shareproject/​Pi1541_IO_Adapter__Rev_4.html|Raspberry Pi daughterboard PCB on PCBWay]]. So that was it. I ordered 5 of the PCBs, some of the BOM and waited. 
- 
-First, I had to set up my workshop again. I'd been wanting to do this for some time. This was the perfect opportunity to use this project as a way of organising my parts and tools again. I won't go into great detail about this part of the process. But many of the parts I ordered were part of sorted packs. 
- 
-Most of the parts I ordered via [[https://​www.aliexpress.com|Aliexpress]] to make it as cheap to make as possible. However on many occasions, I ordered some parts from other vendors. This was mainly due to not being organised or forgetting to order certain items from the Pi1541 BOM list. Rather than order from Aliexpress again and wait another few weeks for delivery, I just shelled out a little more to speed things along. 
- 
-===== Parts List ===== 
- 
-==== PCBWay ==== 
-  * 5 x Pi1541 Rev 4 board - https://​www.pcbway.com/​project/​shareproject/​Pi1541_IO_Adapter__Rev_4.html 
- 
- 
-==== Core Electronics ==== 
- 
-  * Raspberry PI 3+ - https://​core-electronics.com.au/​raspberry-pi-3-model-b-plus.html 
-  * Nylon spacers 12mm length 4mm outer diameter, 2.7mm inner diameter - https://​core-electronics.com.au/​nylon-spacer-12mm-length-4mm-od-2-7mm-id-25-pack.html 
- 
- 
-==== Aliexpress ==== 
- 
-  * Raspberry Pi 2amp Power Supply with switch - https://​www.aliexpress.com/​item/​5V3A-5V-3A-Raspberry-PI-3-model-B-Plus-Power-Adapter-ON-OFF-switch-button-power/​32898334338.html 
-  * 100nf (104) capacitor (as part of a bulk pack of sorted values) - https://​www.aliexpress.com/​item/​300pcs-10Value-50V-10pF-20pF-30pF-47pF-56pF-68pF-100pF-1nF-10nF-100nF-Multilayer-Ceramic-Capacitor/​32858898528.html 
-  * 7406 IC - https://​www.aliexpress.com/​item/​10PCS-SN7406N-SN7406-7406-DIP-14-IC/​2043749147.html 
-  * Piezo Buzzer - https://​www.aliexpress.com/​item/​10PCS-ST118b-Passive-Electromagnetic-Buzzer-12-8-5mm-Industrial-Grade-2048HZ-XT-XXQ-DIDIDI-Sound-DIY/​32826202171.html 
-  * 4-pin header - https://​www.aliexpress.com/​item/​10PCS-Single-Row-Straight-FEMALE-PIN-HEADER-2-54MM-PITCH-Strip-Connector-Socket-1-2-3/​32961985329.html 
-  * 40-pin header - https://​www.aliexpress.com/​item/​10PCS-2X20-PIN-Double-row-Straight-FEMALE-PIN-HEADER-2-54MM-PITCH-Strip-Connector-Socket-2/​32854215610.html 
-  * Level Shifter Module (includes 12 header pins) - https://​www.aliexpress.com/​item/​5pcs-lot-5V-3V-IIC-UART-SPI-Four-Channel-Level-Converter-Module-for-Arduino-Free-Shipping/​32247463702.html 
-  * 2 x DIN 6-pin Sockets - https://​www.aliexpress.com/​item/​32841961776.html 
-  * Hex Socket Screw Bolts M2.5 18mm - https://​www.aliexpress.com/​item/​50pcs-M2-5-18-20-22-25-28-30-32-35-38-40-mm-304-Stainless/​32859007238.html 
-  * Hex Lock Nuts M2.5 - https://​www.aliexpress.com/​item/​50pcs-M2-M2-5-M3-M4-M5-M6-304-stainless-Steel-Nylon-Insert-Hex-Lock-Nuts/​32858121224.html 
-  * SSD1315 oLED Screen (do not order!) - https://​www.aliexpress.com/​item/​1pcs-0-96-white-blue-yellow-blue-0-96-inch-OLED-module-128X64-OLED-LCD-LED/​32639731302.html 
- 
- 
-==== RS Electronics Australia ==== 
- 
-  * Green 5mm LED - https://​au.rs-online.com/​web/​p/​visible-leds/​2286004 
-  * Orange 5mm LED - https://​au.rs-online.com/​web/​p/​visible-leds/​2285994 
-  * 2 x Right Angle buttons (Black) - https://​au.rs-online.com/​web/​p/​tactile-switches/​7856399 
-  * 2 x Right Angle buttons (White) - https://​au.rs-online.com/​web/​p/​tactile-switches/​7856392/​ 
-  * 1 x Right Angle buttons (Salmon) - https://​au.rs-online.com/​web/​p/​tactile-switches/​7856396 
-  * 14-pin socket - https://​au.rs-online.com/​web/​p/​dil-sockets/​6742438 
- 
- 
-==== Already on hand ==== 
- 
-  * 2 x 220Ω resistors 
-  * 2 x 1kΩ resistors 
-  * Tactile Switch 
-  * Header pins 
-  * 1 x Jumper (shunt) 
-  * Micro SD Card 
- 
-The first item to arrive was the Raspberry PI 3 and power supply. It made sense to test that first. I plugged it into my TV's HDMI and powered it up. Nothing. Dead.  
- 
-Turns out, without an SD card inserted, you get no life from the PI. "​Duhh",​ some might say, but when you've only ever owned a PI 2, which *will* show a rainbow splash screen without an SD Card, it's natural to assume you'll get some picture or output from it on a naked boot. 
- 
-I couldn'​t find any online documentation on this to confirm or deny. So to test, you will need to make a bootable sd card (at least partially) so you can test that the PI is good. So start on the SD card [[https://​cbm-pi1541.firebaseapp.com|instructions for the Pi1541 here]]. 
- 
-First was configuring the PCB. I went with option B because I wanted all the bells and whistles like daisy chaining to a real 1541. You can see how to configure for this here: https://​www.hackup.net/​2018/​07/​pi1541io-revision-4 ​ 
- 
-I chose the 3.3V and Bus 0. The I2C oLED screen I chose was the GND, Vcc (rather than Vcc, GND) so I configured the solder point for that. 
- 
-{{ :​wiki:​pi-5051.jpg?​direct&​500 |}} 
- 
-Next, was placing the four resistors and single capacitor. 
- 
-{{ :​wiki:​pi-5055.jpg?​direct&​500 |}} 
- 
-{{ :​wiki:​pi-5082.jpg?​direct |}} 
- 
-Then I configured the 7406 chip solder points. 
- 
-{{ :​wiki:​pi-5080.jpg?​direct&​500 |}} 
- 
-I add the 14-pin socket to the board which will house the 7406 IC. I noted the orientation of the socket, placing the notch to the left. For safety, as there were more components and points to solder, I didn't place the 7406 chip into the socket yet. 
- 
-{{ :​wiki:​pi-5152.jpg?​direct&​500 |}} 
- 
-Next placed were the two 5mm leds. I used green for the power indicator and orange for the drive activity indicator. The bill of materials asks for 3mm leds, but I opted for 5mm. This is totally fine and they fit without any issues. 
- 
-{{ :​wiki:​pi-5153.jpg?​direct |}} 
- 
-The PCB LED symbols indicate that the negative side is on the square pad, not the round pad. That's the usual way, but to check, I did a ground test first. 
- 
-The negative (cathode) does go into the square pad. Or another way to put it, the flat side of the LED points to the title text on the PCB. 
- 
-I then fitted the speaker enable header pins. 
- 
-{{ :​wiki:​pi-5154.jpg?​direct&​500 |}} 
- 
-Then, the 4-pin header. This is the header that will hold the removable oLED screen. 
- 
-{{ :​wiki:​pi-5155.jpg?​direct |}} 
- 
-The next thing was the 40-way header that connects the daughter board onto the Raspberry Pi board. I was careful to get this around the right way. The header is connected to the underside of the board. That is, the opposite side of the PCB to all the other connected components. 
- 
-{{ :​wiki:​pi-5156.jpg?​direct&​500 |}} 
- 
-Then I fitted the reset switch. 
- 
-{{ :​wiki:​pi-5157.jpg?​direct |}} 
- 
-Next was the piezo buzzer. The buzzer I chose was a bit of a tight fit. The legs were slightly narrower than the holes on the PCB. So the legs had to be bent outwards ever so slighlty. This took a little bit to push through. But it worked ok. Again, I did a ground test to ensure that the negative marking on the PCB was correct. The buzzer is polarised, so note the orientation. 
- 
-{{ :​wiki:​pi-5158.jpg?​direct |}} 
- 
-Attaching the Level Shifter Module was next. It arrives as a tiny board with all the surface mount components populated. Also packed with the shifter module is a strip of 12 header pins. These had to be snapped in the middle to make two sets of 6 header pins. Both sets were then soldered to each side of the module. 
- 
-{{ :​wiki:​pi-5159.jpg?​direct |}} 
- 
-Then the Level Shifter Module was soldered to the PCB taking careful note of the orientation. 
- 
-{{ :​wiki:​pi-5161.jpg?​direct |}} 
- 
-Next, the two DIN sockets were soldered into place. These two sockets sit very nicely together. 
- 
-{{ :​wiki:​pi-5162.jpg?​direct&​500 |}} 
- 
-Finally at this point, I added the 7406 IC into the 14-pin socket, noting the orientation,​ notch to the left. 
- 
-{{ :​wiki:​pi-5163.jpg?​direct&​500 |}} 
- 
-At this point, I was keen to give it a try, even though I didn't have the optional 5 switches in place. This is because I forgot to order some. I unsoldered a bunch of right angled button switches from various junk boards but they all varied in button depth. I wanted this to be a pretty nice build, so I ordered some from RS Electronics. 
- 
-I added the Pi1541 daughterboard to the Raspberry Pi, the oLed screen into the 4 pin header, attached the power, the DIN cable to the IEC socket and the other end into my Commodore 128. 
- 
-{{ :​wiki:​pi-5164.jpg?​direct&​500 |}} 
- 
-{{ :​wiki:​pi-5165.jpg?​direct&​500 |}} 
- 
-I turned on the C128 and then the Pi1541. 
- 
-The power light on the Pi1541 ​ came on, and a quick tinkle on the Raspberry Pi activity lights. But not much else. The oLED showed nothing. 
- 
-That's fine. The board still had flux all over it, and I didn't really check it over before trying it. 
- 
-However, I pressed F3 in C128 mode to get a directory of the disk. To my great delight and surprise, the contents of the SD card's 1541 folder started to list on the Commmodore monitor. This was a raw dump of the contents of the SD card rather than the contents of any Commodore disk (d64 file). 
- 
-It froze after about a screen or so. But something had worked. There was communication at least! ​ 
- 
-I turned the Pi1541 off. I noticed that I hadn't jumpered the buzzer to enable sound. Perhaps when listing the contents of the disk, I might hear some activity? I fitted the jumper and reconnected the power. I listed the contents of the drive again, but no sound, oLED, or drive activity light. 
- 
-I edited the option.txt and tried to add I2C setting for the screen. Then I specified a default D64 file to mount on bootup. ​ 
- 
-Tried the Pi again, but my settings were making it worse. Still no oLED, and now, no directory anymore. Just complaints of no device found. Loading "​*"​ did nothing. 
- 
-Time to check the soldering. 
- 
-Checked all points. Pleased to say I'd done a pretty good job. However, I did spot that somehow the voltage pads for 3.3 volts on I2C configuration section were not joined. Nor was one of the GND / Vcc pad joiners. 
- 
-{{ :​wiki:​pi-5170.jpg?​direct&​500 |}} 
- 
-I could have sworn I soldered these up. A quick check of the earlier photo confirms I was right. Could soldering the nearby components have transferred enough heat to have melted the joiners? I would doubt it. But it seemed to explain why my oLED screen wasn't working. 
- 
-I rejoined the pads correctly and reassembled. 
- 
-No difference. You have to be kidding me! 
- 
-I don't have an HDMI screen in my workshop, just a small VGA screen mounted to the wall. I had left my HDMI->​VGA converter at work. And it was the weekend. So I couldn'​t get a screen display until Monday night. There'​s always something! 
- 
-I brought the Pi1541 inside and connected it to the TV to see what it outputs. I was pleased to see that a menu screen appeared and all the D64 images were listed. So something was working. 
- 
-More fiddle-diddling with the options.txt but there was no change. At this point I started reading around. You know... reading the manual? I went back to the original instructions,​ and also read through [[http://​cheshire.iinet.net.au/​Pi1541Wiki.htm|the unofficial FAQ]] and [[https://​www.lemon64.com/​forum/​viewtopic.php?​t=67978|forum post on Lemon64]]. 
- 
-As much as I read about "​browser mode" or the file browser disk that was available, the less I understood of it. 
- 
-At this point, you'd be fairly certain I had less of a technical problem, and more of a problem that I didn't actually know how to use the Pi1541. 
- 
-Checking the unit again on the TV, I connected a USB keyboard and realised after a cold boot time of around 7 seconds, the menu would be ready. I could hit enter and the first .D64 image from the list would mount. Ok good. This means I could test it on the C128 without a screen. 
- 
-I hooked everything back up in the workshop, started the Pi1541, and after a few seconds, pressed ''​Enter''​ on the USB keyboard to mount the first disk: 1985.d64 from Mastertronic. ''​LOAD "​*",​8,​1''​ and lo and behold the game loaded! Complete with activity indicator led and buzzer sound! Can you believe it? This project actually works! ​ 
- 
-My eight year old daughter then spent quite a while playing 1985, then onto 720 degrees which she loved. She found 8-bit skateboarders falling into water hilarious. ​ 
- 
-So it WAS working. Didn't answer the issue of my oLED not working though. ​ 
- 
-Hooking it back up to the TV and I noticed the menu stated that ''​no I2C scan found''​. Checking my bill of materials order list, to my horror, I realise that I actually bought an ''​SSD1315'',​ not an ''​SSD1306''​ as stated in the Pi1541 materials list. 
- 
-But then researching the ''​SSD1315''​ it is supposed to be compatible with the ''​SSD1306''​. So is it? And how do I test if I have a dud? Youtube was a dead end, any video showing "​SSD1306 test" showed oLEDs already hooked up to Arduino boards and displaying something. I just wanted to get a simple multimeter test on the voltage pins.  
- 
-No-one demoed that. Perhaps I am the first person in the history of mankind to want to do the most basic of test. Anyway, I popped it onto a breadboard with a 3.6V lithum battery. Nothing. And no voltage on the Vcc. 
- 
-I could assume from this, that the unit is dead. However it might need a capacitor hooked up to it. At any point, I placed an order for an SSD1306 and had to leave it out for now. Perhaps I should have checked the datasheet :) 
- 
-The weekend came and went, and I brought my HMDI->​VGA converter home. 
- 
-I was able to hook the Pi's output to my workshop screen. I could select any D64 image and load it into the C128/64. 
- 
-A few days later my new right angle switches arrived. I soldered them into place and tested them out. They worked great. I could navigate the menu for my disk image, and select with the press of a few buttons. I bought two blacks, one salmon and two whites. This was so I could have the buttons reconfigured into the following order: 
- 
-Down : Up : Enter : Back : Insert 
- 
-That made more sense for me, and I easily changed this in the options.txt. 
- 
-{{ :​wiki:​pi-5175.jpg?​direct&​500 |}} 
- 
-To finish off the unit, I added the spacers, nuts and bolts to clamp the daughter-board to the Raspberry Pi.  
- 
-{{ :​wiki:​pi-5177.jpg?​direct&​500 |}} 
- 
-I since ordered another SSD1306, but it hasn't arrived in time for this article. 
- 
-And that's the end of the journey so far. I've always hoped someone would turn a Raspberry Pi into a 1541. It's such an excellent project. I would like to thank both Steve White for creating the Pi1541 and to CG for sharing his Pi1541 daughter-board design. 
- 
-I've donated to CG by purchasing [[https://​www.pcbway.com/​project/​shareproject/​Pi1541_IO_Adapter__Rev_4.html|his board via PCBWay]], and also [[https://​cbm-pi1541.firebaseapp.com|directly to Steve]] as a thanks for his hard work and generosity. 
- 
-When you consider you're dropping money for all the parts required, it's a nice idea to drop a few extra dollars to Steve and CG. 
pi1541.txt · Last modified: 2021/02/02 01:24 (external edit)