LED based lighting at home? Yes!

When I was looking for some lamps for my new home I noticed, that barely no LED based lighting products are available for serious lightning at home. Those available seem to be more like decoration. Therefore I ordered a LED panel in the internet. It has 600 LEDs and the color temperature is 3000 K.

In my opinion the panel emits a delightful bright light, which is even energy saving.

From left to right: The room with daylight; LED panel with daylight; LED without daylight

using Apple’s Wireless Keyboard with an iPad

I bought an Apple Wirless Keyboard today. It uses Bluetooth to communcate and can so far as I know also be used with ordinary windows computers. First, I paired the keyboard with my iPad. This procedure is very simple. Switch on the keyboard and then go to the Bluetooth settings in the iPad. There, chose the Wireless Keyboard. The iPad will then display a code you have to enter in the keyboard for creating the first connection. Just enter the pin on the keyboard, even if there is no actual feedback when entering a number.

Pros:
I really like the keyboard for typing. I think it is developed thoughtfully. So it allows very fast typing.

Cons:
As the keyboard is somewhat unnatural for the touch-controlled iPad, it offers only a few extended usabilities like shortcuts. The only buttons working reliably are the brightness and the volume controls as well as the play/pause/forward/previous buttons. Don’t expect the keyboard to provide any further functionality as cmd-t for tab creation or refreshing in Safari! Furthermore, the Bluetooth connectivity uses a lot of battery.

program AT90S8515 with AVRISP mkII

The AVR ISP mkII does not support the AT90S8515 by default for programing. There s a simple workaround for that:

Go to the path where your Atmel stuff is installed. In my case it is:

  • C:Program Files (x86)atmelAVR ToolsPartdescriptionfiles
  • Look for the file AT90S8515.xml
  • Locate the <ICE_SETTINGS> part and change the <MODULE_LIST> to [SIMULATOR:STK500:STK500_2:AVRISPmkII] and add a empty <AVRISPmkII/> node like this:


<ICE_SETTINGS>
<MODULE_LIST>[SIMULATOR:STK500:STK500_2:AVRISPmkII]</MODULE_LIST>
<AVRISPmkII/>

embedded stack collision with the variable-memory

There was a strange bug I found which took me ages to find. I was implementing some stuff on a Atmel A90S8515 microcontroller. This device is quite old and has very limited memory. Both Flash and RAM. The problem occurred when sprintf from the standard library was called. When called,  any internal variables were changed (seemingly randomly). The only reason some I figured it out was because there was a soft-PWM implementation, which changed the color of a RGB led. Reading trough forums I found out that the sprintf-function is quite memory consuming, therefore uses a lot of stack related memory. As a heap is not existent (there is no dynamic data), a good reason for the strange behaviour might be the stack colliding with some global variables. Luckily, this hypothesis was underlined by this article. Therefore, what happened is, that the execution of sprintf (consuming lot of memory on the stack), overwrote global variables in the bss and or the data part of the memory. As the compiler is not able to find these kind of bugs, there is no warning or whatever. The solution was found within seconds. Some very large send/receive  buffers (defined as such in the initial phase of  the project) were just re sized from 128 bytes each to 32 bytes each, making more room for the stack!

my atmel microcontroller is continuously reseting

A problem I had multiple times was: I reuse software from the internet, but when i use the software / simulate it, it is constantly resetting! The reason why this is happening is (or can be) undefined reset vectors. This means, the hardware raises an interrupt, which is not hadled by your software. Therefore, make sure that all interrupts which might occure are written in the software, like UART, ADC, etc. related interrupts! Sometimes you just need an empty interrupt service routine:

The avr-gcc compiler will default your missing vector to the reset-vector, as it is a sign of buggy code! Another approach is to us a “catch-all” interrupt vector

which catches all undefined interrupts.

switch off cpu cores in ubuntu/linux

For some benchmarks it can be important to have a system operating on just a specific number of CPU cores. To find out how many you have, just count them by:

Switching a core off is just as easy as

which would switch off core 7.
For simplification, i got a shell script for activating/deactivating the cores 2 to 7 on the console (file is called “multiCoreSwitch.sh”:

Which then can be called by:
Switch on:

Switch off:

For checking whether the cores are running or not, run “top” and enter 1, for toggling the cpu view.

simple digital clock based on PIC 16F628

This is a small project i did several years ago. The board basically consist of 4 7-segment displays some resistors and 4 transistors and last but not least a PIC 16F628. This microcintroller from Microchip was my favourite one because they are robust and easy to use. They can be clocked using an internal clock such that no further external components are needed. Well the price of that is the relative imprecise clock.

pic clock

The probably most interesting part of the project was the multiplexing of the 7 segments. One might think we need 4 x 7 (omitting the dot) = 28 ports of the microcontroller to control all digits. The cleverer way is to use multiplexing. The principle is: Switch on the first 7-segment LED and make it display the correct number (/character). Then switch the first one off and switch on the second one and surely make it display the correct number. And so on. Now if this is done fast enough, the human eye is not able to see these changes and acts therefore as demultiplexer. This type of control is the reason of the 4 transistors. They are in charge to switch on the particular 7-segment display.

The programm code is very easy. Having a variable for hour, minute and second, every second the second variable is increased and if it is larger than 59, set it to 0 and increase the minutes…. Then go to sleep for somewhat of one minute and the repeat. Everybody knows how a clock works.

As i used the internal clock source, the clock was not very precise, sinc the “speed” of the clock is a little bit dependet on the temperature (and may be other things). Also the contrast of the 7-seg display is not very good. I did not calculated exact values for the resistors. I just estimated them roughly.

For details, check out this website: sprut.de (Only german. In my opinion one of the best references on Microchip PICs!)

Motorized kickboard

How to pimp a kickboard?

Take a two ps two stroke motor from a handy lawn-mower and some pieces of metal and welde it all together…

Did it work?

Well no. The conversion from the motor to the axis of the small rear-wheel was not done thoughtfully. The motor is fast but not powerful, therefore there’s not enough torque to accelerate the vehicle with its driver… At least it was noisy.

Motorkickboard