Here I will share some of my insights about embedded and PC software design and modern electronic hardware development. Everyone is welcome to engage into discussion.
Sunday, June 10, 2012
Bugs in Windows Application Development
Today I at last have found time to fix some long-lasted bugs in one of my programs. Some of these bugs have been annoying users for about one year. They inconspicuously appeared after some phase of editing of source code. During fixing, I found two other previously completely overlooked bugs. They are not critical in nature, but annoying. It seems that this process (of finding and fixing bugs) can last forever.
Development for Windows OS, comparing to development for microcontrollers, allows you to employ many ready-to-use system (as well as third-party) libraries, thus freeing you from the task of implementing service code for yourself, but at the same time, bugs and inconsistencies in system and third-party libraries can force you to spend much time in efforts to figure out why your application is not behaving as you expected, and I'm pretty tired of it.
Conclusion is to test as big fraction of program's functionality as possible after every source code change.
Wednesday, May 9, 2012
Bicycle off-city trips
A week ago, I had joined a bicycle club, and took part in two off-city trips, during weekend, -- about 100 km distance each, with 20-25 km/hour (up to 30) average speed. These were not competitions, but nevertheless they gave some physical load, and after them, sleep is deep. I plan to continue such trips. I hope that such physical exercises will increase my overall productivity and feeling, and give some energy. Aside from this goal, Saint-Petersburg's suburbs are very beautiful in nature, and have strong historical meaning and trace.
Wednesday, March 14, 2012
How to reanimate Li-Ion or Li-Pol battery from your smartphone
Today I want to share my experience in repairing the Li-Pol smart battery in my HP iPAQ 1930. See my previous post on it.. My battery was marked with HP H1910 string on its paper box. The problem with it is if you'll leave device without even a single charge cycle for several weeks, it will discharge to a level from which it is impossible to initiate further recharging. If nominal voltage is 3.7 Volts, and you have allowed to discharge to about 3 V, this is the situation considered. A small piece of electronics, consisting of charge controller IC (integrated circuit), and a couple of power field (MOSFET) transistor keys, is placed between actual Li-Ion (or Li-Pol) battery and the outer contacts. Charge controller IC monitors voltage levels at the battery itself and outer contacts, opens necessary power key transistors, and communicate with host device via SMBus or other protocol to allow it to know state of the battery. Problem with discharging of a battery below certain level is that this controller IC stops working, so it is impossible to recharge the battery, since power key transistor have become permanently closed. But in many cases it is still possible to reanimate the smart battery.
To do this, cut off small pieces of plastic from both sides of the battery, to open access to the inner contacts of Li-Ion (Li-Pol) battery. You should see and have access to two metal stripes after this operation. Get laboratory DC power supply unit, with both constant current and constant voltage, modes of operating. I use SHENZHEN MASTECH HY3005D-3. Constant current mode is indicated by "C.C." red round LED at the front panel, while constant voltage -- by the nearby LED named "C.V.". My battery has capacity of 950mAh. The usual current for charging Li-Ion batteries is calculated as capacity x 0.2 (in the appropriate units, in my case, it would be 950 x 0.2 = 190 mA). Since we want to bypass control electronics, and will not monitor temperature of the battery, it would be safer to decrease this value, I think, two times will be enough, so I assumed charge current of 100 mA. I shortened outputs of one channel of SHENZHEN MASTECH HY3005D-3 power supply unit, and set short-circuit output current to this level. (Be aware also that maximum allowable current that USB port should be capable of providing by its spec, is 500mA. So if your device is charged through USB, do not exceed this value under any conditions. Even safer would be to use half of that value, that is, about 250 mA, as an upper threshold for charging current.) Then I set output voltage to nominal voltage of the battery, 3.7Volts in my case. After this, I connected output of power supply to inner batteries contacts. Initial current will be 100 mA, equal to short-circuit, and "Constant Current" LED should be active. During a few hours, the battery will be charging, after which voltage should rise to its nominal value (3.7 Volts in my case), current drops to near zero, and power supply switch to "Constant Voltage" mode. That's it. Now you can power off power supply, disconnected wires from battery, place it into your handheld device, and continue using it, without having to buy a new battery.
WARNING 1: Do not try to repeat the process without power supply with both "Constant Current" and "Constant Voltage" output mode, and without proper and carefully checked set-up values.
WARNING 2: Li-Ion batteries might fire and explode. It is safer to put the battery into the metal or other solid case during the process to avoid possible harmful accidents.
To do this, cut off small pieces of plastic from both sides of the battery, to open access to the inner contacts of Li-Ion (Li-Pol) battery. You should see and have access to two metal stripes after this operation. Get laboratory DC power supply unit, with both constant current and constant voltage, modes of operating. I use SHENZHEN MASTECH HY3005D-3. Constant current mode is indicated by "C.C." red round LED at the front panel, while constant voltage -- by the nearby LED named "C.V.". My battery has capacity of 950mAh. The usual current for charging Li-Ion batteries is calculated as capacity x 0.2 (in the appropriate units, in my case, it would be 950 x 0.2 = 190 mA). Since we want to bypass control electronics, and will not monitor temperature of the battery, it would be safer to decrease this value, I think, two times will be enough, so I assumed charge current of 100 mA. I shortened outputs of one channel of SHENZHEN MASTECH HY3005D-3 power supply unit, and set short-circuit output current to this level. (Be aware also that maximum allowable current that USB port should be capable of providing by its spec, is 500mA. So if your device is charged through USB, do not exceed this value under any conditions. Even safer would be to use half of that value, that is, about 250 mA, as an upper threshold for charging current.) Then I set output voltage to nominal voltage of the battery, 3.7Volts in my case. After this, I connected output of power supply to inner batteries contacts. Initial current will be 100 mA, equal to short-circuit, and "Constant Current" LED should be active. During a few hours, the battery will be charging, after which voltage should rise to its nominal value (3.7 Volts in my case), current drops to near zero, and power supply switch to "Constant Voltage" mode. That's it. Now you can power off power supply, disconnected wires from battery, place it into your handheld device, and continue using it, without having to buy a new battery.
WARNING 1: Do not try to repeat the process without power supply with both "Constant Current" and "Constant Voltage" output mode, and without proper and carefully checked set-up values.
WARNING 2: Li-Ion batteries might fire and explode. It is safer to put the battery into the metal or other solid case during the process to avoid possible harmful accidents.
Tuesday, February 21, 2012
Simplified English
I have recently stumbled upon such thing as Simplified English. Even for my ears, Russian being my native language, Simplified English sounds rather strange and, well, oversimplified. I read a few sample sentences, and it is clear that all of them lack some part of sense comparing to the original English sentences upon which they were constructed.
It seems that there is no "Velvet Way" or "Silver Bullet" that could solve the problem of communication between people with different native languages worldwide. I did not ever hear about language school that teaches "Simple, or Simplified Language". Just opposite, all of them claim that their method allows one to master English (or other language of interest) to maximum possible level, and this fact clearly indicates that there is no or little demand for learning Simple Language.
My conclusion is that there are no ways, except for long persistent systematic work, to learn any foreign language.
It seems that there is no "Velvet Way" or "Silver Bullet" that could solve the problem of communication between people with different native languages worldwide. I did not ever hear about language school that teaches "Simple, or Simplified Language". Just opposite, all of them claim that their method allows one to master English (or other language of interest) to maximum possible level, and this fact clearly indicates that there is no or little demand for learning Simple Language.
My conclusion is that there are no ways, except for long persistent systematic work, to learn any foreign language.
Monday, January 16, 2012
Requiem to Phobos-Grunt
Yesterday, after about two months of orbiting the Earth on an intermediary, low-altitude elliptic orbit, Russian interplanetary station had finally fallen back to Earth, luckily into Pacific Ocean, not on some populated area.
Its short flight raised many questions to Roscosmos and even state's officials. Combined with several other satellite launch failures during last year, these questions are especially vital today. Maybe something in the area of top management of Roskosmos is really going wrong, maybe someone still think that world-class high-tech unique things can be developed for amount of money much less than world market suggests. Maybe something is broken at the bottom end of a technological chain, say poor quality control of production.
But here I want to point to only one side of the problem: nowadays, we have many strong rigorous math instruments that can be used to assess reliability and probability of failure for virtually any piece of hardware and software. Researches in the area of development of error-tolerant and reliable hardware and software systems allow one to employ many scientifically proved methods of designing and testing. This is XXI century, at last.
If scarce funding had really taken place, why main engineers and their bosses who were responsible for device subsystems could not just say: "Hey, guys, this is not enough to achieve the project's goals. You either will give us enough resources (time, money, people, equipment, etc.), or we will not sign for the work.". It seems that something is broken in the whole chain of decision making in Roskosmos. Sadly, but such conclusion came to mind after reading news.
Its short flight raised many questions to Roscosmos and even state's officials. Combined with several other satellite launch failures during last year, these questions are especially vital today. Maybe something in the area of top management of Roskosmos is really going wrong, maybe someone still think that world-class high-tech unique things can be developed for amount of money much less than world market suggests. Maybe something is broken at the bottom end of a technological chain, say poor quality control of production.
But here I want to point to only one side of the problem: nowadays, we have many strong rigorous math instruments that can be used to assess reliability and probability of failure for virtually any piece of hardware and software. Researches in the area of development of error-tolerant and reliable hardware and software systems allow one to employ many scientifically proved methods of designing and testing. This is XXI century, at last.
If scarce funding had really taken place, why main engineers and their bosses who were responsible for device subsystems could not just say: "Hey, guys, this is not enough to achieve the project's goals. You either will give us enough resources (time, money, people, equipment, etc.), or we will not sign for the work.". It seems that something is broken in the whole chain of decision making in Roskosmos. Sadly, but such conclusion came to mind after reading news.
Sunday, January 1, 2012
Digital Photo Frame Texet TF-618
Last week, I had have to choose digital photo frame as a New Year gift to my mother. I stopped at Texet TF-618 due to its placement of control buttons at the front panel instead of at the backside. All other devices that I saw, have built-in control buttons made as usual mini-knobs, at the back side of them. TF-618 have just opposite design solution: a series of sensor LED-highlighted buttons at the front, just below its screen. This, I suspect, does not significantly raise its cost, but make usability and feel of control much better. I do know that there is small remote infrared control unit supplied with almost each digital photo frame device, including TF-618, but I prefer to have ability to deal with device without it in case it will be lost or accidentally hidden somewhere.
Friday, December 30, 2011
Attentiveness in engineering work
The day before yesterday I had finally finished firmware in VHDL which is burned into Altera CPLDs in my design. Now all works fine, including surrounding digital schematics.
Unfortunately, I spent about two months on this part of project instead of planned four weeks. The reason is lack of attention during initial schematics development and VHDL program writing. Little logical error in VHDL program and lack of thorough test simulations caused me to solder several wires to key logic nets of the design under consideration, connect them to special debug connector and examine its pins with oscilloscope. Physical layout of the two mezzanine PCBs does not allow to access all logic nets directly with oscilloscope probes. At the end, error in firmware was found and fixed, but at price of extra time and nerves.
After VHDL firmware was fixed, the device still did not function as it should. The reason traced to be a subtle difference in my schematics in comparison with third-party device to which my design should be compatible. My schematics was right, but incompatible with third-party software from manufacturer of that device. This was fixed by means of one 0603 resitor and two equipment wires.
Finally, this part of device passed all tests.
The lesson learned is the impermissibility of neglecting thorough and attentive requirement analysis and creating simulation tests during initial design phase.
Unfortunately, I spent about two months on this part of project instead of planned four weeks. The reason is lack of attention during initial schematics development and VHDL program writing. Little logical error in VHDL program and lack of thorough test simulations caused me to solder several wires to key logic nets of the design under consideration, connect them to special debug connector and examine its pins with oscilloscope. Physical layout of the two mezzanine PCBs does not allow to access all logic nets directly with oscilloscope probes. At the end, error in firmware was found and fixed, but at price of extra time and nerves.
After VHDL firmware was fixed, the device still did not function as it should. The reason traced to be a subtle difference in my schematics in comparison with third-party device to which my design should be compatible. My schematics was right, but incompatible with third-party software from manufacturer of that device. This was fixed by means of one 0603 resitor and two equipment wires.
Finally, this part of device passed all tests.
The lesson learned is the impermissibility of neglecting thorough and attentive requirement analysis and creating simulation tests during initial design phase.
Subscribe to:
Posts (Atom)