Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts


Atmel Studio 6 and blank Solution Explorer

Atmel Studio 6, which is (ununderstandably!*) based on Visual Studio (2010?), suddenly stopped showing anything in the Solution Explorer pane.
The pane was there, it just remained empty, blank, apart from the "Properties" button (and the "Show all files" button shows up too, depending on the frontmost pane).

Using Atmel Studio 6's Projects for libraries

Long story short: Atmel Studio's inflexibility forces quite a strict isolation, which forces you towards the purist side (potential advantage) and makes compile-time library configuration very difficult (clear actual disadvantage). So it's not a very clear win - though I am rather liking it.


Taking a snapshot of the ports in an AVR (AT90CAN128)

A small inline function to take a snapshot of all the ports as simultaneously as possible, which means 7 cycles from first to last, which means less than 0.5 usec from first to last at 16 MHz. Can't be faster.

Had to be done in asm inline because if not gcc prefers to interleave the input instructions with store instructions. Done this way, the inputs come first and the storage comes later, generated automatically.


Memory access stride in loops change loop timing in AVR C!

I found a strange situation when programming in C for AVRs. I have a bunch of structures to be worked on, but any of them can be flagged "active" or not at any given moment, to signal whether they need further work. My first approximation was to add a (uint8_t volatile: set in main, checked in interrupt time) member variable named "active" to the struct, to quickly check/set each structure.

Shock: only looping through the array checking the "active" member variables was taking an enormous amount of time – about 20 clock cycles per access!


Custom software for interfacing via USB with multimeters UNI-T UT81B

These multimeters are rather pocket oscilloscopes. Quite an interesting package. And the possibility of interfacing via USB with a computer should multiply the possibilities.

Alas, the included software could hardly be crappier. (why do so many manufacturers do something justifiably interesting and then neuter it by blowing up what should be a minor part of the whole?)


Mini-guía para crear ficheros RTF

Generar un documento RTF simple (sin tablas ni imágenes, por ejemplo) pero con cosas interesantes (fuentes, colores, párrafos, incluso estilos!) es muy fácil.

En inglés hay una pequeña guía en, pero no llega a meterse en estilos. También está la especificación completa del formato RTF en la web de Microsoft. Yo necesitaba algo intermedio, y no parece haber guías en castellano, así que aquí está lo que he aprendido y estoy usando.


Semi-automating piece-wise translating texts through Google Translate

I am having to translate a horribly old program (1992?, DOS' Turbo Pascal)… and in german, to make it funnier… to an only-slightly-less-horribly-old environment (Delphi 4, circa 1999). To think that I was complaining about how outdated Borland's C++ Builder 5 felt… oh my.

I guess/hope/fear that later there will be a more modern target. But that will be easy, given that by then I should understand everything and the program itself is not complicated.