Reading an analogue value in C on a Freescale Freedom KL25Z

After spending the last few days messing with a MCP3002 SPI ADC chip, I’m beginning to wonder if it is not really suitable for my needs after all. Both the SPI libraries I have tried have had problems with excess waiting around transfers, which becomes very significant when each new sample requires a whole new …

Continue reading ‘Reading an analogue value in C on a Freescale Freedom KL25Z’ »

Using the bcm2835 C library for SPI

Yesterday I used Gordon’s WiringPi library to successfully read analogue voltage values from an MCP3002 chip over SPI. My plan for today was to try and read data as fast as possible, to begin building one version of an ultrasonic “bat detector”. However, I got a bit distracted.. When I looked in detail at the …

Continue reading ‘Using the bcm2835 C library for SPI’ »

Reading analogue data on a Raspberry Pi using MCP3002

I got a bit disappointed with my little bus pirate yesterday. I’ll investigate how to update it to fix the odd SPI behaviour another time, but for now, its on to trying to read the MCP3002 SPI ADC chip directly using the Raspberry Pi. However, this one I’m going to do a bit differently. My …

Continue reading ‘Reading analogue data on a Raspberry Pi using MCP3002’ »

Another try at reading a MCP3002 ADC with Bus Pirate

A few months ago I got somewhat stuck trying to understand how to “join the dots” between the Bus Pirate and a MCP3002 SPI analogue to digital converter (ADC) chip. Finally I abandoned the effort and moved on to other things. More recently, however, I have succeeded in sending data to a MAX7219 LED matrix …

Continue reading ‘Another try at reading a MCP3002 ADC with Bus Pirate’ »

Driving a LED array from a BeagleBone Black

Over a month ago, now, I had a brief play with my Beaglebone Black. It took me a while but I just about got to the point of flashing an LED. That was enough at the time, but now I want to do something more interesting. So I thought I’d start by doing some patterns …

Continue reading ‘Driving a LED array from a BeagleBone Black’ »

Repairing a faulty “flowing water light” board

For my next experiments with LEDs and PWM I need more lights. When I bought the “flowing water light” I also bought a second one, but I hadn’t bothered assembling it yet. Naively I thought it would be as straight-forward as making the first one. I assembled the board (as far as I can tell) …

Continue reading ‘Repairing a faulty “flowing water light” board’ »

Using bit-angle PWM to drive GPIO pins

Although yesterday’s post was a reasonable introduction to bit-angle PWM, showing a pattern of characters on a console screen is hardly the most exciting or useful thing. So today I shall try to use the same code to drive something a bit more fun. I still had the “flowing water light” lying around, which I …

Continue reading ‘Using bit-angle PWM to drive GPIO pins’ »

Efficient software PWM with bit-angle modulation

It is a few months now since I last had a play with pulse-width modulation (PWM). At the time I was concerned by the amount of processing power used by the simplistic approach I had implemented, so I abandoned the exercise. Luckily, there are more efficient ways to do software PWM. One of the most …

Continue reading ‘Efficient software PWM with bit-angle modulation’ »

Driving a 7219 LED matrix from a Raspberry Pi

Flushed with my success in getting data displayed on my cheap LED matrix using a Bus Pirate, I decided that the next step was to see if I could get it working with a Raspberry Pi. It feels like I luckily won big when i tried starburst slot online, click here to get out from …

Continue reading ‘Driving a 7219 LED matrix from a Raspberry Pi’ »

Testing a MAX7219 LED array with Bus Pirate

After thinking about how to drive the MAX7219 LED array I built yesterday, it occurred to me that maybe this is an ideal time to get to the bottom of how to use the Bus Pirate board that I failed to use with a MCP3002 ADC chip. This time I was determined to get it …

Continue reading ‘Testing a MAX7219 LED array with Bus Pirate’ »