Saturday, October 17, 2009

Digital Lock with keyboard and LCD Using ARM7 (LPC LPC2103)

Introduction to LPC LPC2103:
The Image craft iARM-2103 is a highly integrated, RoHS-compliant, single board computer based on a Philips LPC2103 ARM7 microcontroller. It can be powered via USB port, eliminating the need for an extra power supply. Firmware upgrades can be downloaded via USB, thus allowing "plug-and-go" immediate development without additional hardware investment.
The iARM-2103 not only satisfies the needs of development and experimentation, but also is meant to follow through to production as a professional and reliable single board computer solution. Manufactured in a U.S. production house meeting military and NASA standards, the iARM-2103 is of the highest quality.
The iARM-2103 includes many features not found in comparably priced boards, such as lead-free/RoHS compliant components, DIP switch for configuration instead of jumpers, JTAG header, 64 Kbit I²C EEPROM, brown-out protection, firmware upgrades via USB, free USB drivers, RTC with 32.768 kHz clock and battery backup support, A/D converter, all I/O signals brought out to headers, and much more.
The iARM-2103 measures 2.6" x 1.9" and can be used either as a plug-in module or a standalone single board computer. In the standalone configuration, the iARM-2103 is mounted easily with standoffs, and the header pins plug directly into standard 0.1" cable connectors. The iARM-2103 is fully supported by the ImageCraft ICCARM C compiler. The ICCARM demo is perfect for iARM-2103 development. It is fully functional for 45 days, and becomes 10K code limited for non-commercial use after 45 days. Flash programming can be done using the free Philips-provided serial downloader over the USB port.
The product comes with many example programs for the Imagecraft ICCARM compiler to speed development, including a variety of iARM-2103 programs and Windows applications demonstrating communication between the PC and the iARM-2103 over USB.

Programming in C:

/*****************************************************/
/* Target MCU : Philips ARM7-LPC2119 */
/* : X-TAL : 19.6608 MHz */
/* : Run Speed 58.9824MHz (With PLL) */
/* Compiler : GCC ARM V3.31 */
/*****************************************************/
#include "LPC2103.H" // LPC2119 MPU Register
#include
#include "timer.H"
#include "config.H"
#include "lcd.h"
#include "serial0.h"
#define RED_PIN PIN19
#define GREEN_PIN PIN21
#define Blue_PIN PIN20
#define row1 PIN24
#define row2 PIN5
#define row3 PIN7
#define row4 PIN9
#define column1 PIN11
#define column2 PIN13
#define column3 PIN15
#define column4 PIN3
#define wrong 0x00
#define correct 0x01
const ulint column[4]={column1,column2,column3,column4};
const uchar row_table[4][4]={{'1','2','3','A'},{'4','5','6','B'},{'7','8','9','C'},{'*','0','#','D'}};
const unsigned int LED_PORTS[10]={0x1c07,0x0006,0x2c03,0x2407,0x3006,0x3405,0x3c05,0x0007,0x3c07,0x3407};
void delay(unsigned long int count){
while(count>1)count--;
}
uchar const code[]={"12AB54CD"};
uchar code_buffer[8];
uchar row,key,buffer_count=8,new=1;
void timer0_intrruppt(){
++row;
key='N';
if ((row)==4) row=0;
IOCLR|=(column1|column2|column3|column4);//clear all pin
delay(10);
IOSET|=column[row];//
delay(10);
if((IOPIN& row1) ==row1)key=row_table[row][0];
else if((IOPIN& row2) ==row2)key=row_table[row][1];
else if((IOPIN& row3) ==row3)key=row_table[row][2];
else if((IOPIN& row4) ==row4)key=row_table[row][3];
if(key=='N'){ if(++new>5)new=5;}
else {
if(new==5){
++buffer_count;
if(buffer_count>7)buffer_count=0;
code_buffer[buffer_count]=key;
}
new=0;
}}
int main(){
uchar password;
uchar reg=8,i;
PINSEL0=0;
PINSEL1=0;
init_serial0();
if(!lcd_init())printf("lcd erorr");
init_timer();
//IODIR|=0x7c070000; //define all led ports as out put
// IOSET|=0x7c070000; //turn off all leds
IODIR|=(GREEN_PIN|Blue_PIN|RED_PIN);//define RGB pins as out put
IOSET|=(GREEN_PIN|Blue_PIN|RED_PIN);//turn RGB off
// IOCLR|=RED_PIN;//turn on the red LED
IODIR|=(column1|column2|column3|column4);
key='N';
lcd_putsf("Enter Password: ",16);
lcd_gotoxy(0,1);
while(1){
if(reg!=buffer_count){
putchar(code_buffer[buffer_count]);
lcd_putchar(code_buffer[buffer_count]);
reg=buffer_count;
if(buffer_count==7){
password=correct;
for(i=0;i<8;i++)if(code_buffer[i]!=code[i]){
printf("wrong password\n");
lcd_gotoxy(0,0);
lcd_putsf("wrong password ",16);
delay(50000000);
lcd_gotoxy(0,0);
lcd_putsf("Enter Password: ",16);
lcd_gotoxy(0,1);
lcd_putsf(" ",16);
lcd_gotoxy(0,1);
password=wrong;
i=9; }
if(password==correct){
lcd_gotoxy(0,0);
lcd_putsf("correct!!!!!! ",16);
IOCLR|=(GREEN_PIN|Blue_PIN|RED_PIN);//turn RGB 0n
delay(50000000);
IOSET|=(GREEN_PIN|Blue_PIN|RED_PIN);//turn RGB off
lcd_gotoxy(0,0);
lcd_putsf("Enter Password: ",16);
lcd_gotoxy(0,1);
lcd_putsf(" ",16);
lcd_gotoxy(0,1);
printf("password is correct!!!!!!!!!!!!!!\n");}
reg=buffer_count=8;
}}}}

Sunday, June 14, 2009

Transistor in General

In electronics, a transistor - the greatest invention of the twentieth-century, is a semiconductor device commonly used to amplify or switch electronic signals. The transistor is the fundamental building block of modern electronic devices. Low cost, flexibility and reliability have made it a ubiquitous device. Transistorized mechatronic circuits have replaced electromechanical devices in controlling appliances and machinery. It is often easier and cheaper to use a standard microcontroller and write a computer program to carry out a control function than to design an equivalent mechanical control function.
A transistor can control its output in proportion to the input signal, that is, can act as an amplifier. Or, the transistor can be used to turn current on or off in a circuit like an electrically controlled switch, where the amount of current is determined by other circuit elements.
There are two types of transistors, which have slight differences in how they are used in a circuit. The bipolar junction transistor (BJT) is the first type of transistor, which has terminals labeled base, collector and emitter. A small current at base terminal can control or switch a much larger current between collector and emitter terminals. Bipolar transistors are so named because they conduct by using both majority and minority carriers. The BJT consists of two p-n junctions: the base/emitter junction and base/collector junction. The BJT is useful in amplifiers because the currents at the emitter and collector are controllable by the relatively small base current.
Other type of transistor, the field-effect transistor (FET), sometimes called a unipolar transistor uses either electrons (in N-channel FET) or holes (in P-channel FET) for conduction, the terminals are labeled gate, source, and drain, or a voltage at the gate can control a current between source and drain. FETs are divided into two families: junction FET (JFET) and insulated gate FET (IGFET). The IGFET is more commonly known as metal–oxide–semiconductor FET (MOSFET). Even after MOSFETs became available, the BJT remained the transistor of choice for many analog circuits. Desirable properties of MOSFETs, usually in the CMOS configuration, allowed them to capture nearly all market shares for digital circuits.

Friday, June 12, 2009

How to Reboot Star Wars

Now that both Batman and Star Trek have enjoyed cinematic reinventions, it's only a matter of time before Hollywood reboots the franchise that rebooted entertainment itself. Here's how the inevitable Star Wars reinvention could be fantastic instead of embarrassing.

So wait, why reboot Star Wars? I'm sick of the reboots. Movies are getting as crash-happy as my Macbook.

Oh, whine whine whine. Too many remakes, sequels and reboots. "Poor me, the entertainment industry is trying to pander to me by recreating the entertainments of my childhood, or in some cases my grandparents' childhoods." I know, it sucks to be you. But look at it this way: a lot of these entertainment franchises need the occasional reboot, because they've been running for decades and are struggling to run the latest firmware. "Women's lib" made Wonder Woman go BSOD several times in the 1960s, and more recently she's been as crash-prone as a J.J. Abrams airplane.

Actually, Star Wars is the perfect example of what happens to a long-running franchise that doesn't get rebooted. You keep adding more and more trendy stuff to the mix, piling on extra chunks of mythos and bits of backstory, and inflating the importance of minor characters until they overwhelm the narrative. (Jango Fett?) It's not the creators' fault, necessarily. It's just what happens when you try to keep a complex universe running for decades without restarting.

Eventually, your once-shiny universe gets to the point where you have to shut it down forever, or do a hard restart. And there's too much money in these old juggernauts to shut them down.

But... But... George Lucas will never go for it!

He will, once he runs out of money. It's just a matter of time. Those life-size solid-gold Yoda bidets don't pay for themselves, you know. (With the proximity activation, and the voice that says, "Wash your bottom, you will." That's expensive stuff.) All it'll take is another few insane Star Wars projects, like another big-screen Clone Wars movie and another three Star Wars TV shows that he's financing out-of-pocket. Chances are, he's already completed a few thousand scripts for his live-action Star Wars show, which takes place between the prequel trilogy and the original trilogy and probably includes a whole set of episodes about Jar Jar Binks visiting the Ewoks.

Eventually, Lucas will need some walking-around money, and the studios will put pressure on him, and someone will come up with an offer he can't refuse. It'll probably allow him to keep his original version of the galaxy far, far away chugging along. It'll be like the Ultimate Marvel Universe, or Smallville: a new reimagined version of the franchise, even as the original version keeps trundling. Call it Star Wars: Extreme. Or Star Wars: Ultraspace. Or maybe Star Wars: Even Farther Away.

Okay, so the Star Wars reboot is inevitable, if not imminent. What makes you think it could possibly be a good thing?


It could be horrendous, sure. But it doesn't have to be, and that's what this primer is about. A few years from now, when Lucas and the suits are having meetings about creating Star Wars 2.0, there are a few simple rules for how to avoid a painful Stepford Wives or Planet Of The Apes boondoggle. (Probably not including Nicole Kidman is a good place to start.)

The good news is, Star Wars has a good solid structure underneath all the crud that's been layered on top of it in recent years. At heart, it's a strong adventure story with a very simple Joseph Campbell-inspired throughline. The original Star Wars is the movie that reinvented entertainment, and forced all of those other franchises to add new features, or reboot altogether. To this day, when people reboot other franchises, they're aiming to make them more like Star Wars — blatantly so, in the case of J.J. Abrams' Star Trek.

So if some Hollywood exec is reading this, and contemplating rebooting Star Wars, the best advice we can give you is: make it more like Star Wars. With a new lick of paint, and less baggage.

Here's the longer version of that advice, in the form of eight simple rules for reinventing our beloved saga:
1) Keep it simple. Just keep reminding yourself that the purpose of a reboot is to jettison dead weight, and don't feel obliged to bring in all the extra crud about Trade Federations and midichlorians. There's the Empire, and the Rebellion, and the Force has two sides: light and dark. Stay within the lines, and give us a cool story about good versus evil, and trusting your feelings, and relying on your friends. Batman Begins scored because it gave us the essence of Bruce Wayne: the tragedy, the grief and powerless rage, and then the quest to become something bad enough to counter the darkness.

2) Keep the sense of joy and dread. Okay, I've dissed both the "hero's journey" and science fiction's obsession with "sense of wonder" before, but there is something to be said for a story where a young person starts out in a small world, and then comes out into a gigantic universe, full of moon-sized battle stations, princesses, space fights and massive ice planets. Of all the stuff that goes into "coming of age" stories, it's perhaps the most universal, since it's about leaving home. And then you find out that you're actually way more connected to this deep history that went on before you were born, because your dad was a Jedi knight. There's plenty of great stuff there.

3) Get back to the characters we care about. It sounds basic, but that's how J.J. Abrams revitalized Star Trek. Luke Skywalker, Princess Leia, Han Solo, Obi-Wan Kenobi, Darth Vader. The classic characters. And here's a suggestion: Anakin Skywalker's dismal progression, where he starts out as a promising young Jedi only to be seduced to the Dark Side? That is what flashbacks or prologues are made for. You could even intersperse Anakin's journey with Luke's, as Luke learns more about his father while he grows into his powers. And speaking of heroes...

4) Admit that Han Solo is the hero as much as Luke. That's the other thing J.J. Abrams' Star Trek did right: It treated Spock as the hero, just as much as Kirk. We all knew, all along, that Spock belonged in the top spot alongside Kirk, but the series had never quite admitted it before. (Probably due to Shatner's ego, among other things.) Han Solo deserves a similar elevation. Like Kirk and Spock, Han and Luke are the yin and yang, except that they go in opposite directions. Han Solo regains his altruism and optimism, just as Luke is shedding his innocence and becoming more of a hard-ass. Bring Han Solo's journey to the fore, and don't be afraid to make him more of a jerky antihero at the beginning, so it'll feel like a real arc. (And yes, that means Han shoots first.)

5) Don't be afraid to make some changes, to bring it up to date. So you're inevitably going to make some changes to the storyline, like maybe making Obi-Wan less of a lying prick. Or maybe you'll want to add more depth to the early scenes of Luke on Tattooine, to show what he's leaving behind, and flesh out his dreams of joining Biggs and Wedge in space. Other changes I might make to the first film might involve having Leia pilot an X-wing in the final Death Star attack, and elminating all the incest-vibes with Leia and Luke. (Not to mention the scene where Vader is menacing Leia, and there's some definite sexual tension. Eww.)

6) A truckload of fanservice makes the revisionism go down. But you're worried, inevitably, about getting bags of bantha poodoo on your doorstep if you make any alterations to the sacrosanct franchise. Fans can be unforgiving murglaks. But they're also very susceptible to bribery. If you throw in lots of references and nods to old stories, then you can do anything. You can blow up Vulcan. You can even make Spock's mom Winona Ryder. You can have an evil assassin cult train Batman. It's all good. You just have to throw in the Kobayashi Maru, Henri Ducard and all the stuff that fans salivate over, and they'll run with whatever changes you want to make. (Having a decent story doesn't hurt either.) Have Spock quote the best lines from Wrath Of Khan, and fans won't care that the Enterprise looks like the bar at the W Hotel.

7) Restrain your video-game impulses. Any new Star Wars will have to be Imax and 3-D and CG and huge, sure. That's just a given, unless those fads have been replaced by something even bigger and more eyeball-gouging by then. But it doesn't have to feel like a video game. The original Star Wars inspired a million video games — because it felt so real and got your adrenaline pumping. It wasn't just the special effects, it was the crazy you-are-there feeling of the Millenium Falcon's gun turrent swinging around, and the stars whizzing past as Luke shot at tie fighters. Try to keep that sense of realness, and actual peril, and genuine thrills. Not so much with the fakey rollercoaster shit.

8) Get a real writer. Please. In addition to feeling invested in the characters, we have to buy into their conflicts and quote their snappy dialog. Seek out one of the legion of Joss Whedon apprentices and press-gang him or her. I'm thinking Drew Goddard, who moved on from Buffy to write Cloverfield, and is now directing Whedon's Cabin In The Woods. Or Jane Espenson. Get someone who can do characters and banter and insane high-stakes drama, and turn him/her loose on the saga of Luke, Leia and their crazy aging biker dad. And may the Force be with all of us if you fail.

Sunday, June 7, 2009

Consider World without Electronics & Telecommunication Engineers

Consider World without Electronics Engineers


Consider World without Telecommunication Engineers

Tuesday, June 2, 2009

The Breadth and Depth of DSP

Digital Signal Processing is one of the most powerful technologies that will shape science and engineering in the twenty-first century. Revolutionary changes have already been made in a broad range of fields: communications, medical imaging, radar & sonar, high fidelity music reproduction, and oil prospecting, to name just a few. Each of these areas has developed a deep DSP technology, with its own algorithms, mathematics, and specialized techniques. This combination of breath and depth makes it impossible for any one individual to master all of the DSP technology that has been developed. DSP education involves two tasks: learning general concepts that apply to the field as a whole, and learning specialized techniques for your particular area of interest.

Digital Signal Processing is distinguished from other areas in computer science by the unique type of data it uses: signals. In most cases, these signals originate as sensory data from the real world: seismic vibrations, visual images, sound waves, etc. DSP is the mathematics, the algorithms, and the techniques used to manipulate these signals after they have been converted into a digital form. This includes a wide variety of goals, such as: enhancement of visual images, recognition and generation of speech, compression of data for storage and transmission, etc. Suppose we attach an analog-to-digital converter to a computer and use it to acquire a chunk of real world data. DSP answers the question: What next?

The roots of DSP are in the 1960s and 1970s when digital computers first became available. Computers were expensive during this era, and DSP was limited to only a few critical applications. Pioneering efforts were made in four key areas: radar & sonar, where national security was at risk; oil exploration, where large amounts of money could be made; space exploration, where the data are irreplaceable; and medical imaging, where lives could be saved. The personal computer revolution of the 1980s and 1990s caused DSP to exploded with new applications. Rather than being motivated by military and government needs, DSP was suddenly driven by the commercial marketplace. Anyone who thought they could make money in the rapidly expanding field was suddenly a DSP vender. DSP reached the public in such products as: mobile telephones, compact disc players, and electronic voice mail.

This technological revolution occurred from the top-down. In the early 1980s, DSP was taught as a graduate level course in electrical engineering. A decade later, DSP had become a standard part of the undergraduate curriculum. Today, DSP is a basic skill needed by scientists and engineers in many fields. As an analogy, DSP can be compared to a previous technological revolution: electronics. While still the realm of electrical engineering, nearly every scientist and engineer has some background in basic circuit design. Without it, they would be lost in the technological world. DSP has the same future.

This recent history is more than a curiosity; it has a tremendous impact on your ability to learn and use DSP. Suppose you encounter a DSP problem, and turn to textbooks or other publications to find a solution. What you will typically find is page after page of equations, obscure mathematical symbols, and unfamiliar terminology. It's a nightmare! Much of the DSP literature is baffling even to those experienced in the field. It's not that there is anything wrong with this material, it is just intended for a very specialized audience. State-of-the-art researchers need this kind of detailed mathematics to understand the theoretical implications of the work.

A basic premise of this book is that most practical DSP techniques can be learned and used without the traditional barriers of detailed mathematics and theory. The Scientist and Engineers Guide to Digital Signal Processing is written for those who want to use DSP as a tool, not a new career.

Monday, June 1, 2009

First post (Welcome)

Hi every body, today is 1 Jun, 2009. It's also birthday of Electronic Engineering Blog. Congratulation!
I decide to post every useful things about Electronics here and also happens that occur for me in the university.
I hope, posts of this blog would be useful for all of you. Thank you.