Archive for the ‘Programming’ Category

Let’s celebrate Apollo XI !

I remember very well the 20th of July 1969… I was in a holiday camp and the director had the bright idea to get a portable TV set, to power it with the battery of his car and he managed to have as many kids as possible watching this event. At this time, I had […]

Date and time serial: how to bypass the lack of precision of floats

Data type is probably the first concern for any new programmer in c/c++. These language require in minimal knowledge about integers and floats (Check this thread). Although these data types look familiar to all educated people, the principle of significant figures, which should be the universal way of formatting data, is, most of the time, […]

Code documentation (Part 1)

Part 1 Writing code is awesome. Have you ever compared coding works to the work of the potter ? He starts with a piece of clay, shapes it , refines it up to the final object. None from its production is fully identical to an other. Same thoughts apply to the coding works: the language […]

TASCAM Sound Recorder (Part 4)

Part 1, 2, 3, 4, 5 And here is the driver code. Nothing exceptional just plain good’ol arduino code. Check the writeByte function which contains few tricks and optimizations that are mandatory to achieve a proper timing. Ultimately this code contains a pretty versatile bit-bang UART writer that you may want to reuse in various applications. […]

Retour vers le futur

Allez, zou, pour une fois voici une publication en français ! Cà fait un moment que çà me grattouillait le clavier de composer dans ma langue maternelle, et je vois au moins deux bonnes raisons de faire une entorse à ma politique de publication. Soyons réalistes, l’anglais est une langue universellement comprise par les technophiles, […]

FN-M16P MP3 player (Part 2)

Part 1, 2 As seen in the previous post, the MCU (e.g. arduino) and the module are talking each other through a serial communication (UART) at a quite modest rate of 9600 baud. Data is exchanged as packets of 10 bytes according to the following structure: Byte# Function Value Comments 0 Start Byte 0x7E constant 1 […]

Metal detector (Part 1)

“Dear cousin, I lost my keys in the middle of the meadows, would you please make a metal detector for me ? Urgent !“ This is really how this project started ! More or less, as I have in mind the design of an Earth’s Field Nuclear Magnetic Resonance spectrometer which features magnetic fields sensors on […]

Direct Digital Synthesizer (DDS) (Part 7)

Part 1, 2, 3, 4, 5, 6, 7, 8, 9 A recent project lead me to excavate a quite old DDS design which may be of some interest for you. Instead of using a ladder of resistors, this design features a simple, cheap and yet powerful digital to analog converter. I will later explain why I choose this particular Microchip circuit but for […]

Stepper Motors (Part 8)

Part 1, 2, 3, 4, 5, 6, 7, 8, 9 This post is about driving multiple stepper motors continuously sweeping various ranges of steps at various speeds. Each motor features a permanent sinusoidal motion (accelerated and decelerated). The complexity of the code lies in the next requirements: Each motor has its own sweeping frequency, its own full swing range (number […]

Simple command parser (Part 2)

Part 1, 2 In the previous version, the command parser is using one single alpha character as an opcode while the argument is computed on the fly using simple arithmetic. In this version, the opcode is extended to (almost) any number of characters and the argument is stored in a vector which is then converted […]