Jkx@home Titanium Exposé

Jkx

Welcome on my website.
I hope, you enjoy your trip. If you want to contact me, check the about page.

Howto use AVR Dragon Jtag on Linux (Avarice + avr-gdb +DDD)

I bought a couple of months ago a little AVR Dragon card. My initial plan was to use it for debuging programs with the embbeded JTAG. But I run into several issue with that, mainly because the lack of doc on this topic. So, here we are ;)

The AVR Dragon is nice because you can use it as a small developpement device without any other requirement: Simply drop the needed ATMega on the board, some little wrapping for : Jtag + power supply.

As you can see, this is compact and nothing else is needed. The power supply come from the USB port, and I soldered a DIP on the board.. and that’s it.

I use the Jtag connector, so now I can use a real debugger instead of playing with the UART. Simply put a breakpoint, and enjoy :) By this way, I figure out that most of the time I simply push some stuff in arrays, and inspect them with debugger. This is really efficient. For example, last week I need to fix a timing issue with a IR sensor, simply wrap the little board, and push all interrupts in a array with the related timing. Of course, this can be done with a serial connection too, but it will take more time, and even worst if you encounter a bug, you will have to find where is it (the UART printf, or the code itself) ..

So, how to use this with a Linux OS ?

First you need to use AVaRICE to program the ATMega with a command like this :

avarice -g -j usb --erase --program --file main.hex :4242

Here the result:

AVaRICE flash the hex file to the ATMega, and wait for a GDB connection on port 4242. GDB is fine, but not really visual ;)

Let’s take a look at DDD

To use DDD with avr-gdb (the gdb for AVR), you need to edit a config file, for example gdb.conf and put this in :

file main.out
target remote localhost:4242

And the final command, just launch DDD like this :

ddd --debugger "avr-gdb -x gdb.conf"

Next step: Simply place some breakpoint, and the press “Cont” inue button in DDD. Et voilà :

I hope this little tuto will help people looking for a nice AVR debuger for the AVR on Linux (or any OSS system). The AVR Dragon is definitively a must have for low budget user in AVR scene.

Enjoy bug ? :)

admin November 30th, 2008

Nvidia 173.14 xrender benchmark

In a previous post, I looked closely the way nvidia binary driver works. In fact, like a lot of users I run into issues with firefox and other software which use Xrender extension to display stuff. A couple of day ago, Nvidia released a new version of its driver. They claim the future version fix the Xrender lag, so I decided to run it toward my previous bench results to see if current version change anything.

So the configuration is the same:

  • Nividia 173.14.12 kernel 2.6.24 and a Q6600

First, I need to say that in the default setting the new driver doesn’t work really nicely. It’s look even slower than previous in the default configuration. So for the first time on this bench serie, I tweaked the InitialPixmapPlacement and set it to 2. In my previous bench batch, doing this tweak products bad result so I disabled this option, but this time the drivers is so slow that without this tweak the benchmark would be useless.

Ok, let’s go for the results:

First, we can see clearly the new version is really better on some points : PictOpClear is the best result. We can see the nvidia team has really work on this, and the result even outperform the ATI driver. On the other side the PicOpt[Con|Dis]jointClear is still very hight.

For the rest of the test :

To things, on quite all the result the new driver is slower than the previous on (perhaps this is a InitialPixmap side effect), but the difference isn’t really big 0.5 sec on a test which is far from 0.5 at the end.. And the ATI still outperforms clearly the Nvidia here. In fact Nvidia driver’s team claim this primitives are never used (or should be). From what I know right now, some software use this primitive. It’s look like KDE (via QT) do. Apparently Nvidia team asked the KDE dev to change their code to achieve better result on Nvidia cards … Anyways this is perhaps not the best way, but we need to wait for KDE dev answer before going foward.

The second important thing is that PictOpConjointXor has now a 0 result.

As you can see on this benchmark, the new Nvidia driver seems to perform better than the previous one. On the user perspective, it’s look like the fixes applied for PictOpClear (and perhaps PictOpConjointXor) produce some great results. Right now Firefox perform nicely, and the whole desktop is fine. I’m quite sure their is still room for improvements (look at the open source Intel driver results for PictOpOver PictOpIn…, you will see binary drivers are far from the OSS results), but this release is the first for the 8xxxx serie which perform at a decent speed, and this is a good new.

Thanks again to my friends who send me their own results to compare, and to people on various forum that helped me on this stuff.

admin August 2nd, 2008

SMD Soldering on the cheap

Like a lot of hobbits, I don’t really like to solder SMD. It’s hard to solder with a normal soldering iron (even this can be done), and hot air soldering station cost a little. (around 180 Euros shipping included)

I already talk to my friend Bernt about this. He says he already used a cheap gas hot air gun with good result. Ok, he isn’t really an hobbist, and have a professional soldering station at work, but …

Tomorrow morning, he was waiting for me at my work, and gave me a gas hot air gun (plus additional soldering tip) ..what a great a present ! Thank you guy. In fact, they just started to sell this cheap stuff on their shop: Splashelec.

Fine, so it’s time to give it a try no ?

Hum, guess what, I don’t have any electronic flux at home. In fact this cost too much too ! (and you can’t stock it for a long time..) but I have some plumber paste on my desk. I use this stuff for wifi antenna not electronic but it should be fine.

Simply apply the paste with a brush and use the iron to melt it a bit. As I’m new to hot air soldering, I decided to use a normal iron to do that. Next step remove the surplus with some water. In fact, you can use a normal solder here, but using the paste is a bit easier to apply …

Ok ready to play ! Fire !

And the final step, place the chip on the board. Mount the heat blower on the gun and light it. Set it around the max temperature, and gently approach the chip pins. Don’t be afraid to take your time, chips are made for a reflow process, so they can handle hot air without too much issue.

Here’s the result

Fine no ? ;) The soldering is quite perfect, it’s my first time with an hot air soldering gun so.. but I’m really happy. It’s really easier than a normal soldering iron.

admin July 9th, 2008

2D benchmarks on Linux Nvidia, Intel, ATI: xrender

For my new computer I bought a ATI HD 2600 PRO with a bunch of memory. This card has some really good 3D results, and works well on Linux. But I run into some issues with de xv extension on this board. In fact the driver (the free or binary one) doesn’t seems to support sync on vblank. So when a app try do display datas on the screen, some image destructions appear. This mainly occurs when I’m watching videos but in 3D games too. This is a really stupid bug or mis-feature. How can a serious video programmer can do that ?

After a couple of month, I decided it was enough, I was sick of this dirty stripes on screen. I tested every ATI driver one after one … (ATI opensource drivers have too bad performances to be used on a every days desktop, could you live without google-earth ? ) .. so I decided to go to other side, and bought a Nvidia 8600GT from ASUS. This card perform quite as the ATI in 3D, and have a affordable price. So I switched from ATI to Nvidia.

ATI offers better opensource support, but Nvidia binary driver is really nice to use and have better support today from stuffs like Compiz and Co.. and NO MORE STRIPES !! :)

A couple of weeks ago, I upgraded my Ubuntu Gusty to Hardy. Everything was Ok, since I played with firefox. Some heavy loaded pages (like Amazon, or Gmail) was damn sloowwwww ! Playing with scroll was a source …… grrrrrr ….Firefox on Hardy is 3.0b5. This version has a major “feature” the use a Xrender for the page display. And this looks like Xrender is dawn slow on Nvidia cards .. In fact, Nvidia has already work on this kind of issue before. Without looking forward I decided to run a little benchmark, with the help of friends with Xrenderbenchmark. So here the results.

Benchmarks

Benchmarks was done by me and 2 firends, on Q6600 or E6600 Intel CPU running at 2.4Gh, with kernel 2.6.24.1. The graphs only show the Plain results (not Plains + Alpha, or Transformation) but the results are quite the same anyways.

Legend:

  • 8600GT/nv : Nividia 8600GT / Xorg 1.4.1git 32 bits / Nvidia GPL driver
  • 8600GT/nvidia : Nividia 8600GT / Xorg 1.4.1git 32 bits / Nvidia binary driver ver: 169.12
  • 8600GT/nividia-64 : Nvidia 8600GT / Xorg 1.4.1git 64 bits / Nvidia binary driver ver: 169.12
  • Intel GMA X300 : Intel GMA 3000 / Xorg 1.4.0.9 64 bits / Intel GPL driver
  • ATI HD2600PRO : ATI HD 2600 Pro / Xorg 1.4.1git 64 bits / ATI GPL driver

I split the results into two graphs for convenience.

As you can see on this first part, numbers are really small, the Nvidia GPL driver is the worst : 5 times slower than any other one. Not a good news, and the binary one have some bad results on 2 tests. ATI HD and Nvidia drivers offer quite the same results, but remenber this is the GPL ATI driver ! … The Intel doesn’t have a lot of linearity on this part.

But the next graph give us absolutely different picture !

For every graph, Nvidia drivers (GPL, or binary, 32 or 64 bits) are at least 6 time slower. Intel perform very well, no surprise, this card are damn cool, perfect driver for linux.. but to slow in 3D to really rock. And ATI GPL driver is the clear winner of this benchmarks tests.

As my issue is the Nvidia one, I can comment the results, the GPL driver performs better than the binary one. This is not a big surprise cause, I can see it in Firefox, even it’s slow. There is difference between 64 bits and 32, but I guess this is more kernel related than the driver itself.

I’m not a video guru and only do that figure out what’s going on my computer. I publish in the hope it might help somebody else, and to find help.

Update : The numbers can be found here

Thanks to Ludo and Christian for their help !

Important update : Check the new driver results !!

admin May 17th, 2008

Howto repair a broken USB flash drive

This is not the first time, I break a USB Drive. And I already heard some people complaining about the same stuff. But how is this possible ? Even if I use it a lot, memory and micro-controller are robust you know, no special reason for a failure (except of course some anormal write, but this is not the case here)

I decided to open this little key, to look closely. After a quick look, I didn’t find anything. So this little PCB stuff was laying on me desk, and people play with it. After a couple of weeks, I discover the memory chip is simply de-solder. My friend at work play so much with it, the failure is now apparent. Nice no ?

Hum, this little TQFN chip will be hard to solder, that’s right. But this is do-able no ? I tried this with a small soldering iron and here the result:

And yes, the key works fine right now ;) That’s fine no ? I definitively won’t trust this drive enought to store important document, but fine for a couple of mp3, or other..

admin April 30th, 2008

Gkrellm Theme : Invisible by Jkx

I’m using Gkrellm for a long time now (perhaps 5 or more years). The main issue with Gkrellm is that theme aren’t really fresh anymore. So I tweaked some to feet with my needs.

As you can see on the screen-shot this theme is a transparent one, with a blue and violet krells

You can download it here : gkrellm-themes-invisible-jkx

/ Enjoy the dark side of the desktop :)

admin April 26th, 2008

Howto install KDE4 on a Ubuntu 8.10 (or 8.04)

Today, it’s the time to switch to the next Ubuntu version. One interesting stuff in the latest distro, is the KDE4, but by default you still get a 3.5.9 revision..

Here a little tips to switch easily:

First uninstall the previous version

sudo apt-get remove --purge kdebase-bin-kde3
sudo apt-get autoremove --purge

Install KDE4

sudo apt-get install kde4

As you can see, this is not really hard. The trick is to remove the old version cleanly.

Enjoy ?

admin April 19th, 2008

Switch to wordpress

During the last rescue of this website, I ran into issue. In fact my old blog engine (Alinea) was buggy due to a lot of changes in SQLObject, Webware and docutils. I was sick to patch this days after days to maintain this. I decided to switch to a plain-old-fashin php install.

Thanks to AlineaObject lib, it doesn’t take me too much time, to do the job. I still need to fix some stuff (mainly the rewrite rules), but this look fine. I switched to Wordpress. Of course I lost a lot of functionalities of my initial setup, like the Anti-SPAM feature or the ZPT template engine, but right now I get some more stuff.

I already switched 2 times before (Moveable Type, Alinea ..)

The migration works lilke a charm right now, feel free to post if you have some issues.

admin April 13th, 2008

Lumex Graphic LCD 128×64 (S12864GSF) + AVR (Atmega32)

I recently bought 2 LCD from jckrers ebay store. I have a good idea for this stuff, but first I need to run several tests. This LCD are fine and use the common KS108 controller.

My first thought was to use the avrlib, so I wired the LCD and started to use avrlib, but I quickly run into issues. In fact, I want to use some icons on, and the avrlib seems to be buggy.

After a little compile/test/run/compile, I remember an old post on a website about KS108 chips. I find it back, it’s on the science prog

This is really great, you can build some custom fonts easily (that’s exactly what i’m looking for)..

Here a couple of pics…

http://jkx.larsen-b.com/photos/AlarmClock/DSC02817_003.sized.jpg

As you can see, I use a ATMega32 (on a futurelec card), a simple pot for the contrast, and the lumex.

http://jkx.larsen-b.com/photos/AlarmClock/DSC02816_003.sized.jpg

I can use a mix of different fonts on the same screen.

And I can even display some pics too :)

http://jkx.larsen-b.com/photos/AlarmClock/DSC02820.sized.jpg

Here the famous tux.

I still have to deal with menu and other stuff, this should be a little harder than expected, but will be nice. If somebody know a good library to use on a T6963C, please post a comment..

For users who wants high res pics, you can find them in my gallery (as usual).

admin March 24th, 2008

MP3 Bitrates compared

A lot of people use some mp3 files right now. I decided to take a look at a spectrum analysis of a sound file at different bitrates. The result is really something, I doesn’t expected..

The original wave file is a radio (FM) recorded… I chose this one, cause this radio have a big noise on the upper part of the spectrum.

Original:

http://jkx.larsen-b.com/photos/blog/spectrum_original.png

b = 128

http://jkx.larsen-b.com/photos/blog/spectrum_128.png

b = 192

http://jkx.larsen-b.com/photos/blog/spectrum_192.png

b = 224

http://jkx.larsen-b.com/photos/blog/spectrum_224.png

Variable bitrate

http://jkx.larsen-b.com/photos/blog/spectrum_variable.png

What we clearly see, it that mp3 encoder (lame here) use a expander, and this is quite a good stuff. I think I should have normalized the input.. but..

After that point, we clearly see it cuts the around 16Khz, I know that my computer system isn’t able to achieve this level, but my stereo system can.

First results show that Ogg give a better results but this is for a future post.

Enjoy sound

admin November 3rd, 2007