Archive for November, 2007

ATMEGA USB 11

Saturday, November 24th, 2007

There are lots of “rainbow LED” projects in the internet. So, I decided to place something similar in my weblog.
There are 4 hardware PWM outputs in ATMEGA16. So do not need to build fancy software routines to make pulse width modulation (PWM) by software. Just define PWM output in the chip and forget. Other chips may have less of more PWM outputs. Just check the data sheet.

I am using 3 color (tricolor) LED form some cheap flatbed scanner. This LED module is very good because it is small, all LEDs are placed on same chip. Also it is very easy to solder it. Also, I guess, that light power of LEDs are compensated and equal to current. I think that if I pass same currents in all three diodes I’ll get white color, no need to adjust tint (hue) of the output.

RBG schematics

Circuit diagram is very simple- diode module, three 470 ohm ballast resistors. Everything is connected to my experimental PCB. OC0 is connected to “firmware” connector, OC1A, OC1B and Vcc can be found on LCD connector.

PWM RGB

Here is the image of working device. Sorry for the quality, my digital camera is not making good images of bright light sources (diodes from scanner are very bright, they are used to light whole scanned line).

Here is short move made by same digital photo camera. Sorry, but the colors are ugly. In real world is full rainbow on your desktop.

Firmware is very simple. It is using “0″ timer as interrupt source and also it is the clock for zero PWM channel. So I can’t make timer 0 very slow- with lower frequencies the LED is flickering. So I placed extra calculations in interrupt routine to slow down main color cycle. Other two diodes are connected to timer 1 output.

All the math is made in two procedures. They calculate “H” (hue) value calculations to RGB output values. My H2RGB procedure is identical to MS paint color palette picker (with fixed other values).

Source code: 20071101.zip.

ATMEGA USB 009

Tuesday, November 20th, 2007

Blog entry 008 is not working… so here is 009

I installed electronic lock with Dallas (Maxim) i-Button chips. It was very simple, low security version of electronic lock as it uses DS1990A chips as the keys. Original lock was made using PIC mcu (the smallest available) and 24C16 serial eprom to store key numbers. I programmed the lock and read chip contents. I found same numbers in eprom as numbers engraved on key. After reading the datasheet I discovered that these chips are not good for real security keys as they don’t have any security features. It is simple serial rom with CRC, and only nice feature that it is using one wire for data and power transfer.

I decided to make few experiments with these i-button chips and to write so software for AVR. The problem is, that there are lots of software for 1 wire protocol, but most of software is based on commercial AVR c compiller with build in 1 wire functions. I am using free GNU C compiler and I need to find software for all 1 wire stuff. I spent few hours searching internet and at last I found it.

The hardware is very simple- I used my AVR USB board with LCD module. I connected i-Button to my “firmware” jumper. The only modification is 4.7K pull-up resistor.

i-button avr

The LCD module is displaying various information about connected i-Button. Top left corner is status. Possible information: OPEN, SHORT, OK and ERROR. Top-right is CRC read from chip. In source there is CRC recalculation routine to check it (untested). Bottom left: device family id. And last and longest number is 48bit device serial number. Same as number on the metal can of the chip.

i-button avr

Source code: 20071027.zip

There are more functions in source code. I am using only minimal set of possible features.

Now you can build your own security lock, the only problem is, that Dallas ID chips are not secure. I think it is possible to build emulator for Dallas i-button chip and program other serial number. Dallas is not responsible for this as this chip is not intended to use as the key:

The DS1990A Serial Number iButton is a rugged data carrier that serves as an electronic registration number for automatic identification.
…allowing the DS1990A to be used easily by human operators. Accessories permit the DS1990A iButton to be mounted on almost any object, including containers, pallets, and bags.

I think that this “commercial” lock is cheap alternative for very low security door lock.

Dolby digital in cinema

Saturday, November 17th, 2007

Some time ago, I tore a piece of cinema film from local cinema theatre. The movie was some dark work, about vampires or something. Recently, in wikipedia I found article about Dolby digital encoding on the film tape.

Dolby Digital 35mm

I found my film strip and checked it for digital data. Under microscope I found dolby digital data encoded in matrix bar-code between perforation. Also, I found three additional low rate digital data tracks. There is no data what is encoded here. In wikipedia example there must be analog channels…

Dolby Digital 35mm

I made the photo using small microscope with 25x magnification. Width between two graduations with numbers are one millimeter. You can see Dolby Digital logo in the center of dot matrix . Last image is borrowed from wikipedia:

DD is Wikipedijos

HDTV

Wednesday, November 14th, 2007

HDTV, hdtv… whattheheck is that HDTV? Here is some screenshots to describe the size of unscaled HTDV image. You don’t need to know about pixels and lines, do not need to describe difference between 720p and 1080i… Just look to the image and find little windows start menu gadgets on the bottom of the image.

HDTV
HDTV
HDTV
HDTV

And some unscaled piece…

HDTV

Attenuator

Monday, November 12th, 2007

Oh, it is great treasure. I’ve made sweep generator, but I didn’t build any attenuation device for it. I’ve tested regular carbon variable resistor, but the output was too noisy. I’ve also tested high resistance wire wound variable resistor, but the inductance was too high and the attenuation in higher frequency was horrible.
By a chance I found very old (~1964) sweep generator made by some USA company. It was full tube design and not working and partially disassembled. But I was in luck and original attenuator was intact. Also, the device as build in stand alone version- two solid metal cans with BNC connectors. The only problem was t find some inch-based, American tools to unscrew all nuts. I live in normal world where metric system is used.

attenuator

These two metal cans are stepped variable resistors. But they are calibrated and designed to work in wide frequency range. One attenuator is for tens of decibels and other for apiece (ones). Smaller one has 0, 10, 20, 30, 40 and 50 dB attenuation and bigger one is in full scale from 0 to 10 dB and one very useful position- open circuit.
The device is very solid, very well build and working without any glitch. And device is about 43 years old!

ATMEGA USB 007

Wednesday, November 7th, 2007

I’ve already mentioned that I have small problems compiling Windows executable from source code. It is maybe my compiler’s problems. Maybe it is some strange version build or bad crack :) . I was using Borlan Delphi Professional, Second Edition v7.2, Created 2006 by Lite Application.

After some experiments I managed to solve the problem is some strange way. It is just some workaround, not real problem solution. I am not Borland guru, but after I added some useless lines to source code the program is working fine. Description of changes are in source code and “readme.txt” file.

Here is modified USB-LCD software for windows with source code for Borland Delfi 7. It is working on my computer with WinXP Pro SP2, and P4HT hardware: 20071007.zip.

23 inch screen

Saturday, November 3rd, 2007

I’ve tested 23″ Apple Full HD wide cinema monitor. The difference in size compared to standard 17″ LCD monitor is not very big because width and height (aspect) ratio is different. For standard, old, LCD it is 4:3, while Apple monitor is 16:9. Width of monitor is measured in hypotenuse and the jump from 17 to 23 give us only ~1 inch gain in height (~7″ in width).

Full HD monitor

Native resolution of the monitor is 1920×1200 pixels. This is enough to display full HD 1080p standard images.

Full HD monitor

The resolutions enables to play HD movies in full resolution without any software tricks and resizing. The quality of the monitor is very good- not speaking about possibility of dead, stuck or hot pixels. Back-lit of the matrix is smooth and even. One very good feature used in Apple monitors is that all the wires are combined to one. So, USB, 1394 (firewire), video (DVI) and power lines are in one single chord. No more spaghetti on your desktop. There is USB and 1394 hub on monitor- no need to search empty slot to connect your USB flash disk, DV camera or 1394 hard disk.

Full HD monitor

Such big screens give us lots of space on the virtual desktop. We can place lots of icons and gadgets on the screen. The only problems is that when more icons on the screen, then more lag in the windows. Also, when there are hundreds of icons on the screen it is very difficult to find needed on. Wide screen is useful not only for HD movies, but in spreadsheet calculations or programing in MS Visual Studio. Especially in new versions- MS added many useless color borders in serious work software. I thing that Bill is still stuck in color crayon shop introducing WinXP and now he discovered aquarelle (water colour) department with his Vista windows. Working with Adobe products are fine too, but better is to use dual monitors for this.

Full HD monitor

There is small problems using big monitors in modern internet pages- there are many pages with static width design (my wordpress template is static too :) ) and such web pages looks very ugly when opened in full screen mode on such devices.

There are lots of white space for notes in these web pages :)

Cool resistors

Friday, November 2nd, 2007

I found very cool resistors in old equipment. They are very nice design. The values are almost unusable in our days, especially in hobbyist works, but resistors are very nice. Resistors are inside glass tubes. The resistance is very big- it was some timing selector in old scientific equipment.

The value are in quite strange line: 316.2MΩ. Yes! It is three hundred sixteen millions, two hundred thousand ohms. All other resistors are similar, it differs only in tens: 312.6, 31.62, 3.162M. Less the value, more precise resistors are. 3MΩ is 0.5%. Glass ones only 1%.

resistors

Resistors on other switch are: 316.2M+0.00068uF, 100M+0.0022uF, 31.6M+0.0068uF, 10M+0.022uF and etc.

resistors

The device itself was made using mixed technology. Mainly using discrete resistors, but high voltage part was made using electron tube. The print on the tube is: VICTOREEN 7234, CLEVELAND, MADE IN USA. Tube is made circa 1970. The tube was regularly checked as it is many handwritten numbers on it.

The tube is older than me :)