Wednesday, October 29, 2008

Python programming in Windows

You can try Python programming in windows. It will be really useful for students started learning programming. I dont have much experience in Python. But seems like easy programming compared to C/C++ - not much syntax, extensive ADTs, a lot of useful libraries.

You can use Python in different ways - as a good programming language or scripting language.
The best thing is we can use python code embedded in to C/C++ code. You will get more information about this from here: http://www.python.org/doc/2.5.2/ext/contents.html

You can install Python in your windows machine by downloading windows installer for Python and windows extensions. More information here: http://www.cs.sfu.ca/~ggbaker/reference/modeling/wininstall

Wednesday, October 22, 2008

Three microsoft bugs..!!

These are some weired bugs in microsft products

1. Open a word document, type =rand (200, 99) and press ENTER.

Actually there is no significance for the numbers 200 and 99, say we are entering =rand(x,y) in word, it will create the sentence "The quick brown fox jumps over the lazy dog." y times in x paragraphs.

eg: if we are entering =rand(2,1) , the output will be like this

The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.

or some other "random" sentences.

2. Try creating folders named : CON, NUL, COM1, COM2, COM3, LPT1, LPT2, LPT3,COM1 to COM9 and LPT1 to LPT9. It will not allow to change the name of folder. But there are two ways to create these folders in Windows.

a) Go to cmd prompt and try the command md\\.\\c:\\con. It will create con folder inside C drive.

b) While naming the folder, type 'CON' and type c55 in the numpad holding the alt button.

3. Open an empty notepad file. Type "Bush hid the facts" (without the quotes). Save it as whatever you want. Close it, and re-open it.

Noticed the weird bug? Actually not only the sentence "Bush hid the facts"..but a lot of sentences have this behaviour. The first word with even number of letters and all other words with odd number of letters will create this problem..eg: try "rake did bad thing". It will just show 9 squares or some chinese characters..:).

But if we are saving the notepad using unicode encoding instead of ANSI encoding, there is no problem. Even opening the file with unicode will help.

Monday, October 20, 2008

OpenMoko Neo Freerunner


Openmoko is a project dedicated to delivering mobile phones with an open source software stack. Openmoko is currently selling the Neo FreeRunner phone to advanced users and will start selling it to the general public as soon as the software is more developed. In India also it is available through IDA systems. The price is high as of now. We can hope price will be reduced in the future.

Further details about this project is available here : http://wiki.openmoko.org/wiki/Main_Page

Sunday, September 14, 2008

Scientists Test World's Fastest Wireless Network

Scientists in Pisa, Italy claim to have set a new world record for the fastest wireless data transmission. They report that during an uninterrupted 12-hour experiment, they were able to achieve throughput speeds above 1.2 Terabits per second; which they say beats the previous wireless data transmission speed record of 160 Gigabits per second by Korean scientists. The researchers claim that speeds of this magnitude can typically only be achieved using fiber optics.

More new here : http://www.hothardware.com/News/Scientists-Test-Worlds-Fastest-Wireless-Network/

Saturday, May 24, 2008

LiMO Foundation

Motorola, NEC, NTT DoCoMo, Panasonic Mobile Communications, Samsung Electronics, and Vodafone established the LiMo Foundation to develop the world’s first globally competitive, Linux-based software platform for mobile devices.

The mission of the LiMo Foundation is to create an open, Linux-based software platform for use by the whole global industry to produce mobile devices through a balanced and transparent contribution process enabling a rich ecosystem of differentiated products, applications, and services from device manufacturers, operators, ISVs and integrators.

You can get more details about limofoundation in http://www.limofoundation.org

Monday, February 18, 2008

Network Processors

It is not a detailed description of how a Network Processor works. Just trying to differentiate Network processor from other common chip solutions.
For networks to effectively handle new applications emerging in the market, they will need to support new protocols that include differentiated services, security, and various network management functions. While networks are demanding equipment with very high throughput, they also need the flexibility to support new protocols and applications. In addition, the ever-changing requirements of network equipment require solutions that can be brought to market quickly.

Today’s legacy network implementations are based on Field Programmable Gate Arrays (FPGAs) for lower layer processing and General Purpose Processors (GPPs) for higher layer processing. Neither of these solutions meets all the requirements that network processing demands. Consider the broad categories of alternatives for system implementation:

ASIC (Application Specific Integrated Circuit) – any hardwired solution.

ASIP (Application Specific Instruction Processor) – an instruction set processor specialized for a particular application domain.

Co-processor – a hardwired, possibly configurable solution with a limited programming interface.

FPGA (Field Programmable Gate Array) – a device that can be reprogrammed at the gate level.

GPP (General Purpose Processor) – a programmable processor for general purpose computing.


There are two main requirements for all these solutions - flexibility and performance. ASICs are the most hardwired (least flexible), but provide the highest performance. GPPs are the most general (flexible) at the cost of the lowest performance. An ASIP for networking provides the right balance of hardware and software to meet all the requirements like:

Performance – by executing key computational kernels in hardware, NPs are able to perform many applications at wire speed.

Flexibility – having software as a major part of the system allows network equipment to easily adapt to changing standards and applications.

Fast TTM – designing software is much faster (and cheaper) than designing hardware of equivalent functionality.

A network processor is an ASIP for the networking application domain – a software programmable device with architectural features and/or special circuitry for packet processing. Main players in the NP market space are AMCC, Agere, Intel, Broadcom, Cisco and Vitesse.

A very detailed analysis of NPs is available in Understanding NPs. Another good article on NPs is from Netrino.

Sunday, February 17, 2008

AVR STK500 Programming

In January i bought a new ATMEL STK500 board and a AVR Dragon board. I did not touch the Dragon board till now. But i could able to program STK500 board using the RS232 connector in the baord. You can view my boards here.

The Atmel AVR STK500 is a starter kit and development system for Atmel's AVR Flash microcontrollers. Most of the AVR microcontrollers are supported with this board. I got two microcontrollers with this board itself : ATMEGA8515L and ATMEGA16. Board is having some switches and LEDs connected to different ports of the microcontroller. This can be used for prototyping. 6 sockets are there for 8, 20 , 28 and 40 pin microcontrollers. Two RS-232 interfaces are there in the board. One for serial programming and the other one to interface with other boards. We can use 10-15 V DC supply.

The suggested way of programming STK500 programming board is using AVR Studio interface software for Windows. And my laptop is not having serial port. So, i bought one USB to serial converter from one electronics shop here. But i could not able to program using AVR microcontroller 8515L using AVR Studio. When programming it is not giving any error, but the load is not working at all..that means LEDs are not blinking(The program was for that purpose..:). Still i dont know what is the problem.

Then i connected the board using Linux. I compiled the program using avr-gcc. Read how to build cross compiler for AVR in my previous post. This time i was successfull. Without no issues, the program loaded to microcontroller and the LEDs started blinking...:)

The program is very simple one. LEDs are connected to PORTB in the microcontroller using switches in the board and connectors.

/* I/O PORT B, DATA DIRECTION REGISTER (0 -> in, 1 -> out) */
#define DDRB (*(volatile unsigned char *)(0x17 + 0x20))

/* I/O PORT B, DATA REGISTER */
#define PORTB (*(volatile unsigned char *)(0x18 + 0x20))

int main(void) {
int i;

/* Set the whole port (all bits) to "output" */
DDRB = 0xff;

while(1) {
/* Turn off all leds connected to port B */
PORTB = 0x00;

/* Delay */
for(i = 0; i < 0xffff; i++);

/* Turn on all leds connected to port B */
PORTB = 0xff;

/* Delay */
for(i = 0; i < 0xffff; i++);
}

return 0;
}

Then , execute following commands.

avr-gcc -mmcu=atmega8515 a.c
avr-objcopy -j .text -j .data -O ihex a.out a.hex
avrdude -p m8515 -c stk500v2 -P /dev/ttyUSB0 -U flash:w:a.hex -v
avr-objcopy is the tool for converting from one object file format to other. Here we are converting from ELF format to Intel Hex format. avrdude is a free software tool for loading the programs to the Flash of AVR microcontrollers.