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’ »

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. Looking around for useful resources to get me started I found: Understanding SPI on the Raspberry Pi from Gordon’s …

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

Code Warrior, Eclipse, and Freedom boards

As you may recall, I have plans to use a Freescale ARM development board (such as a KL25Z, or a K20D50M) as an I/O interface for at least one Raspberry Pi project. These boards are a bit like a super-Arduino: small enough to fit in the archetypal mint ton, bristling with pins for digital, analog, …

Continue reading ‘Code Warrior, Eclipse, and Freedom boards’ »

txtzyme on Raspberry Pi

After my previous post on delimiter-free languages it occurred to me that the idea of txtzyme has merit for communication between some of the devices I have to hand. Some while ago I spent some time producing some bare-metal code examples for the Raspberry Pi (flashing morse code, GPIO control and uart stuff, for example), …

Continue reading ‘txtzyme on Raspberry Pi’ »

Porting (FFT and traffic lights)

Today seems to have been mostly about porting. I’ve not really developed anything new, but I have learned a lot by moving things around between machines. Yesterday I was a little disappointed with the un-tuned performance of the FFT code I had found and got running on the Freescale Freedom KL25Z, so I decided to …

Continue reading ‘Porting (FFT and traffic lights)’ »

First trial of fourier transform on a KL25z

Progressing with my attempt to record and process ultrasonic sounds, I have spent this evening with a trial version of a fast fourier transform (FFT) on the KL25z ARM board. My hope is that if I can get it running fast enough and well enough, I can offload that part of the work to this …

Continue reading ‘First trial of fourier transform on a KL25z’ »