Author Archives: Machina

AVR basics: using the I2C bus #5 – final thoughts

Part 1 – bit rate Part 2 – transmitting Part 3 – sending data Part 4 – receiving data Part 5 – final thoughts The I2C bus isn’t that hard to use and for most applications it’s pretty simple. However, there is a lot more depth to it than we’ve covered here. The purpose of this final post in the… Read more »

AVR basics: using the I2C bus #4 – receiving data

Part 1 – bit rate Part 2 – transmitting Part 3 – sending data Part 4 – receiving data Part 5 – final thoughts This builds on the previous two posts that dealt with the fundamentals of sending data over the I2C bus on AVR microcontrollers and then how you actually do it. Receiving is a similar process, except for… Read more »

AVR basics: using the I2C bus #3 – sending data

Part 1 – bit rate Part 2 – transmitting Part 3 – sending data Part 4 – receiving data Part 5 – final thoughts In part 2 we looked at the fundamentals of how data is transmitted over the I2C bus. Now let’s actually do it. And, as usual with AVR microcontroller stuff, it’s all about registers. As before, our… Read more »

The stuff I use

      No Comments on The stuff I use

It’s always fascinating to know what kit others use. Reviews are all very well, but I’m more interested in what people work with on a day-to-day basis. So I’ve set up an account over on kit.com. I’ll be sharing lists of the equipment I actually use and like. If you see something in these lists you’ll know that: I bought… Read more »

AVR basics: using the I2C bus #2 – transmitting

Part 1 – bit rate Part 2 – transmitting Part 3 – sending data Part 4 – receiving data Part 5 – final thoughts So in the first post in this series, we looked at how to configure the bus speed for I2C. Now we’ve got that out of the way, let’s start sending stuff over the bus. The I2C… Read more »

AVR basics: using the I2C bus #1 – bit rate

Part 1 – bit rate Part 2 – transmitting Part 3 – sending data Part 4 – receiving data Part 5 – final thoughts When I first started playing around with Arduinos I quickly grew to like the I2C bus, and for a couple of good reasons. First, it was easy to use. And second, there are lots of fascinating… Read more »

AVR basics: control more devices using decoders

One of the issues with the Serial Peripheral Interface (SPI) bus, as many people have noted, is that it requires one Slave Select (SS) line – which means one GPIO pin on your microcontroller – for each device on the bus. That’s in addition to the three main bus lines – MOSI, MISO and SCK. This might be difficult on… Read more »

AVR basics: SPI on the ATMEGA – Part 2

In Part 1 we got the SPI bus set up on an AVR ATMEGA328P microcontroller. Now let’s start using it. Settings pins Before we get going, we need to set up the pins for the SPI bus on the AVR (which we’re using in master mode). I’m using the ATMEGA328P here, so I’m going to define some macros to make… Read more »

AVR basics: SPI on the ATMEGA – Part 1

When it comes to getting devices to talk to each other you’re spoiled for choice. There’s good, old-fashioned serial via UARTs, I2C (which I like a lot) and what is rapidly becoming my new favourite, the Serial Peripheral Interface (SPI). So let’s take a look at that. [Quick side note: please remember I don’t claim to be an expert. I’m… Read more »

Do you know what your code’s doing?

It seems like an obvious point, but it’s sometimes handy to know what your code is up to. If you normally write code for desktop systems – and especially if you’re hacking out something that works on the command line – then it’s easy. Just pepper your program with print statements to show the state of play. (Then try to… Read more »

Review: Exploring Raspberry Pi by Derek Molloy

This book was published in 2016 but I’d always dismissed it because I assumed it would be too basic. After all, I’ve been messing around with the Raspberry Pi for some years now and I really had no use for a book that spends the first couple of chapters saying ‘this is what an LED looks like and here’s how… Read more »

Raspberry Pi: creating a cross-development environment for ARM

So here’s a confession: I hate make files. And I’m really not all that keen on the whole compilation thing, with all those flags and whatnot. Why? Because I’m lazy. But of late I’ve felt myself drawn back to C++. There is something about the language that both appeals to me and repulses me. Mostly those make files. So this… Read more »

Hacking a film scanner

      No Comments on Hacking a film scanner

I’m building a rig to digitise my large selection of 35mm transparencies and negatives and in the process I’ve encountered what could be one of the worst electronic products I’ve ever bought. And in the spirit of the ineffable Big Clive, I thought I’d share my adventures in taking it apart. In some ways this belongs over on my photography… Read more »

Ghost in the machine: a BBC Micro on an FPGA

The BBC Micro was the machine that really got me hooked. The Sinclair Spectrum was the gateway micro, but it was the Beeb that got programming into my veins. So much so, indeed, that not long ago I finally gave into temptation and bought a BBC Master Turbo on eBay. It didn’t last long. Although fully refurbished, any machine of that… Read more »

PCB design: connecting with Eagle

[Eagle vs KiCad part 4] In the last post in my Eagle vs KiCad series I’d got as far as using Eagle to place all the components for the HexMonitor project in a schematic. Now it’s time to join them together. Even before I begin, something tells me that perhaps this is too ambitious a project for my very first PCB…. Read more »