Pluto PTT and PlutoDVB Firmware

The next step in the process of using the ADALM Pluto is sorting out a press-to-talk output to drive the Pluto Charon. In this instance I’ve followed the tried and trodden path of adding a small transistor output to one of the GPIO pins and updating the firmware. There are some interesting articles on the ADI website that discuss how to do this via the FPGA, but I decided to learn to walk before I ran.

When I ordered my Pluto Charon kit I also purchased the separate PTT module which you can see here (click). This is very easy to install, just make sure you observe good ESD practices when you remove the Pluto from it’s case and handle it on the bench.

Here’s the photo’s of how I installed mine.

I decided to use a small two pin right angle KK 0.254″ molex connector for the PTT output, as I’d like the capability of unplugging Pluto and Charon boards for service/changes/updates etc.

Now for the hairy scary part of the process. On the Mini-kits website is a URL to some custom firmware written by Evariste F5OEO that can enable a PTT function on a GPIO pin. I was at first a little alarmed by the comment “for the brave”, but it turns out this firmware is part of the PlutoDVB project. You can find later software from 2022 on Christian F5UII’s website (click) and you’ll see some comments about fixing the PTT on the Pluto Rev D boards to work with the latest versions of SDR-Console. I have a Pluto Rev C, which is the same as the Pluto Rev D, so I had no choice but to use this newer firmware and work out what to download.

So after reading most of Christians Website I discovered I had to do two things. Firstly I had to swap from the official ADI Pluto v0.38 firmware to the custom PlutoDVB 3.0.3 firmware. Secondly patch the 3.0.3 firmware to account for the Rev D hardware. This wasn’t obvious where to start.

Below is a summary of the steps I used to swap the firmware.

  • Connected the Pluto to my PC, checked it had presented a removable drive
  • Download the firmware from Christian F5UII”s website, I used the PlutoDVB perseverance firmware 0303 (26.6M)
  • Extracted the pluto.frm from the downloaded zip and stored it on the Pluto removable drive created on my PC (don’t get confused or alarmed by the file name “patch.zip” as this is indeed the entire firmware)
  • Ejected the Pluto and waited for it to finish doing the upgrade and reboot, once done it reconnected to the PC
  • Used a web-browser to point to http://192.168.2.1/index.html, confirmed it presented the “Lets go to PlutoDVB” welcome screen, not the ADI reference material.
  • Then clicked on the “Lets go to PlutoDVB (USB connection)” button which launched into the system setup.php page
  • From the menu across the top, selected “System ” then “Maintenance” where I found the patching and upgrading firmware mechanism.
  • For my hardware (Rev C/D) I needed to download and apply the “Patch for PlutoSDR Rev. D hardware”
  • Applied the patch, saw that within the “Delete Patch” window the updated files were displayed once done
  • Success !

Now I could configure the PlutoDVB firmware to do what I wanted, which in my case was to use SDR-Console. So from the “system” menu at the top I clicked on the “Pass-through” option and hit apply. That should be all I needed to complete.

There is an error message displayed across the top of the screen about a datv text file not being present. If you enter your call-sign in the respective field on the setup page and your name in the DVB provider field, hit “apply settings” and this will create the right file and the error message disappears.

Once all of this was done, I was able to setup and configure SDR-Console and test that the PTT worked with a multi-meter. Below you can see SDR-Console listening on 23cm ready for me to hit the TX button. The Pluto is sitting right up against the PC, so I’m not surprised there are some birdies in the shack, I’ll only panic once the Pluto and Charon and boxed up together.

For my next trick I intend to hook this up to my CRO and see how long before or after the PTT line is asserted does RF appear at the transmit port. However that will have to wait for the next post.

Boxing a Pluto Charon – the Heatsink

For the past couple of weeks I’ve been giving some thought as to how I’d box up the Mini-kits Pluto Charon. As with any problem the first step it to work out how I want to use it.

I’d like to be able to use the Pluto Charon both in the field and in the ham shack. The ADLAM Pluto connects to a PC via a micro USB and presents itself as a USB Ethernet device.

Further reading suggests that the ADLAM Pluto USB OTG port can host an external USB-Ethernet adapter or USB-WiFi adapter, making it possible to un-tether the Pluto from a PC or use standard IT infrastructure. In my situation an external Ethernet port is of interest, since I could easily build all of the Mini-Kits Pluto boards into their own enclosure and simply network them together and into the same PC without having to count on multiple USB ports. This again fits with my field and shack mode of operation.

The output power of the Mini-kits Pluto Charon, Pluto Styx and proposed Pluto Nix kit is in the region of one to two watts. This is more than enough transmit power to jump from hilltop to hilltop over quite a path with some antenna gain and short cables. If however you want to lift the antennas up to the top of mast, external in-line amplifiers up behind the antennas would be required to keep losses under control. If the external amplifiers also included a separate mast head amplifier, then losses of up to 6-8dB at any of these microwave frequencies could be accommodated without significantly impacting performance. I’ll be exploring this further once the first Pluto Charon kit is completed.

So, the first step of course is to get the Pluto Charon kit operational, to do that I needed to test it. The kit came with a small 40x40mm heatsink that I could attach to dissipate the heat from the final amplifier IC1. I mulled this over for a while before deciding I’d prefer to put a much larger heatsink on the top of a die cast box and mount the Pluto Charon to that. A good example of what I’m thinking is how I built my Rubidium reference (here). My main reasoning is I’d like to stabilise the heat within the die cast box so the Pluto does not need to work so hard on keeping the frequency stable. Did I mention the Rubidium reference, one would say this started these shenanigans.

To get the heat out of the Pluto Charon final amplifier the layout dictated a small copper block to be made. There are components on the top and bottom of this board, so one needs to pay attention to clearances etc. So it was off to see a good friend with a lathe ;thanks Peter it was a fun afternoon and some good machining Zen !

It is no coincidence that the copper block is 10mm thick, this is perfect for three 10mm hexagonal spacers to be placed under the remaining three sides of the PCB for support.

The hole in the middle of the copper block is what transfers the heat from IC1, so this was tapped to accept a M3 hole. The PCB had a plated 2.5mm hole and was reamed out slightly to accept the larger M3 screw. The M3 screw used was tin plated copper, not tin plated steel/stainless which is a poor conductor of heat.

The remaining four holes in the PCB that hold the heatsink were left M2.5 and the holes through the copper block drilled 3mm for clearance. When this is attached to the heatsink, four M2.5 x16mm screws through these holes in the heatsink, washers and split washers will be used to sandwich the assembly and keep everything held tight.

So I don’t forget and for anyone following along at home I’ve included the drill pattern. This was the only information conspicuously absent from the assembly instructions. This drawing is drawn from the top of the PCB looking down. The hole in the middle of the heatsink is referenced from the center of the copper block. For some reason I can’t get LibreCAD to show a mark for the origin yet. I hate having to measure PCB’s to get hole locations, a combination of transfer punches, vernier calipers and gauge pins were used to establish and check that these locations were close enough.

Now it’s time to carry on with the Testing and Alignment of the Pluto Charon !

So after two years ?

For quite some time I’ve been promising my eldest son his own bedroom. However like everything, this is somewhat complicated and has taken far longer than expected. To make this happen, I’ve had to make more shelving in the shed, move stuff stored in the garage out into the shed, clean out the garage and move my office, which was in the 3rd bedroom of the house out into the garage soon to become my new man-cave. I’ve felt like I’ve been playing musical chairs with storage boxes for quite some time. Then there is the time required to renovate said 3rd bedroom back into a teenagers retreat, so much work, so many weekends, I still hate painting.

However, while moving things out of the office and into the new man-cave I rediscovered the Pluto Charon kit, languishing in a forgotten project box. My original plan was to use this kit as my 23cm home station, however during the above renovations a member of my radio club offered me a pristine Icom IC-910H with 23cm module which I couldn’t refuse. Needless to say the Pluto Charon priority and urgency was pushed back somewhat.

Fast forward two years and having rediscovering this kit, along with seeing the new 12cm Pluto Styx kit available (click) and a teaser for the 6cm Pluto Nix, well it was time to finish it and continue working my way up through the microwave bands.

BGU8051 are small

This kit requires the usual SMD microwave construction techniques, so fine solder a good iron, a steady hand and optical magnification is an absolute must. The Mini-kits instructions and support page are as usual first class. However one should heed the warning on the website ordering page that “this kit is not for beginners and requires very experienced soldering skills”.

I generally found the majority of the kit straightforward, until I got to IC5 which is a BGU8051 preamp from NXP. You should check out it’s specs on the NXP website. This is one of those “looks big on the computer screen” kind of parts that even designers get caught out with when ordering their first samples. I’ve included a photo, along with a strategically placed steel ruler for scale. That IC is tiny… really tiny !!!

At just two by two by three-quarters of a millimeter with eight pins, it was clear that this was not going to be soldered by any ordinary soldering iron. Thankfully I have a hot-air rework station, so I manually pasted the board with an I-Extruder, used plenty of flux and re-flow soldered the device to the board. Since inductor L7, capacitor C30 and resistor X3 were so close, I chose to leave these off until I had soldered IC5 to give me room and ensure the hot air did not cause unnecessary stress to adjacent components, YMMV. I also typically use a T3 solder paste for the majority of my kit building, but for this board I resorted to using T4 since you could nearly count the number of solder balls dispensed onto each pad of IC5. However I’m happy with the result and with the right tools this kit can be assembled at home. There are many YouTube tutorials on how to solder with hot-air worth watching as well.

Once I had the kit soldered together I then turned my attention to how I was going to put it in a box and begin to test it. However that is for the next post !

The HPE H220, now LSI SAS9207-8 and TrueNAS 12

I’ve been running TrueNAS (previously FreeNAS) at home for more than 10 years on various grades of “least expensive” HP Server hardware. I’ve been impressed from the very beginning. With two young boys data has been accumulating at a fast rate for a number of years and my most recent HP ML10V2 server had simply run out of storage space. So when my file server started throwing SMART errors, telling me one of the drives was on the way out it was time to hurry up with that planned upgrade.

I won’t bore anyone with the details suffice to say, it was going to go from a three drive Raid-Z1 array to *at least* a Six drive Raid-Z2 array, increasing storage from 6TiB to a whopping 16TiB and doubling the number of active spindles. That should give us all plenty of time to grow our “media” library somewhat and replace drives as necessary upgrading the pool as we go.

However before I made this jump I needed to get the HP H220 Raid Card re-flashed and reconfigured for a life outside its traditional RAID setup. After a little research on the interwebs it turns out the HP H220 that I’d bought was a rebadged LSI/Avago/Broadcom SAS9207-8 controller with custom firmware. It pays to cruise the interwebs (especially Serve The Home forums) and find out about your cards chipset, since there are two known versions of the HP H220 card in circulation and they use different chipsets, which can be bothersome.

Now these Storage cards are “intelligent” and come configured for SAS/SATA RAID systems in what’s called IR mode. For TrueNAS we need to the card in a more traditional IT or JBOD mode where TrueNAS can see and control the disks each individually. It does seem odd that we take these high-spec cards and dumb them down, but keep in mind the two SFF-8087 connectors on the card can drive up to four SATA drives at 6Gbps without flinching, with all eight channels singing it will bring the I/O load up on any PCI-E 2.0 bus . For less than A$65 at the time of writing this is still good value.

So just how does one re-flash the firmware on these LSI 9207-8 cards without bricking them ? Well it turns out these cards are hard to brick, the software has a number of checks to prevent silly mistakes, so they are not as fragile as many would fear.

However there are some tricks that I learnt which I thought I’d share, note this is not a how to guide just a collection of my notes I made as I went;

  • The DOS version of the SAS2FLSH utility is what we want to use, it will allow the upgrade or downgrade of firmware and card bios, the UEFI, Windows and linux varieties are not so nice, there is a technical article (ID: 1211161501344) that you can read all about it (YMMV).
  • You can download (at the time of writing) all of the firmware for these cards from the Broadcom website. The webpage is not intuitive, start in the Support and Services / Support documents and downloads page, search using “Legacy Products” and “All legacy products” then 9207-8, perservere there are there and can be found; don’t forget to read and accept the Broadcom license agreements.
  • You will need the P20, P19 and the P14 firmware with IT, IR, BIOS for MSDOS, they are 1.7MB zip files.
  • You can then make yourself a FreeDOS boot disk using Rufus
  • Copy the P20 firmware (9207-8.bin), P19 bios (mptsas2.rom) and P14 sas2flsh.exe utility to the DOS boot disk, and you’re done.
  • The P14 SAS2FLSH utility does not balk at the card being branded HPE when it’s expecting to see LSI, later versions of SAS2FLSH (P19/P20) do this check and will refuse to update. Note that once you write the LSI bios you’ll need to find the original HP bios ROM on the interwebs if you want to go back, there didn’t appear to be any “save” current bios options… caveat emptor
  • The P20 bios ROM will “red screen of death” on some HPE server machines, my ML10V2 was no exception; I simply downgraded the bios to P19 which was 6 months older than my HP bios (J10) version and worked.
  • Once flashed, reboot the machine and enter the controller configuration and setup the card the way you need, hint it helps to specify which card/drive you will boot from, might save you a few unnecessary reboots to find out why it’s not working… sigh

Anyway I’ve made this post to firstly remind me what I’ve done if and when I need to repeat this exercise in the future, it may also be helpful to someone that is trying to update the card and is having trouble. These cards are difficult (not impossible) to brick, but the above certainly worked for me on my hardware, as always YMMV.

Motorola CPS on Windows 10/11

It is no secret that Motorola CPS software does not like to run on modern operating systems. I still have a number of UHF Motorola MTS2000 handhelds which once given new batteries have proven themselves useful time and time again.

However my trusty old Windows XP laptop, with a real serial port fried its motherboard recently never to boot again. My immediate thought was “yikes what do I use now to program these Motorola radios” ?

So rather than go looking for further ancient hardware I started experimenting if Motorola CPS would run on a Windows 10 64-bit platform. I’ll spare you the gory details, but not amount of compatibility mode twiddling or research would result in a working system. There is something fundamental in the RS232 32-bit sub-system within the CPS software that prevents this from ever working. I could not get the CPS software to “read device” instead receiving a timeout. Grrrr….

So the only alternative was to experiment with an older version of Windows in a virtual machine and passing through a serial port. I remember when Windows 7 was first released Microsoft released a version of Windows XP that would run within Microsoft Virtual PC. The Motorola CPS software is from around the same time, so it was an ideal candidate to try. Turns out this was easier than I expected.

Setup Windows XP Virtual Machine

I found the following setup guide very useful from Help Desk Geek website (click). The download link from the Microsoft site has disappeared, but the alternative link from the CNET site was working at the time of this post.

I followed this guide closely, there are a few steps you needed to pay attention too but otherwise this went smoothly. I’m currently using a Windows 10 host and the only trouble I had was with the mouse, where I could not control the mouse within the Guest correctly, but you can temporarily disable the VirtualBox “mouse integration” feature to get around this until the VirtualBox Guest Additions are installed. Once the Guest additions were installed, everything worked as expected.

Activating Windows XP in 2022

The next challenge is since Windows XP support ended there is no way to “activate” this vanilla of windows any more which is right painful. One work around is to snapshot the VM and rollback each time you wish to use it, I wasn’t a fan. So thankfully the “Roger Webb” YouTube channel had a video that shows how to work around this problem, don’t forget to leave a like.

Serial Port Pass Through

Now I’m lucky that my Gen-3 I7 desktop machine has a real serial port on the motherboard. This was one of the very last Intel made motherboards with the legacy IO chipset, so not only do I have a serial port it has a parallel port too.

To allow Windows XP access to the host serial port, one just needs to configure the hardware pass through. Within the VirtualBox settings there is a separate “Serial Port” tab that simply requires mapping between the guest and host systems.

As you can see I’ve simply mapped COM1 on the guest to COM1 on the host, simples !

Copying Motorola CPS into Windows XP

So for the grand finale we can install the Motorola CPS software within Windows XP. How one gets the software installed can be done a few different ways.

I decided to use the VirtualBox shared folders mechanism. With the guest additions installed I found once I’d configured the shared folders they were automatically mapped as a network drive the next time I restarted the Windows XP guest. It was a simple matter to then double click the executable and install.

There were a few websites with rough instructions, but I found after watching the following YouTube video from Peter Downie I was able to get it working in short order;

The other method I’ve used to pass software through to a guest is to use a USB thumb drive. Copy the files from the host to the USB, pass the USB through to the guest, move the files and eject to pass it back. Both methods work just as well as each other.

The Proof is in the Pudding

So once you can copy the relevant files into the VM, then it’s a simple matter to install and run the Motorola CPS software. Then simply configure it to talk to the serial port you’ve passed through which is COM1 in my case, then try to read a physical radio. Please note that Motorola CPS software is licensed and cost real $$$ to purchase, please do not request copies of said software fro me as refusal often offends.

You will know you’ve got it right when you hear the radio beep, it says PRGM on the radio display and you are greeted with the contents of your code plug.

I was certainly relieved to be greeted with the screen shown above, make my changes and write the config back to the radio. I’m once again in business. I hope that other users of older Motorola CPS software find this useful.

How do you get on 23cm ?!?

I was recently looking at getting some radio gear that would get me up onto the Australian 23cm Amateur Radio Band. My first thoughts was to find some second hand commercial amateur gear, but this was soon dashed when 20 year old radios on eBay were fetching more than A$1000 in less than pristine condition. They are hard to find !

My second thought was of course a transverter. Where I would take one of my 2m or 70cm transceivers and “up-convert” the output onto the 23cm band. This is usually done by a combination of loads, mixers, fixed oscillators and amplifiers that you buy assembled or as a kit. Since I wanted to do both FM and SSB this presented something of a problem as the receive transmit frequency split for Australian 23cm repeaters is +20MHz. This means the radio attached to the transverter IF port has to be capable of wide band receive, which is not very common. So my calculator again suggested after I’d built a transverter, added a dedicated IF radio I’d be somewhere northwards of A$750… sigh that second hand commercial radio looked good again.

One of my local radio club members then introduced me to the Analog devices ADALM-Pluto SDR and the Pluto Charon 23cm module from Minikits here in Adelaide. I was hooked and two new toys were duly ordered and shipped. The cost of both the ADALM Pluto and Charon 23cm module was less than A$450 delivered but I did have to do a little shopping around to get the Pluto at a good price.

I then started researching what exactly you can do with one of these little devices and what exactly I’d just bought. I’m simply amazed at what Analog Devices have stuffed into this little box, better yet I’d received one of the Rev D platforms which has all the bells and whistles. As I discover things about the Pluto, I’m sure to blog them here soon.

I was again pleased to find the ADALM-Pluto was already supported by SDR-Console written by Simon Brown G4ELI. I’ve used SDR Console for many years in all of my HF contesting stations to display waterfall information. Using it for transmit was going to be a new experience.

Now to wait for that postman !

Altium Designer & Windows 10

If you are a regular user of an older version of Altium Designer (AD), you may find some “interesting” problems when running on the latest version of Windows 10.

When recently creating a smart PDF I noted that the reference zone text within the page boundaries of a schematic had suddenly disappeared. Thinking this was odd, I also tried printing to a PDF no dice, worse yet a print preview gave the same result. So where did they go ?

There was little useful help from the Altium website about such issues, other than to say it could be a video card or print driver problem and to delete all drivers and add them back one at a time until you work out which one is causing the problem. Sigh, so not helpful.

Instead it turns out in older versions of AD may use the 32-bit GDI+ interface to render text, this was always going to end badly with the latest 64-bit edition of Windows 10.

Thankfully one can disable this feature within AD by clearing the “Render text using GDI+” checkbox in the following Menu;

DXP > Preferences > Schematic > General > Options

After unchecking, the reference zone characters reappeared in both my SmartPDF and printed copies, woo were back ! I’m filing this here so I can remember what to do the next time I have this problems, I hope that others may find this useful.

pfBlockerNG + GeoIP and the unintended consequences

For anyone using pfBlockerNG with GeoIP enabled there are a couple of hidden gotchas if you like Streaming Services !

During this COVID-19 crisis I was able to work from home remotely. During this time I noticed that every hour at 1 minute past the hour that various streaming services would loose connectivity for approximately 60 seconds. Apart from being very annoying and embarrassing, my co-workers began to set their clocks in meetings each time I dropped out.

So after ruling out the usual DHCP issues on my WAN, ISP issues, low level hardware issues etc I then remembered some weeks before this COVID-19 malarkey installing pfBlockerNG using instructions from one of my favourite YouTube channels Lawrence Systems (click). There are no such things as co-incidences.

So investigating various options and double checking configurations I noted this unassuming check box at the bottom of the pfBlockerNG IP configuration page;

So thinking about this a little, what it means is every hour on the hour this will force any current IP states in the firewall found to be within a blocked range to be cleared. This includes established states. It was about then the penny dropped, what if the streaming services I was currently using were in a GeoIP blocked group, every hour on the hour any established connection would close, then be forced to renegotiate a connection. Sigh. So this is how I had configured my GeoIP settings;

What you can’t see here is within Oceania I’d unblocked my own country “Australia” from these rules. What made me twig to this being the problem is some of the streaming services I use were not being interrupted, upon a little digging all of these used a CDN (mainly Cloudflare) and were coming from IP ranges that were not being blocked. Where as services like Foxtel Go, Microsoft Teams and even ssh connections to my virtual server in Japan were dropping with frightening regularity.

To stop this from happening all I needed to do was not enable the kill states and away it went again. I could have also taken a longer route and identified IP ranges for stream services I wanted to allow, and may investigate this further. YMMV.

Surprise Visitor on Doorstep

This week in Adelaide we’ve had a heat wave, where the minimum over night temperatures haven’t dropped below 35 degC (95 degF) with maximums up and over 43 degC (110 degF). It’s been hot, damn hot.

In Australia we typically find our koala’s sitting in trees, however during heat waves we find them seeking cooler places.

So today I found this little munchkin sitting on my front doorstep when I got home from work, it was a small ball of misery when I first saw it.

It would likely be last years Joey, so about 1-2 yrs old and only just separated from its Mother. I believe I has seen this juvenile koala on his mothers back last summer, there are two females and a male that visit our house regularly.

So given a little water in a big flat dish, a light misting with a water bottle I quietly snuck inside opened the front door and turned the evap air-conditioner on. There was a fair draft of cool moist air headed out that door. With a few hours to cool down and a bit of a nap it once again sat up (a good sign apparently) had clear eyes and bottom. I’m guessing that once darkness falls and it cools down my little visitor will go and find something to eat.

Thankfully a cool change has just arrived and temperatures are finally plummeting back into the low 30’s (mid 80’s F).

And for an encore we also took a swim…

I’m going to have to admit that Juvenile Koalas are very cute and rather photogenic.

The Bus Pirate & my High-2-Sea Adventure.. Arrrrrrr !

This past week I’ve been busy hacking on an Arduino project that uses the I2C bus. It’s been ages since I’d used the Wire library so I was more than a little rusty. Thankfully when it came time to test the code I’d written I could reach into my test equipment box and yank out my Bus Pirate. I’ve been saving up that post title for a while now.

Looking in the test equipment box I noticed at some point in the past I’d purchased one of the SeeedStudio v4 bus pirates which I’d forgotten about. Until now I’d typically used the Sparkfun v3.6 design. Hmm don’t remember when I purchased the new unit, must be old age.. Anyway seemed like a good time to take the plunge with the updated unit.

This new Arduino project monitors the voltage and current in a few external supply rails. Which can then be read by another device over the I2C. I’m sure at some point you’ll find the project code sitting in a public repository along with some hardware files as I complete and test a bit more of the project.

The bus pirates are great if you need to drive and interact with I2C devices. It implements a very simple macro style interface which means you can also edge case test and send out of order I2C signals to make sure your code is working.

So the first surprise with the new v4 unit was when I plugged it into my Windows 7 Dev machine, it needed a driver. I found it here here in the bus pirate archive (click), it actually wasn’t that easy to find. Once I’d updated the “driver” Win 7 it then did its usual thing and turned into a Serial Port.

Connecting to the Bus Pirate with PuTTY is relatively straight forward once you’ve found the serial port number, serial speed is 115200. It was then time to connect the wires. Dangerous Prototypes have a great page on how to do this, you can find it here (click). In a nutshell on my v4 board MOSI connected to SDA, CLK to SCK and GND to GND. Now back to the console. Firstly we need to get the Bus Pirate into I2C mode, so I used the following commands;

HiZ>m
1. HiZ
2. 1-WIRE
3. I2C
4. SPI
5. 2WIRE
6. 3WIRE
7. LCD
8. DIO
x. exit(without change)
(1)>3

I2C mode:
 1. Software
 2. Hardware
(1)>1

Set speed:
 1. ~5KHz
 2. ~50KHz
 3. ~100KHz
 4. ~400KHz
(1)>2
Ready
I2C>

As you will see I decided to select I2C software mode and a speed of 50kHz to start with. So now we need to turn on the power supplies and turn on the pull-up resistors to talk to the Arduino.

I2C>W
Power supplies ON
I2C>P
Pull-up resistors ON
Warning: no voltage on Vpullup pin
I2C>

Umm… hold the boat ! What’s happened to the pull-ups? That one threw me for a bit, I don’t remember the Sparkfun v3.6 units doing this.

Well if you’ve only skim read the Dangerous Prototypes v4 page like I had you would have missed you need to connect the Vpu pin to one of the internal supplies, so in my case I used another wire to short Vpu to the 3V3 pin, conveniently they were adjacent to each other.

If you look closely you can see a yellow wire in the top right of the image above, that joins Vpu to 3V3 and is the secret sauce to making this work. Ok so now that’s solved I could then try to get the power supplies and pull-ups working again;

I2C>W
Power supplies ON
I2C>P
Pull-up resistors ON
I2C>

From here it was straight forward to the rest of the testing. Another good tid bit is the following macro is great for checking things work as expected, essentially it scans the bus and will report all of the devices it can talk to;

I2C>(1)
Searching I2C address space. Found devices at:
0x40(0x20 W) 0x41(0x20 R)
I2C>

Sweet. The Bus Pirate found my device and tells me I can read and write to it. More importantly I know what address to use, sometimes things get a little screwy due to the 7-bit I2C address and the read-write bit. Dangerous Prototypes have a good guide that allow you to work out what macros you need to use to build your I2C commands (click).

Here’s an example of me reading a single register from a specific address from within my Arduino I2C firmware;

I2C>[0x40 0x50[0x41 r]
I2C START BIT
WRITE: 0x40 ACK
WRITE: 0x50 ACK
I2C START BIT
WRITE: 0x41 ACK
READ: 0x08
NACK
I2C STOP BIT
I2C>

So the macro above can be read from left to right and in words;

  • send a start condition
  • the write address (0x40)
  • a data byte (0x50)
  • a second start condition
  • the read address (0x41)
  • read byte
  • stop condition

.The bus pirate then prints that it READ a value of 0x08 from that register. Actually that value tells me there are 8 bytes in that register strucutre, so I can modify my macro and read the entire contents;

I2C>[0x40 0x50[0x41 r:8]
I2C START BIT
WRITE: 0x40 ACK
WRITE: 0x50 ACK
I2C START BIT
WRITE: 0x41 ACK
READ: 0x08 ACK 0x20 ACK 0x1C ACK 0x00 ACK 0x00 ACK 0x98 ACK 0x3A ACK 0x00                       NACK
I2C STOP BIT
I2C>

You’ll see that the last part of the above macro is now set to read 8 bytes and you can see the response from the unit appears to have data in it. The nice thing with an Arduino is you can have it print out messages on it’s serial port and then check the responses match, so I’m gong to call that working !

Now all I need to do is write a script that can then test all of the I2C edge cases to ensure my code really works and I’ll be able to move on to a more interesting part of the project.