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: (Only german. In my opinion one of the best references on Microchip PICs!)

get sun java on debian based system

just type:

xsl transform template for php5

Stress-testing your website or put your website under siege

Sometimes one just want to check the stability of a web application under heavy load to check whether all ressources are sufficient or just for finding the limits of a webserver. This especially applies if you have some fancy backend calls assoiated with a HTTP request. A small Linux utility named “siege” helps you make your life easy. Just set up a textfile with a newline spaced list of urls you wanna hit and invoke “siege” like:

The urls in the file named “urls.txt” are hit randomly (parameter -i) for a time of 10 minutes by 10 concurrent users. The urls.txt file also allowes POST requests, which can be used to actually do e.g. a login on a webpage.  At the end of the test you’ll get a report like:

Transactions:                9438 hits
Availability:               93.39 %
Elapsed time:             1800.02 secs
Data transferred:           63.79 MB
Response time:                9.82 secs
Transaction rate:            5.24 trans/sec
Throughput:                0.04 MB/sec
Concurrency:               51.51
Successful transactions:        9439
Failed transactions:             668
Longest transaction:           34.06
Shortest transaction:            0.32

From which you can conclude the strenght of your system. The probably most important value is the availability! Everytime a site was not loaded (timeout in connection), a customer was not served in time. A DOS attack tries to minimise this value!

syntax highlighting with WP-syntax

WP-Syntax highlights your code embedded in your posts. It supports a wide range of languages! Do not forget to embed the <pre/> node in HTML rather than in Visual!

abap, actionscript, actionscript3, ada, apache, applescript, aptsources, asm, asp, autoit, avisynth, bash, bf, bibtex, blitzbasic, bnf, boo, c, cmac, caddcl, cadlisp, cil, cfdg, cfm, cmake, cobol, cpp-qt, cpp, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, bnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8, pascal, per, pic16, pixelbender, perl, php-brief, php, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xml, xorg_conf, xpp, z80

Get it here: WP-Syntax

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.


WordPress installed, blog opened

My first blog entry. Just managed to install wordrpess. It is not that easy as they claim…

For mobile blogging, they provide a iPhone application. It requires the actiavtion of RPCs. Not tested yet, but seems to work.