<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rp2040 on The Last Psion</title><link>/tags/rp2040/</link><description>Recent content in Rp2040 on The Last Psion</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 15 May 2022 00:00:00 +0000</lastBuildDate><atom:link href="/tags/rp2040/index.xml" rel="self" type="application/rss+xml"/><item><title>Psion SSD Drive, anyone?</title><link>/posts/psion-ssd-drive-anyone/</link><pubDate>Sun, 15 May 2022 00:00:00 0000</pubDate><guid>/posts/psion-ssd-drive-anyone/</guid><description>&lt;p&gt;&lt;img src="/posts/psion-ssd-drive-anyone/5549971652613091035.jpg" alt="Raspberry Pi Pico on a breadboard, with wires connecting to a SIBO SSD"&gt;&lt;/p&gt;
&lt;p&gt;I wanted to put out an update about my various Psion projects. I’ve been away for a while, thanks to some mental health issues culminating in a career change. It’s only in the last week or so that I’ve felt able to look at projects like this again; projects I enjoy but for which I just didn’t have the mental energy.&lt;/p&gt;
&lt;p&gt;I have started to work on something again, something I had kept quiet about because I didn’t want the outside pressure. But now I think that outside input might help, and I thought this would be the best place to post about it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; I’m designing a Psion SSD Drive, based on the RP2040, that will work over USB-C.&lt;/p&gt;
&lt;p&gt;I had originally thought about using the ESP32 for this, and the early stages of this project were based on the ESP32. But I don’t need WiFi and I really want to play with the RP2040’s PIOs!&lt;/p&gt;
&lt;p&gt;Near the end of last year I decided to take the code from &lt;code&gt;sibodump&lt;/code&gt; and &lt;code&gt;siboimg&lt;/code&gt; and squash them together on an ESP32. With the help of some friends at my local Hackspace, I picked some level shifters that do an excellent job of converting 3.3v to 5v and (with one chip) back again. I bought a small stock in case I blew one up (which I did), plus some breakout boards. I also bought a Raspberry Pi Pico, simply because it was cheap and I thought it might be fun. Then, with more help from the Hackspace lads, I worked out what circuitry I’d need to write to a Flash SSD. Finally, I tried to design a board, got too bogged down in the details, got annoyed with the project and put it in my Psion cabinet, where it sat for 6 months.&lt;/p&gt;
&lt;p&gt;Last week I decided I’d take another look at the project. Long story short and almost on a whim, I decided to get the Pico out and try converting the code over. I then discovered TinyUSB, and in a moment decided that the RP2040 would be far more fun to play with than the ESP32.&lt;/p&gt;
&lt;p&gt;To be fully compliant with the Psion SIBO HDK, I need 4 pins: &lt;code&gt;DATA&lt;/code&gt;, &lt;code&gt;CLK&lt;/code&gt;, &lt;code&gt;DATA_DIR&lt;/code&gt; (to say which direction &lt;code&gt;DATA&lt;/code&gt; is going), and &lt;code&gt;CLK_OE&lt;/code&gt; (to disable &lt;code&gt;CLK&lt;/code&gt; when it’s not in use). &lt;code&gt;CLK_OE&lt;/code&gt; isn’t necessary for communication, but it makes the drive fully compliant with the HDK, so I’d like to try to implement it.&lt;/p&gt;
&lt;p&gt;For USB communication, I’m planning on using TinyUSB in two ways. I’d like to make this a block device, but I’m not clear on how to do this well. But I would really like to implement a dummy ethernet device and run a web interface. This is going to give users a huge amount of flexibility, plus make the Drive as cross-platform as possible. I’ll probably keep some sort of serial comms available for debugging, too.&lt;/p&gt;
&lt;p&gt;I want the Drive to be able to do regular read-write actions, but also rip and burn SSD images, show full details of the SSD hardware, and (if I can work out how) show the battery status of a RAM SSD.&lt;/p&gt;
&lt;p&gt;I’m currently prototyping with a Raspberry Pi Pico and the Arduino libraries on PlatformIO. As time goes on I will probably try to use the Arduino libraries less and go straight for the RP2040 C/C++ SDK, but for now it’s made the code a lot easier to port to the Pico. Even switching from Arduino’s &lt;code&gt;digitalWrite()&lt;/code&gt; to the SDK’s &lt;code&gt;gpio_put()&lt;/code&gt; has given the code a huge speed boost; toggling CLK goes from about 350KHz to well over 20MHz, and that’s without using PIO. I’m also still not sure if PlatformIO is making my life easier or harder…&lt;/p&gt;
&lt;p&gt;My next steps in no particular order are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Move communication from software to PIO. There are four basic types of “frame”: Device Reset, Send Control Command, Send Data and Receive Data. Then I need to add &lt;code&gt;DATA_DIR&lt;/code&gt; and &lt;code&gt;CLK_OE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Convert the Flash FS code from a series of functions to a class.&lt;/li&gt;
&lt;li&gt;Work out how to write to a Flash SSD.&lt;/li&gt;
&lt;li&gt;Work out how to read RAM SSDs (they use FAT) over SIBO-SP.&lt;/li&gt;
&lt;li&gt;Add a simple web interface via TinyUSB.&lt;/li&gt;
&lt;li&gt;Design a proper prototype board, rather than having everything on a breadboard.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’d really love to hear your thoughts on this. I’ll be working on it at my own pace when time allows, so don’t expect it to be done in a month or even in a year. I haven’t created a GitHub repo yet, but I will once the code is at a suitable point. But I can see that I’m going to need some input from the outside world to make this work.&lt;/p&gt;
&lt;p&gt;As an aside, rest assured that I will be revisiting the WiFi Pack at some point, but it’s not my priority right now.&lt;/p&gt;
&lt;h2 id="relevant-links"&gt;Relevant links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sibodump&lt;/code&gt;: &lt;a href="https://codeberg.org/thelastpsion/sibo-ssd-dump"&gt;https://codeberg.org/thelastpsion/sibo-ssd-dump&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;siboimg&lt;/code&gt;: &lt;a href="https://codeberg.org/thelastpsion/siboimg-c"&gt;https://codeberg.org/thelastpsion/siboimg-c&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>