There is special term- memory leak. What it is? Looks similar to brain leak, or that old joke from old zombie movie: brains brains…!
In real world, the bug in memory management is described as memory leak. Every program use some memory (RAM, Video RAM, virtual RAM) to store some data. In modern operating system, program must request from OS for some memory. After using it, the program must release the memory. But there are bugs in software, and sometimes requested memory is a bit more than released. There is not a big problem, if the program is working for a short time- after the termination of process, all allocated memory is released (unless the OS have memory leak itself). But some software is running all the time computer is on. Especially in servers, where uptime is calculated in days, months and even years.
So, one buggy piece of software is Bittorrent client. Here is the result after running it for some days…
This image is more informative… 1.3Gbytes (!) of RAM is quite many for background file transfer.
I was forced to build some VPN (virtual private network)… I examined all my available documentation, did all RTFM and consulted with some gurus from local unix newsgroup.
I selected first available VPN type: PPTP. I am using Linux Debian stable on local servers. As server is running for a long time, the system was “old" stable version. So simple command “apt-get install pptd" didn't work. There were lots of problems and missing components. So I selected other method- in some trash I picked up old Fujitsu Siemens computer. It very small, pizza box size computer with Pentium III cpu with integrated video, lan, sound and etc. I added two additional realtek ethernet boards to make “router" look cooler. If everything will be working fine, I'll transfer stuff to real server.
Here are just illustration: screenshots of WindowsXP VPN configuration screens.
I downloaded and installed latest stable Debian. It was “etch". All devices were installed without any problem. I installed only “base system" as I like to install all needed stuff by myself.
apt-get install mc iptraf lynx ssh
I like these programs, so I installed them. Especially “mc" as I love old style, norton-alike file manager. Read the rest of this entry »
From time to time I repair computer. Sometimes it is just software problems, sometimes- hardware. But some times it is dust problems. Dust full computer appears on my workbench very often, but I don't have my digital camera nearby to take a picture. Sometimes I open computer cases at client’s home and I don't want to take pictures…
But here is few pictures of real computer I repaired and short description of the problem:
This computer “was running quite fine, only few sudden reboots in a day". But when weather temperature raised because it is summer now, computer’s reboot become irritating and owner brought it to me.
This video card was working fine. No reboots or freezes. But how much dust it need to collect to stall GPU fan?
This Athlon sometimes freezes the computer. Especially when encoding video. Do you know why?
This video card (Radeon X800) was big secret for owner. He can't start video games. Few months ago all games were working fine, but after some time he could not start any game. In “2D" mode, you can use computer for weeks! We tried newest video card drivers, chipset patches, even reinstalled windows few times… I only removed dust clog and everything is working.
I was browsing in Internet for some information about LCD programming. It was regular web page about some bugs in LCD software. Suddenly I noticed that my CPU fan is running very fast, case rear fan started too I and can feel hot air passing from my computer. I tested CPU load and noticed full load from internet explorer! As my system is with dual core, the whole load was only 50%, but it is too high for simple web page with three (!) animated gifs. Here is the URL to this strange web page:http://www.lcdstudio.com/forum/viewtopic.php?t=10684
I have special utility to read date from my APC UPS. According to it (see the screen shots), my computer consumes about 267W of energy when showing simple animated gifs. On the right side image there is snapshot of “idle" computer- only Outlook express, Photoshop and other background stuff. So Microsoft is using up to 76W just for displaying some animated gif! BTW, firefox didn't use any extra watt for this web page- the CPU load is zero.
(Two images on one place.)
Here is screen shot of idle computer (google webpage display):
And here is mystical load when looking to animated gifs. I have dual core, so one core is idle. I tested this page at my workplace and single core computers were loaded to 100%.
Maybe Bill will fix it? I have some reports that new Vista windows have same bug. If you want to test this page, please set that this web page is displayed with all images visible, IE windows active. Please wait for a while to get full result- CPU load grows after some time.
I disassembled few batteries from notebook computers. There we some “economical" versions among them. Such “lite" versions are typical for “sales" version of computers- when the price is in matter. In notebook datasheet all working times are for normal batteries and with “no load" situations. When you buy computer on “sales" event, you'll receive “light" version of batteries. Here is few photos of open “lite" versions of batteries with small description.
Here is the 14.8V, 2000mAh version. Normal version in same box is 14.8V, 4000mAh. The capacity is halved. 30Wh versus 60Wh.
Here another version of lite cells. Our days the notebook computer’s hardware can work from “any" voltage. Switching power supply can drain power from any type of source. So, here is another version of lite batteries. User may learn to calculate capacity in mAh, but energy is stored in Wh. So we can leave SAME capacity, but reduce voltage a bit. In the top: 11.1V, 4000mAh battery. This means only 44Wh versus normal 60Wh.
Lower one is typical low capacity version with reduced Lion cells. Here is only some mystical high precision capacity 2000 v.s. 2150. The 7.5% means many when counting length of … but when it is capacity, this means nothing. They use special plastic tube spacers to reduce Li-ion cell wobbling in battery.
Both batteries have identical bodies. The marking on the battery is good. The manufacturer didn't lie here.
My computer’s printer port is only one and occupied by printer and JTAG hardware. And I needed more parallel port for my experiments. Something safe for motherboard and something wide. As I mentioned in previous post, one electronics company supplied me with some useless hardware. Each PCB board was with Atmel ATMEGA16 CPU (ATMEGA16 16AI). Also, in the internet I found some hardware and software projects by Igor Cesko…
First after few looks to source circuit diagram I made this experimental PCB.
There are only few components- ATMEGA16, 12MHz quartz, few resistors and USB connector. I changed a bit original software and adapter it to MEGA16 hardware.
Also I changed a bit software and firmware for more options and to access to all ATMEGA16 pins. Original software/firmware was for ATMEGA8 or AT90S2313. I was lucky and now I have new device in my windows hardware manager- AVR309: USB to UART protocol converter.
I downloaded Delfi7 to change dll and have big ideas to build new universal tool for my computer. Something with USB to I2C/parallel/serial and “I don't know what" adapter. The only problem is, that I am new to Delphi and Atmel assembler.
After few weeks of experiments and one dead FPGA chip I finished about 1/5 of my LCD project. At last I tuned all LCD timings and LCD screen can display image from “video RAM". For this moment “video RAM" is represented by flash ROM chip. At first I had lots of bugs (I've lost one byte of information, three lines were missing, the line in the middle of the screen, all screen moved one line down). One line down is not a but, but the feature of the LCD screen. It begins scan from the second line after HS.
Here is the image of my workplace (the LCD is with all the bugs): power supply (+5V and ~-15V), 20.48MHz master clock oscillator (the exact frequency is not essential- the clock is divided by FPGA), ATMEL 29C010A (as video RAM) and Altera FLEX EPF10K10TC144-3 FPGA. Red line on the breadboard is 47K pull-up resistors for data lines.
Here is bigger image of the LCD screen. As you can see the bugs are visible. One bug is from MS Visual Basic program- I've made mistake in image processing- lost one screen line generating video bitmap. In new version of software I fixed this bug.
Now I fixed the bugs (english blog is not realtime) and here is fixed image:
Now I need to change ROM to RAM and create some USB interface for my experiments. I do not want to use LPT port anymore.
P.S. That “angry horse" is from Japan animation “Words Worth". And he is most famous in an Internet fad for the quote, “Your resistance only makes my penis harder!". “Fad" is an Internet phenomenon occuring when something becomes extremely popular, often quite suddenly, through the word-of-mouth and self-publishing made feasible by the Internet.
One man brought small souvenir from China. It is cool 32Gb Sony flash disk. The only problem is that it is fake, and not such size. The device is made quite well. Solid box with all needed information. The device is looking solid too. The size is very big and the price was too small even for bulk nand devices of such size…
Before buying such device they even tested it. Windows disk properties reported big size. But buyer didn't think about copying big file to it.
Disk manager reported “proper" size too.
You can even copy big files to this flash disk. But you can't read. While reading, you receive read error. So this device is WOM DISK (Write Only Memory Disk)
Also you can't format the disk…
After some experiments I determined that this model was made with special firmware, and nand flash was very small and maybe damaged. I tested disk using block (sector) write and read and found only 0.5Mb of usable disk space. All other disk space is virtual and you can read &HFF from any location of the disk.
There are lots of warning pages in the internet about fake devices. Also, the eBay is full of such devices. So don't be greedy- you can not buy good thing for very low price.
Out tourists payed for this fake device about 40LTL (15USD).
As I mentioned in previous posts, one company supplied me by few Altera Cyclone II (EP2C5T144C6N) FPGAs. All these chips were soldered to some rejected circuit boards. Board were damaged by improper soldering, mainly by overheating and PCB track unstuck from the base. I selected one board with minimal visual defects. There is place for JTAG connector, so I soldered it, used 3.3V power mentioned in previous post and chip replied on the JTAG chain.
After few experiments and three kynar wires, I manged to set chip in JTAG programming mode and programmed small testing code to it. It is working and I hope that other chips are good too. In Lithuanian version of weblog I described how to set this PCB to jtag mode, but this entry is just for myself. If I'll need to use other boards, I'll have detailed instructions. English language reader will not find such PCBs in their local stores.
Thanks to local company for nice set of Cyclones and also, for about twenty Atmel ATMEGA16 chips!
What is Cyclone?
The Cyclone II architecture consists of more than 68K vertically arranged LEs, embedded memory blocks, embedded multipliers, and phase-locked loops (PLLs) that are surrounded by I/O elements (IOEs). A highly efficient interconnect and low-skew clock network provides connectivity between each of these structures for clock and data signals.
Area-efficient IOEs are grouped into I/O banks around the device, offering significant capabilities while consuming minimal die area. Cyclone II devices support a wide range of single-ended and differential I/O standards, such as the LVDS I/O standard at up to 805 Mbps (receive) and 622 Mbps (transmit). Each IOE contains three registers for implementing DDR applications and associated circuitry for other I/O features such as programmable drive strength, bus hold, and programmable slew rate.
Several I/O banks are equipped with dedicated external memory interface circuitry. This circuitry simplifies data transfer with external memory devices, including DDR2 and QDRII SDRAM devices. Maximum data transfer rates reach speeds of up to 333 Mbps (167-MHz clock).
Cyclone II devices implement the same embedded memory blocks available in the original Cyclone family. The Cyclone II family includes up to 250 embedded memory blocks, which are ideal for use as program storage memory for embedded processors or header or cell storage.
Cyclone II devices are PCI revision 2.1 and PCI-X revision 1.0b (Rev 2.0 mode 1) compliant. Each IOE provides multiple paths from the pin to the core, allowing the device to meet associated set-up and hold times.
Cyclone II devices range in density from 4,608 LEs and 119,808 bits of RAM to 68,416 LEs and 1,152,000 bits of RAM. From 13 to 150 18 x 18 embedded multipliers are available within Cyclone II devices.
As the flex was killed, I needed to test the Cyclone chip. But I need good 3.3V power supply for it. The core and PLL voltages are lower, but linear regulators were already placed on the PCB. The only good 3.3 source was computer power supply (ATX model), but it is too big, too noisy to be placed on my desktop. I was lucky and in trash pile with cyclones I found other PCBs- some with switched 3.3 (and other voltages) regulators and quite many Atmel ATMEGA16 MCUs. (Thanks for support!) More than dozen free ATMEGA will force me to use them .
So, I have quite big stock of LM2676S-3.3 chips. It is:
The LM2676 series of regulators are monolithic integrated circuits which provide all of the active functions for a step-down (buck) switching regulator capable of driving up to 3A loads with excellent line and load regulation characteristics. High efficiency (>90%) is obtained through the use of a low ON-resistance DMOS power switch. The series consists of fixed output voltages of 3.3V, 5V and 12V and an adjustable output version.
The SIMPLE SWITCHER concept provides for a complete design using a minimum number of external components. A high fixed frequency oscillator (260KHz) allows the use of physically smaller sized components. A family of standard inductors for use with the LM2676 are available from several manufacturers to greatly simplify the design process.
The LM2676 series also has built in thermal shutdown, current limiting and an ON/OFF control input that can power down the regulator to a low 50µA quiescent current standby condition. The output voltage is guaranteed to a ±2% tolerance. The clock frequency is controlled to within a ±11% tolerance.
BTW, using external voltage divider can help us to change output voltage.
D2 - just powerful diode protecting device from reverse polarity. Sometimes I connect untested wall adapters and some of them are AC/AC type… Typically from old external modems. I have already damaged one ethernet switch with such adapter.
C1 and C2 are line voltage filters and energy storage devices. The capacitance is not very important thing, place as much as you think. But try to use low ESR capacitors. C3 and C5 is energy storage devices. Low ESR is mandatory here. Capacity- 1000µF or more. C4- boost capacitor, read data-sheet for more details, 0.01µF at 50V. D1 is fast, schottky diode. Voltage dropout less than 1V. The coil is selected from table in datasheet. Don't worry about exact value. This only lowers the efficiency of the regulator a bit. I used 27µH coil. R2 and LED2 is just to show that something is working. The chip pin 7 is left floating. It can be used to switch off the regulator.
Everything is placed on small PCB with pins for connection to breadboard. Do not build switched power regulators using “wire" connections or breadboard. High frequency and current with long wires will cause strange effects.