Tag Archives: programming

Flowchart your way to success

      1 Comment on Flowchart your way to success

Does anyone still use flowcharts for programming? What with today’s complex development frameworks it seems unlikely that anyone’s stopping to draw diagrams on paper. But maybe if they did we’d have fewer security vulnerabilities – just sayin’. My addiction to computers, in the early 1980s, was driven in part by ‘30 Hour Basic‘, an introduction not just to the language… Read more »

DottyMatrix software stack: PHP & Python messaging

On the Raspberry Pi that I’m using to control my DottyMatrix serial-to-parallel Centronics printer interface there are two main software components – a web-based PHP/JavaScript front-end UI and a back-end server programmed in Python. So these need to talk to each other. Here’s the overall architecture of the solution: The matrixSvr.py program is intended to run permanently on the RPi… 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 #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 »

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 »

ESP8266 and MicroPython: first scripts

So I have MicroPython installed on an Adafruit Huzzah ESP8266 dev board. The next step is to get it to run something. MicroPython establishes a basic filesystem using the board’s flash memory. This is handy for storing configuration and data files. And it supports a directory structure. But there are two files in particular you need to get to grips… Read more »

AVR: Battling bizarre bugs

      1 Comment on AVR: Battling bizarre bugs

Do you ever get the feeling that a compiler is acting weird just to mess with your head? That’s how it felt yesterday. I was tinkering with the code for my HexMonitor. This uses an ATMEGA328P microcontroller to read values in from an eight-bit data bus or a 16-bit address bus (selectable via a switch) and display them on a… Read more »

Debugging AVR ATMEGA code with Atmel Studio and ICE

One of the more challenging aspects of writing code for microcontrollers is not being able to liberally sprinkle your code with PRINT statements to show the state of variables and whatnot at particular moments. If you’re working with Arduino-type devices you can always fire up the Serial library and print stuff that way – back down the wire to a… Read more »

AVR basics: ports and direction registers

Pretty much the first thing anyone does with a microcontroller, whether it’s a naked AVR chip or something fancy like an Arduino, is flash an LED. This series is part of my learning process and I hope it will help others who, like me, are embarking on projects such as programming AVR chips. The way I learn things is to… Read more »

AVR basics: An introduction to AVR registers and macros

It’s occurred to me that I somewhat jumped the gun when I wrote a blog post a while back about interrupts on AVR ATMEGA microcontrollers. Maybe it would be useful to take a step back. This series is part of my learning process and I hope it will help others who, like me, are embarking on projects such as programming… Read more »

AVR basics: interrupts

      No Comments on AVR basics: interrupts

I confess I’m really enjoying delving into the secrets of AVR microprocessors. Having used Arduinos for some time now – as well as other AVR-based boards such as the mighty and wonderful Teensy – I came to the conclusion that I’m a master at µcontroller hacking. Working with ‘raw’ AVR processors quickly disabused me of that notion. The Arduino ecosphere shields you from a… Read more »

A little bit of an obsession

      No Comments on A little bit of an obsession

So I wrote this Python program to allow me to carry out certain kinds of calculations on binary numbers — you know, AND, OR, XOR and that kind of thing. It’s an absolutely essential tool for anyone who, you know, needs to NAND two 12-bit binary numbers. And happens to own a PiDP PDP-8 replica. Okay, so that’s a very… Read more »

Python on the PiDP

      No Comments on Python on the PiDP

I’m not really a C kind of person. And so when I finished building my PiDP kit, I immediately started thinking, ‘Wouldn’t it be nice to use all these switches and lights from Python?’ Because Python really is my kind of language. You can be properly expressive in it. And there’s not all that nasty business with make files. Fortunately,… Read more »