Skip to main content


Showing posts from November, 2013

HelloWorld on TP-LINK TL-WR740N

Here's how to:
Flash a TP-LINK TL-WR740N WiFi router with OpenWRT (Wikipedia)Install toolchain which will run on your x86 Ubuntu computer but compile for the MIPS processor (Atheros AR9330) present inside the TP-LINK TL-WR740N.Cross-compile a hello world C program on x86.Transfer the executable to the router and run it.
Flashing the router with OpenWRT

Look on the back side of the router and figure out your model numberMine was V4.23. I looked up the corresponding entry for that model on the OpenWRT's Wiki Page for TL-WR740N here under the "Specific Install Notes" section and read:
"Hardware version 4.23 works perfectly with the unmodified Attitude Adjustment (12.09-beta) generic WR740N v4 image. The best installation method is flashing it through the stock TP-Link web interface."So I clicked on the image link in that line and downloaded the .bin file:
openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-factory.binNext I co…

Measuring the hot resistance and cold resistance of Incandescent Bulbs

The Bulbs So I took 3 bulbs of 40 Watts, 60 Watts and 100 Watts respectively and measured the hot and cold resistances

I used the Philips softtone frosted lamp series.

40 Watts : Rs 20
60 Watts : Rs 20
100 Watts  : Rs 21

Cold Resistances The cold resistance readings were as follows:

40 Watts : around 97.6 Ohms
60 Watts : around 71.4 Ohms
100 Watts : around 39.5 Ohms

Hot Resistances (Calculated) Calculated values of hot resistance can be obtained using the formula: Resistance = (Voltage^2) / Power
In India the AC voltage RMS value is 230 Volts.

So we get the hot resistances as:

40W Bulb : (230*230) / 40 = 1322.5 Ohms
60W Bulb : (230*230) / 60 = 881.67 Ohms
100W Bulb : (230*230) / 100 = 529 Ohms

Hot Resistances (Measured)
To get the actual values of the hot resistance, you have to measure the current flowing through the bulb. In case of AC supply, this can be done using a clamp meter. It measures the current flowing through a wire by sensing the amount of magnetic flux induced a…

Irfanview : Auto adjust colors

I refuse to use any computer without first installing a copy of IrfanView on it. This light weight multi-format image viewer and converter has become ubiquitous amongst my circle of tech geeks - we can no longer imagine life without it. One of the specific features that I love is "Auto adjust colors".

Consider the following images. The images in the left windows are the originals and the images in the right windows are obtained by applying the "Auto adjust colors".

As you can see, "Auto adjust colors" tweaks the various parameters of the image and brings out the details which remained unseen earlier. One of the major operation that "Auto adjust colors" does is Histogram stretching. Look at the screenshot below to get a better idea of what that is all about:

Here are the original images for reference.

All in all, using this nifty feature of IrfanView makes me feel like I am performing some macho image forensics - like they show on crime series o…

Integrating FlashMagic with Keil uVision4 for P89V51RD2

If you are using P89V51RD2 microcontroller with Keil uVision4 for your project, then you might find it convenient to add FlashMagic as a Tools Menu Option within Keil.
What this will do is allow you to download the program onto P89V51RD2 using a single click from within Keil.
Prerequisites:Keil uVision4 (with the hex output option enabled for your current project)FlashMagic from target board wired properly to allow DTR to control RESET. If you are using FT232 (USB <> UART) then refer the connection diagram below on how to design your circuit board appropriately.

Adding FlashMagic to Tools menu:Click on "Customize Tools" option from the Tools menu.
Add a new tool by clicking on the New button. Type the tool name as "Flash Magic".Type the following lines in the "Command" and "Arguments" textboxes and click ok.
C:\Program Files (x86)\Flash Magic\fm.exe

DEVICE(89V51RD2, 11.0592, 0) ERASE(DEVICE, …