Thursday 30 November 2017

The future of electronics: New catalytic effect discovered for producing gallium oxide

Semiconducting oxides are a new class of materials that are currently enjoying great attention in the field of semiconductor technology. Gallium oxide is the archetypal example for its ability to handle extremely high voltages and its optical transparency in the deep ultraviolet region. Such components are based on very thin, ultrapure semiconductor layers produced by special deposition methods. Physicists have now drastically increased the yield of gallium oxide with a catalytic effect observed for the first time during crystal growth.

Squeezing light into a tiny channel brings optical computing a step closer

By forcing light to go through a smaller gap than ever before, researchers have paved the way for computers based on light instead of electronics.

'Magnetoelectric' material shows promise as memory for electronics

Smartphones and computers wouldn't be nearly as useful without room for lots of apps, music and videos. Devices tend to store that information in two ways: through electric fields (think of a flash drive) or through magnetic fields (like a computer's spinning hard disk). Each method has advantages and disadvantages. However, in the future, our electronics could benefit from the best of each, say researchers.

Build your own Christmas presents

How about giving self-built Christmas presents this year?

That’s what Robert will do.

He created three beautiful speakers for his kids:

I was curious, so I replied:

Hey Robert, Wow, those are beautiful. I’m sure your kids are going to love that. Did you build it with the TEA2025 chip?

And, turns out he did:

Thanks, I’m hoping they will. Yep used the 2025 chip and still have a lot left, got a good deal on them. With the speakers set at 45 degrees really gives it a good sound. Owe it all to you for the inspiration

The circuit required to build speakers like this is one of the easier amplifiers you can build. And I’ve written about it before:

http://ift.tt/2ApG2cp

These days, the TEA2025 chip is getting harder and harder to get your hands on.

Another chip you can use that is easier to find, is the LM386. Which I’ve created an Ohmify course for:

http://ift.tt/2irRltn

Keep On Soldering!
Oyvind @ build-electronic-circuits.com

Copyright Build Electronic Circuits

Description for 150 Watt Amplifier Circuit

Amplifiers are the one of the most commonly used circuits or devices in electronics.These are the basic building blocks in wireless communication and broadcasting, and other audio system which is used to enhance the characteristics of the signal. An amplifier can be defined as, is an electronic device which increases the input signal. It increases […]

The post Description for 150 Watt Amplifier Circuit appeared first on ElProCus - Electronic Projects for Engineering Students.

8051 Microcontroller Special Function Registers (SFRs)

In the previous 8051 Microcontroller Tutorial, we have seen the Instruction Set and Addressing Modes. In this tutorial, we will take a look at the 8051 Microcontroller Special Function Registers or SFRs.

If you remember from the 8051 Microcontroller Memory Organization Tutorial, the internal RAM or Data Memory of the 8051 Microcontroller is divided in to General Purpose Registers, Bit Addressable Registers, Register Banks and Special Function Registers or SFRs.

The 8051 Microcontroller Special Function Registers are used to program and control different hardware peripherals like Timers, Serial Port, I/O Ports etc. In fact, by manipulating the 8051 Microcontroller Special Function Registers (SFRs), you can assess or change the operating mode of the 8051 Microcontroller.

As a reminder, the following image shows you the basic structure of 8051 Microcontroller’s Internal RAM.

8051 Microcontroller Special Function Registers (SFRs) Image 1

8051 Microcontroller Special Function Registers (SFRs)

The 8051 Microcontroller Special Function Registers act as a control table that monitor and control the operation of the 8051 Microcontroller. If you observe in Internal RAM Structure, the Address Space from 80H to FFH is allocated to SFRs.

Out of these 128 Memory Locations (80H to FFH), there are only 21 locations that are actually assigned to SFRs. Each SFR has one Byte Address and also a unique name which specifies its purpose.

Since the SFRs are a part of the Internal RAM Structure, you can access SFRs as if you access the Internal RAM. The main difference is the address space: first 128 Bytes (00H to 7FH) is for regular Internal RAM and next 128 Bytes (80H to FFH) is for SFRs.

TIP: As only 21 of the possible 128 SFR memory locations are assigned, it is recommended that the remaining registers or memory locations are not accessed during programming. 

Before going further, get an idea on 8051 MICROCONTROLLER ARCHITECTURE.

List of 8051 Microcontroller Special Function Registers

  • A or ACC
  • B
  • DPL
  • DPH
  • IE
  • IP
  • P0
  • P1
  • P2
  • P3
  • PCON
  • PSW
  • SCON
  • SBUF
  • SP
  • TMOD
  • TCON
  • TL0
  • TH0
  • TL1
  • TH1

Categories of 8051 Microcontroller Special Function Registers

All the 21 8051 Microcontroller Special Function Registers (SFRs) along with their functions and Internal RAM Address is given in the following table.

8051 Microcontroller Special Function Registers (SFRs) Image 2

There are many ways to categorize these 21 Special Function Registers but I find the following way as an appropriate one. The 21 Special Function Registers of 8051 Microcontroller are categorized in to seven groups. They are:

Math or CPU Registers: A and B

Status Register: PSW (Program Status Word)

Pointer Registers: DPTR (Data Pointer – DPL, DPH) and SP (Stack Pointer)

I/O Port Latches: P0 (Port 0), P1 (Port 1), P2 (Port 2) and P3 (Port 3)

Peripheral Control Registers: PCON, SCON, TCON, TMOD, IE and IP

Peripheral Data Registers: TL0, TH0, TL1, TH1 and SBUF

CPU or Math Registers

A or Accumulator (ACC)

The Accumulator or Register A is the most important and most used 8051 Microcontroller SFRs. The Register A is located at the address E0H in the SFR memory space. The Accumulator is used to hold the data for almost all the ALU Operations.

Some of the operations where the Accumulator is used are:

  • Arithmetic Operations like Addition, Subtraction, Multiplication etc.
  • Logical Operations like AND, OR, NOT etc.
  • Data Transfer Operations (between 8051 and External Memory)

The name “Accumulator” came from the fact this register is used to accumulate (or store) the result of all Arithmetic and most of the Logical Operations.

8051 Microcontroller Special Function Registers (SFRs) Image 3

B (Register B)

The B Register is used along with the ACC in Multiplication and Division operations. These two operations are performed on data that are stored only in Registers A and B. During Multiplication Operation, one of the operand (multiplier or multiplicand) is stores in B Register and also the higher byte of the result.

In case of Division Operation, the B Register holds the divisor and also the remainder of the result. It can also be used as a General Purpose Register for normal operations and is often used as an Auxiliary Register by Programmers to store temporary results.

Register B is located at the address F0H of the SFR Address Space.

8051 Microcontroller Special Function Registers (SFRs) Image 4

Program Status Word (PSW)

The PSW or Program Status Word Register is also called as Flag Register and is one of the important SFRs. The PSW Register consists of Flag Bits, which help the programmer in checking the condition of the result and also make decisions.

Flags are 1-bit storage elements that store and indicate the nature of the result that is generated by execution of certain instructions. The following image shows the contents of the PSW Register.

8051 Microcontroller Special Function Registers (SFRs) Image 5

The following table describes the function of each flag.

8051 Microcontroller Special Function Registers (SFRs) Image 6

Pointer Registers

Data Pointer (DPTR – DPL and DPH)

The Data Pointer is a 16-bit Register and is physically the combination of DPL (Data Pointer Low) and DPH (Data Pointer High) SFRs. The Data Pointer can be used as a single 16-bit register (as DPTR) or two 8-bit registers (as DPL and DPH).

DPTR doesn’t have a physical Memory Address but the DPL (Lower Byte of DPTR) and DPH (Higher Byte of DPTR) have separate addresses in the SFR Memory Space. DPL = 82H and DPH = 83H.

The DPTR Register is used by the programmer addressing external memory (Program – ROM or Data – RAM).

8051 Microcontroller Special Function Registers (SFRs) Image 7_1

Stack Pointer (SP)

SP or Stack Pointer points out to the top of the Stack and it indicates the next data to be accessed. Stack Pointer can be accesses using PUSH, POP, CALL and RET Instructions. The Stack Pointer is an 8-bit register and upon reset, the Stack Pointer is initialized with 07H.

When writing a new data byte into the stack, the SP (Stack Pointer) is automatically incremented by 1 and the new data is written at an address SP+1. When reading data from stack, the data is retrieved from the Address in SP and after that the SP is decremented by 1 (SP-1).

8051 Microcontroller Special Function Registers (SFRs) Image 8_1

I/O Port Registers (P0, P1, P2 and P3)

The 8051 Microcontroller four Ports which can be used as Input and/or Output. These four ports are P0, P1, P2 and P3. Each Port has a corresponding register with same names (the Port Registers are also P0, P1, P2 and P3). The addresses of the Port Registers are as follows: P0 – 80H, P1 – 90H, P2 – A0H and P2 – B0H.

Each bit in these SFRs corresponds to one physical Pin in the 8051 Microcontroller. All these Port Registers are both Bit Addressable and Byte Addressable. Writing 1 or 0 on a Port Register Bit will reflect as an appropriate voltage (5V and 0V) on the corresponding Pin.

If a Port Bit is SET (declared as 1), the corresponding Port Pin will be configured as Input and similarly if a Port Bit is CLEARED (declared as 0), the corresponding Port Pin is configured as Output. Upon reset, all the Port Bits are SET (1) and hence, all the Port Pins are configured as Inputs.

8051 Microcontroller Special Function Registers (SFRs) Image 9_1

Peripheral Control Registers

PCON (Power Control)

The PCON or Power Control register, as the name suggests is used to control the 8051 Microcontroller’s Power Modes and is located at 87H of the SFR Memory Space. Using two bits in the PCON Register, the microcontroller can be set to Idle Mode and Power Down Mode.

During Idle Mode, the Microcontroller will stop the Clock Signal to the ALU (CPU) but it is given to other peripherals like Timer, Serial, Interrupts, etc. In order to terminate the Idle Mode, you have to use an Interrupt or Hardware Reset.

In the Power Down Mode, the oscillator will be stopped and the power will be reduced to 2V. To terminate the Power Down Mode, you have to use the Hardware Reset.

Apart from these two, the PCON Register can also be used for few additional purposes. The SMOD Bit in the PCON Register is used to control the Baud Rate of the Serial Port.

There are two general purpose Flag Bits in the PCON Register, which can be used by the programmer during execution.

8051 Microcontroller Special Function Registers (SFRs) Image 10_1

SCON (Serial Control)

The Serial Control or SCON SFR is used to control the 8051 Microcontroller’s Serial Port. It is located as an address of 98H. Using SCON, you can control the Operation Modes of the Serial Port, Baud Rate of the Serial Port and Send or Receive Data using Serial Port.

SCON Register also consists of bits that are automatically SET when a byte of data is transmitted or received.

8051 Microcontroller Special Function Registers (SFRs) Image 11

Serial Port Mode Control Bits

SM0

SM1 Mode Description

Baud Rate

0

0 0 8-Bit Synchronous Shift Register Mode

Fixed Baud Rate

( Frequency of oscillator / 12)

0

1 1 8-bit Standard UART

mode

Variable Baud Rate (Can be set by Timer 1)

1

0 2 9-bit Multiprocessor Comm. mode

Fixed Baud Rate

( Frequency of oscillator / 32 or Frequency of oscillator / 64

1

1 3 9-bit Multiprocessor Comm. mode

Variable Baud Rate (Can be set by Timer 1)

TCON (Timer Control)

Timer Control or TCON Register is used to start or stop the Timers of 8051 Microcontroller. It also contains bits to indicate if the Timers has overflowed. The TCON SFR also consists of Interrupt related bits.

8051 Microcontroller Special Function Registers (SFRs) Image 12

TMOD (Timer Mode)

The TMOD or Timer Mode register or SFR is used to set the Operating Modes of the Timers T0 and T1. The lower four bits are used to configure Timer0 and the higher four bits are used to configure Timer1.

8051 Microcontroller Special Function Registers (SFRs) Image 13

The Gatex bit is used to operate the Timerx with respect to the INTx pin or regardless of the INTx pin.

GATE1 = 1 ==> Timer1 is operated only if INT1 is SET.

GATE1 = 0 ==> Timer1 is operates irrespective of INT1 pin.

GATE0 = 1 ==> Timer0 is operated only if INT0 is SET.

GATE0 = 0 ==> Timer0 is operates irrespective of INT0 pin.

The C/Tx bit is used selects the source of pulses for the Timer to count.

C/T1 = 1 ==> Timer1 counts pulses from Pin T1 (P3.5) (Counter Mode)

C/T1 = 0 ==> Timer1 counts pulses from internal oscillator (Timer Mode)

C/T0 = 1 ==> Timer0 counts pulses from Pin T0 (P3.4) (Counter Mode)

C/T0 = 0 ==> Timer0 counts pulses from internal oscillator (Timer Mode)

TxM0

TxM1 Mode

Description

0

0 0

13-bit Timer Mode (THx – 8-bit and TLx – 5-bit)

0

1 1

16-bit Timer Mode

1

0 2

8-bit Auto Reload Timer Mode

1

1 3

Two 8-bit Timer Mode or Split Timer Mode

NOTE: x = 0 for Timer 0 and x = 1 for Timer 1.

IE (Interrupt Enable)

The IE or Interrupt Enable Register is used to enable or disable individual interrupts. If a bit is SET, the corresponding interrupt is enabled and if the bit is cleared, the interrupt is disabled. The Bit7 of the IE register i.e. EA bit is used to enable or disable all the interrupts.

8051 Microcontroller Special Function Registers (SFRs) Image 14

IP (Interrupt Priority)

The IP or Interrupt Priority Register is used to set the priority of the interrupt as High or Low. If a bit is CLEARED, the corresponding interrupt is assigned low priority and if the bit is SET, the interrupt is assigned high priority.

8051 Microcontroller Special Function Registers (SFRs) Image 15

Peripheral Data Registers

SBUF (Serial Data Buffer)

The Serial Buffer or SBUF register is used to hold the serial data while transmission or reception.

8051 Microcontroller Special Function Registers (SFRs) Image 16

TL0/TH0 (Timer 0 Low/High)

The Timer 0 consists of two SFRs: TL0 and TH0. The TL0 is the lower byte and the TH0 is the higher byte and together they form a 16-bit Timer0 Register.

8051 Microcontroller Special Function Registers (SFRs) Image 17

TL1/TH1 (Timer 1 Low/High)

The TL1 and TH1 are the lower and higher bytes of the Timer 0.

8051 Microcontroller Special Function Registers (SFRs) Image 18

In this tutorial, we have seen the 8051 Microcontroller Special Function Registers (SFRs), their addresses, structures, reset values etc.

 

The post 8051 Microcontroller Special Function Registers (SFRs) appeared first on Electronics Hub.

Wednesday 29 November 2017

A transistor of graphene nanoribbons

Transistors based on carbon nanostructures: what sounds like a futuristic dream could be reality in just a few years' time. Scientists have now produced nanotransistors from graphene ribbons that are only a few atoms wide.

The ultimate defense against hackers may be just a few atoms thick

The next generation of electronic hardware security may be at hand as researchers introduce a new class of unclonable cybersecurity security primitives made of a low-cost nanomaterial with the highest possible level of structural randomness. Randomness is highly desirable for constructing the security primitives that encrypt and thereby secure computer hardware and data physically, rather than by programming.

Tuesday 28 November 2017

Quantum-emitting answer might lie in the solution

Lead trihalide perovskite nanocrystals are promising candidates as light sources. Coupling quantum emitters with nanophotonic cavities can significantly boost efficiency, but this approach hasn't been explored with these nanocrystals. Now, researchers have demonstrated a simple approach for coupling solution-synthesized cesium lead tribromide perovskite nanocrystals to silicon nitride photonic cavities. The resulting room temperature light emission is enhanced by an order of magnitude above what perovskites can emit alone.

Monday 27 November 2017

New method benchmarks organic mixed conductors

New materials were used by researchers in organic electrochemical transistors to test and compare their performances for different applications.

How to Make a Blinking LED using a 555 Timer IC?

This article explains the circuit design for blinking LED using a 555 timer IC. This is a simple circuit designed to explain the working and use of a 555 timer IC. This circuit is designed using a low power consumption output device, a red LED. There are many applications of 555 timers, generally used in Lamp […]

The post How to Make a Blinking LED using a 555 Timer IC? appeared first on ElProCus - Electronic Projects for Engineering Students.

Saturday 25 November 2017

8051 Microcontroller Assembly Language Programming

In the previous 8051 Microcontroller Tutorial, we have seen about the 8051 Microcontroller Instruction Set and Addressing Modes. In this tutorial, we will take a look at the 8051 Microcontroller Assembly Language Programming, the structure of 8051 Assembly Language, example programs, etc.

Before going into the details of the 8051 Microcontroller Assembly Language and Programming, let us get a brief idea about Programming Language in general (specific to Microcontrollers) and also types of Programming Languages.

What is a Programming Language?

Programming in the sense of Microcontrollers (or any computer) means writing a sequence of instructions that are executed by the processor in a particular order to perform a predefined task. Programming also involves debugging and troubleshooting of instructions and instruction sequence to make sure that the desired task is performed.

Like any language, Programming Languages have certain words, grammar and rules. There are three types or levels of Programming Languages for 8051 Microcontroller. These levels are based on how closely the statements in the language resemble the operations or tasks performed by the Microcontroller.

The three levels of Programming Languages are:

  • Machine Language
  • Assembly Language
  • High-level Language

8051 Microcontroller Assembly Language Image 2

Machine language

In Machine language or Machine Code, the instructions are written in binary bit patterns i.e. combination of binary digits 1 and 0, which are stored as HIGH and LOW Voltage Levels. This is the lowest level of programming languages and is the language that a Microcontroller or Microprocessor actually understands.

Assembly Language

The next level of Programming Language is the Assembly Language. Since Machine Language or Code involves all the instructions in 1’s and 0’s, it is very difficult for humans to program using it.

Assembly Language is a pseudo-English representation of the Machine Language. The 8051 Microcontroller Assembly Language is a combination of English like words called Mnemonics and Hexadecimal codes.

It is also a low level language and requires extensive understanding of the architecture of the Microcontroller.

High-level Language

The name High-level language means that you need not worry about the architecture or other internal details of a microcontroller and they use words and statements that are easily understood by humans.

Few examples of High-level Languages are BASIC, C Pascal, C++ and Java. A program called Compiler will convert the Programs written in High-level languages to Machine Code.

Why Assembly Language?

Although High-level languages are easy to work with, the following reasons point out the advantage of Assembly Language

  • The Programs written in Assembly gets executed faster and they occupy less memory.
  • With the help of Assembly Language, you can directly exploit all the features of a Microcontroller.
  • Using Assembly Language, you can have direct and accurate control of all the Microcontroller’s resources like I/O Ports, RAM, SFRs, etc.
  • Compared to High-level Languages, Assembly Language has less rules and restrictions.

Also read this interesting article: 8051 MICROCONTROLLER INSTRUCTION SET

Structure of the 8051 Microcontroller Assembly Language

The Structure or Syntax of the 8051 Microcontroller Assembly Language is discussed here. Each line or statement of the assembly language program of 8051 Microcontroller consists of three fields: Label, Instruction and Comments.

The arrangement of these fields or the order in which they appear is shown below.

[Label:]            Instructions                 [//Comments]

NOTE: The brackets for Label and Comments mean that these fields are optional and may not be used in all statements in a program.

Before seeing about these three fields, let us first see an example of how a typical statement or line in an 8051 Microcontroller Assembly Language looks like.

 TESTLABEL:   MOV A, 24H   ; THIS IS A SAMPLE COMMENT 

In the above statement, the “TESTLABEL” is the name of the Label, “MOV A, 24H” is the Instruction and the “THIS IS A SAMPLE COMMENT” is a Comment.

8051 Microcontroller Assembly Language Image 3

Label

The Label is programmer chosen name for a Memory Location or a statement in a program. The Label part of the statement is optional and if present, the Label must be terminated with a Colon (:).

An important point to remember while selecting a name for the Label is that they should reduce the need for documentation.

Instruction

The Instruction is the main part of the 8051 Microcontroller Assembly Language Programming as it is responsible for the task performed by the Microcontroller. Any Instruction in the Assembly Language consists of two parts: Op-code and Operand(s).

8051 Microcontroller Assembly Language Image 4

The first part of the Instruction is the Op-code, which is short for Operation Code, specifies the operation to be performed by the Microcontroller. Op-codes in Assembly Language are called as Mnemonics. Op-codes are in binary format (used in Machine Language) while the Mnemonic (which are equivalent to Op-codes) are English like statements.

The second part of the instruction is called the Operand(s) and it represents the Data on which the operation is performed. There are two types of Operands: the Source Operand and the Destination Operand. The Source Operand is the Input of the operation and the Destination Operand is where the result is stored.

Comments

The last part of the Structure of 8051 Assembly Language is the Comments. Comments are statements included by the developer for easier understanding of the code and is used for proper documentation of the Program.

Comments are optional and if used, they must begin with a semicolon (;) or double slash (//) depending on the Assembler.

The following statements will show a few possible ways of using Label, Instruction and Comments.

Label without instruction and comment:   LABEL:

Line with Label and Instruction:                  LABEL: MOV A, 22H

Line with Instruction and Comment:                          MOV A, 22H ; THIS IS A COMMENT

Line with Label and Comment:                     LABEL:                          ; THIS IS A COMMENT

Line with only Comment:                                                                        ; THIS IS A COMMENT

Also read: 8051 MICROCONTROLLER ARCHITECTURE

8051 Microcontroller Assembly Language Directives

Assembly Language Directives are not the instructions to the 8051 Microcontroller Assembler even though they are written in the Mnemonic field of the program. Assembly Language Directives are actually instructions to the Assembler and directs the Assembler Program what to do during the process of Assembling.

The Assembly Language Directives do not have any effect on the contents of the 8051 Microcontroller Memory (except DB and DW directives).

These Directives are dependent on the Assembler Program and in case of ASM51 Assembler, the following are the categories of Directives.

8051 Microcontroller Assembly Language Image 1

We will now see about few of the important and frequently used Assembly Language Directives.

ORG – Set Origin

The 8051 Microcontroller Assembly   Language Program will start assembling from the Program Memory Address 0000H. This is also the address from which the 8051 Microcontroller will start executing the code.

In order place the Program and Data anywhere in the Address Space of the 8051 Microcontroller, you can use the ORG Directive.

Examples

ORG 0000H               ; Tells the Assembler to assemble the next statement at 0000H

LJMP MAIN              ; Code Memory at 0000H. Jump to MAIN.

ORG 000BH               ; Tells the Assembler to assemble the next statement at 000BH

MAIN: NOP               ; Code Memory at 000BH. MAIN starts here.

DB – Define Byte

The DB Directive is used to define a Byte type variable. Using this directive, you can define data in Decimal, Binary, HEX or ASCII formats. There should be a suffix of ‘B’ for binary and ‘H’ for HEX. The ASCII Characters are placed in single quotation marks (like ‘string’).

Examples

ORG 0000H

DB 10                         ; Define Byte 10 (Decimal) and store at 0000H

DB 30H                      ; Define Byte 30 (HEX) and store at 0001H

DB ‘STRING’             ; Define String ‘STRING’ and store at 0002H to 0007H

DB 00001111B           ; Define Byte 00001111 (Binary) and store at 0008H

DB 1234H                  ; Define Byte 34 (HEX) and store at 0009H. Only lower byte is

                                      accepted as DB can allocate only a Byte of Memory.

DW – Define Word

The Define Word (DW) Directive is used to include a 16-bit data in a program. The functionality of DW is similar to that of DB except that DW generates 16-bit values.

EQU – Equate

Using the EQU Directive, you can associate a Symbol (or Label) with a Value.

Examples

TMP EQU #30                      ; Assigns the value #30 to the name TMP

RED_LED EQU P1.0           ; P1.0 is defined as RED_LED

END

The END Directive is used to stop the assembling process. This should be the last statement in the program. END Directive cannot have a Label and the statements beyond END will not be processed by the Assembler.

Example

ORG 0000H

MOV A, 20H

MOV R0, #30

END

Examples of 8051 Microcontroller Assembly Language Programming

Example 1

The following is a simple Assembly Language for 8051 Microcontroller which copies the data from R0 of Bank0 to R0 of Bank3.

ORG 00H

MOV R0, #33H

MOV A, R0

SETB PSW.3

SETB PSW.4

MOV R0, A

END

Example 2

In the next example, you can Toggle the LEDs ON and OFF (Blinking LEDs) that are connected to PORT1 of the 8051 Microcontroller.

In this tutorial, we have seen about the basics of 8051 Microcontroller Assembly Language Programming, the Structure of Assembly Language for 8051, Assembly Language Directives and few examples.

The post 8051 Microcontroller Assembly Language Programming appeared first on Electronics Hub.

Friday 24 November 2017

important ferromagnetic semiconductor synthesized

Scientists have developed a method for synthesizing Europium (II) oxide nanoparticles -- a ferromagnetic semiconductor that is relevant for data storage and data transport.

Thursday 23 November 2017

8051 Microcontroller Instruction Set

In the previous tutorial on 8051 Microcontroller, we have seen the Introduction of 8051, the Architecture of 8051 and the Memory Organization of the 8051 Microcontroller. Continuing further, we will take a look at the 8051 Microcontroller Instruction Set and the 8051 Addressing Modes in this tutorial.

Introduction to 8051 Microcontroller Instruction Set

Writing a Program for any Microcontroller consists of giving commands to the Microcontroller in a particular order in which they must be executed in order to perform a specific task. The commands to the Microcontroller are known as a Microcontroller’s Instruction Set.

Just as our sentences are made of words, a Microcontroller’s (for that matter, any computer) program is made of Instructions. Instructions written in a program tell the Microcontroller which operation to carry out.

An Instruction Set is unique to a family of computers. This tutorial introduces the 8051 Microcontroller Instruction Set also called as the MCS-51 Instruction Set.

As the 8051 family of Microcontrollers are 8-bit processors, the 8051 Microcontroller Instruction Set is optimized for 8-bit control applications. As a typical 8-bit processor, the 8051 Microcontroller instructions have 8-bit Opcodes. As a result, the 8051 Microcontroller instruction set can have up to 28 = 256 Instructions.

Before going into details of 8051 Microcontroller Instruction Set, read this: 8051 MICROCONTROLLER MEMORY ORGANIZATION.

A Brief Look at 8051 Microcontroller Instructions and Groups

Before going into the details of the 8051 Microcontroller Instruction Set, Types of Instructions and the Addressing Mode, let us take a brief look at the instructions and the instruction groups of the 8051 Microcontroller Instruction Set (the MCS-51 Instruction Set).

The following table shows the 8051 Instruction Groups and Instructions in each group. There are 49 Instruction Mnemonics in the 8051 Microcontroller Instruction Set and these 49 Mnemonics are divided into five groups.

DATA TRANSFER ARITHMETIC LOGICAL BOOLEAN PROGRAM BRANCHING
MOV ADD ANL CLR LJMP
MOVC ADDC ORL SETB AJMP
MOVX SUBB XRL MOV SJMP
PUSH INC CLR JC JZ
POP DEC CPL JNC JNZ
XCH MUL RL JB CJNE
XCHD DIV RLC JNB DJNZ
  DA A RR JBC NOP
    RRC ANL LCALL
    SWAP ORL ACALL
      CPL RET
        RETI
        JMP

8051 Addressing Modes

What is an Addressing Mode?

An Addressing Mode is a way to locate a target Data, which is also called as Operand. The 8051 Family of Microcontrollers allows five types of Addressing Modes for addressing the Operands. They are:

  • Immediate Addressing
  • Register Addressing
  • Direct Addressing
  • Register – Indirect Addressing
  • Indexed Addressing

Immediate Addressing

In Immediate Addressing mode, the operand, which follows the Opcode, is a constant data of either 8 or 16 bits. The name Immediate Addressing came from the fact that the constant data to be stored in the memory immediately follows the Opcode.

The constant value to be stored is specified in the instruction itself rather than taking from a register. The destination register to which the constant data must be copied should be the same size as the operand mentioned in the instruction.

Example:  MOV A, #030H 

Here, the Accumulator is loaded with 30 (hexadecimal). The # in the operand indicates that it is a data and not the address of a Register.

Immediate Addressing is very fast as the data to be loaded is given in the instruction itself.

Register Addressing

In the 8051 Microcontroller Memory Organization Tutorial, we have seen the organization of RAM and four banks of Working Registers with eight Registers in each bank.

In Register Addressing mode, one of the eight registers (R0 – R7) is specified as Operand in the Instruction.

It is important to select the appropriate Bank with the help of PSW Register. Let us see a example of Register Addressing assuming that Bank0 is selected.

Example:  MOV A, R5 

Here, the 8-bit content of the Register R5 of Bank0 is moved to the Accumulator.

Direct Addressing

In Direct Addressing Mode, the address of the data is specified as the Operand in the instruction. Using Direct Addressing Mode, we can access any register or on-chip variable. This includes general purpose RAM, SFRs, I/O Ports, Control registers.

Example:  MOV A, 47H 

Here, the data in the RAM location 47H is moved to the Accumulator.

Register Indirect Addressing

In the Indirect Addressing Mode or Register Indirect Addressing Mode, the address of the Operand is specified as the content of a Register. This will be clearer with an example.

Example:  MOV A, @R1 

The @ symbol indicates that the addressing mode is indirect. If the contents of R1 is 56H, for example, then the operand is in the internal RAM location 56H. If the contents of the RAM location 56H is 24H, then 24H is moved into accumulator.

Only R0 and R1 are allowed in Indirect Addressing Mode. These register in the indirect addressing mode are called as Pointer registers.

Indexed Addressing Mode

With Indexed Addressing Mode, the effective address of the Operand is the sum of a base register and an offset register. The Base Register can be either Data Pointer (DPTR) or Program Counter (PC) while the Offset register is the Accumulator (A).

In Indexed Addressing Mode, only MOVC and JMP instructions can be used. Indexed Addressing Mode is useful when retrieving data from look-up tables.

Example:  MOVC A, @A+DPTR 

Here, the address for the operand is the sum of contents of DPTR and Accumulator.

NOTE: Some authors and textbooks add few other Addressing Modes like Absolute Addressing Mode, Relative Addressing Mode and Long Addressing Mode.

Also read: 8051 MICROCONTROLLER ARCHITECTURE.

Types of Instructions in 8051 Microcontroller Instruction Set

Before seeing the types of instructions, let us see the structure of the 8051 Microcontroller Instruction. An 8051 Instruction consists of an Opcode (short of Operation – Code) followed by Operand(s) of size Zero Byte, One Byte or Two Bytes.

The Op-Code part of the instruction contains the Mnemonic, which specifies the type of operation to be performed. All Mnemonics or the Opcode part of the instruction are of One Byte size.

Coming to the Operand part of the instruction, it defines the data being processed by the instructions. The operand can be any of the following:

  • No Operand
  • Data value
  • I/O Port
  • Memory Location
  • CPU register

There can multiple operands and the format of instruction is as follows:

 MNEMONIC DESTINATION OPERAND, SOURCE OPERAND 

A simple instruction consists of just the opcode. Other instructions may include one or more operands. Instruction can be one-byte instruction, which contains only opcode, or two-byte instructions, where the second byte is the operand or three byte instructions, where the operand makes up the second and third byte.

Based on the operation they perform, all the instructions in the 8051 Microcontroller Instruction Set are divided into five groups. They are:

  • Data Transfer Instructions
  • Arithmetic Instructions
  • Logical Instructions
  • Boolean or Bit Manipulation Instructions
  • Program Branching Instructions

We will now see about these instructions briefly.

Data Transfer Instructions

The Data Transfer Instructions are associated with transfer with data between registers or external program memory or external data memory. The Mnemonics associated with Data Transfer are given below.

  • MOV
  • MOVC
  • MOVX
  • PUSH
  • POP
  • XCH
  • XCHD

The following table lists out all the possible data transfer instruction along with other details like addressing mode, size occupied and number machine cycles it takes.

Arithmetic Instructions

Using Arithmetic Instructions, you can perform addition, subtraction, multiplication and division. The arithmetic instructions also include increment by one, decrement by one and a special instruction called Decimal Adjust Accumulator.

The Mnemonics associated with the Arithmetic Instructions of the 8051 Microcontroller Instruction Set are:

  • ADD
  • ADDC
  • SUBB
  • INC
  • DEC
  • MUL
  • DIV
  • DA A

The arithmetic instructions has no knowledge about the data format i.e. signed, unsigned, ASCII, BCD, etc. Also, the operations performed by the arithmetic instructions affect flags like carry, overflow, zero, etc. in the PSW Register.

All the possible Mnemonics associated with Arithmetic Instructions are mentioned in the following table.

Logical Instructions

The next group of instructions are the Logical Instructions, which perform logical operations like AND, OR, XOR, NOT, Rotate, Clear and Swap. Logical Instruction are performed on Bytes of data on a bit-by-bit basis.

Mnemonics associated with Logical Instructions are as follows:

  • ANL
  • ORL
  • XRL
  • CLR
  • CPL
  • RL
  • RLC
  • RR
  • RRC
  • SWAP

The following table shows all the possible Mnemonics of the Logical Instructions.

Boolean or Bit Manipulation Instructions

As the name suggests, Boolean or Bit Manipulation Instructions will deal with bit variables. We know that there is a special bit-addressable area in the RAM and some of the Special Function Registers (SFRs) are also bit addressable.

The Mnemonics corresponding to the Boolean or Bit Manipulation instructions are:

  • CLR
  • SETB
  • MOV
  • JC
  • JNC
  • JB
  • JNB
  • JBC
  • ANL
  • ORL
  • CPL

These instructions can perform set, clear, and, or, complement etc. at bit level. All the possible mnemonics of the Boolean Instructions are specified in the following table.

Program Branching Instructions

The last group of instructions in the 8051 Microcontroller Instruction Set are the Program Branching Instructions. These instructions control the flow of program logic. The mnemonics of the Program Branching Instructions are as follows.

  • LJMP
  • AJMP
  • SJMP
  • JZ
  • JNZ
  • CJNE
  • DJNZ
  • NOP
  • LCALL
  • ACALL
  • RET
  • RETI
  • JMP

All these instructions, except the NOP (No Operation) affect the Program Counter (PC) in one way or other. Some of these instructions has decision making capability before transferring control to other part of the program.

The following table shows all the mnemonics with respect to the program branching instructions.

In this tutorial, we have seen the introduction to the 8051 Microcontroller Instruction Set, Addressing Modes in 8051 Microcontroller and different types of instructions in the Instruction Set of the 8051 Microcontroller.

The post 8051 Microcontroller Instruction Set appeared first on Electronics Hub.

Wednesday 22 November 2017

New composite material made of carbon nanotubes

Due to their unique properties, carbon nanotubes would be ideal for numerous applications, but to date they cannot be combined adequately with other materials, or they lose their beneficial properties. Scientists have developed an alternative method of combining, so they retain their characteristic properties. As such, they 'felt' the thread-like tubes into a stable 3-D network.

Different Types of Demultiplexers

A Demultiplexer is a data distributor read as DEMUX. It is quite opposite to multiplexer or MUX. It is a process of taking information from one input and transmitting over one of many outputs. This article explains different types of Demultiplexers. DEMUX are used to implement general-purpose logic systems. A demultiplexer takes one single input data […]

The post Different Types of Demultiplexers appeared first on ElProCus - Electronic Projects for Engineering Students.

See what my student Doug created

I love to hear real-life stories from my online students.

Some go on to make really cool hobby projects.

Others create a prototype, then launch their own company from it!

That’s exactly what Doug did.

I wanted to share his story to give you an idea of what’s possible – and also to help Doug spread the word about what he has created.

It’s best described through Doug’s own words from the email he sent me today:

Hello, Oyvind!

As I mentioned in our earlier email, I was involved in an IoT project for about 3 years. The project broke up due to a couple of “difficult personalities,” and everyone went their own separate ways.

I’m a software engineer and had very little hardware experience, but still had a great deal of interest in that side of the project. I also have a number of ideas that I think are viable products.

In order to get anywhere with the ideas, I’d either need a lot of money or I’d need to teach myself about electronics.

I was lucky enough to come across your blog at http://ift.tt/11eVn1Z, saw a link to Ohmify, and my trajectory completely changed.

I worked with every lesson on Ohmify, both in the guided course and the separate ones. Several of them, I went back and followed a second time to make sure I’d learned everything that I wanted. I didn’t learn enough to create a production-ready PCB design. I did learn enough to design my own proof of concept prototype and to intelligently discuss my needs with the designer I hired to turn my design into one ready for mass production. I was able to intelligently discuss my requirements, to read the schematic he created, and request changes that worked better for my product’s end goal.

There’s no way I could have done that without Ohmify.

Xeebot

Today, the Kickstarter for my product has launched. Xeebot is a Wi-Fi enabled home security sensor designed for people living in apartments, condominiums, dorms, or who are renting and don’t want to risk their security deposit by having wiring installed. The sensor will retail for $130 with professional call center monitoring that costs around $10 per month. Currently, there are 7 call centers in the US and Canada. If the product launches successfully, I’ll be able to expand into the EU, as well!

If you’d like to donate to the campaign, share it with people you know, or just read more about it, here is the link:

http://ift.tt/2zTBUBf

Thanks!
Doug

Ohmify is a digital school to help you learn to build things with electronics.

But it’s not possible to sign up right now.

That’s because I’ve been working on upgrading the courses for the last few months. And within a short time, I’ll open up the new version of Ohmify.

I need to fix a few technicalities before the launch, but I’ll send out some more info about it in the days to come.

Current students will get a free upgrade to the new version.

Keep On Soldering!
Oyvind @ build-electronic-circuits.com

Copyright Build Electronic Circuits

Tuesday 21 November 2017

Gesture Controlled Robot Using Raspberry Pi

Gesture Controlled Robot Using Raspberry Pi Have you ever tired of controlling everything with buttons? Thought of controlling something with simple hand movements by sitting on your lazy couch? If yes, then you are at the right site. In this tutorial we are going to control a robot driven by two DC motors by simply using hand movements. There are different kind of sensors to detect your hand movement like flux sensors, Accelerometers and other gravity based sensors. So for wireless transmission we are going to use RF 434 module which transmit 4 bit data. 4 bit data means you can transmit 16 different combinations i.e., 0000 to 1111. Further in this tutorial we will use an encoder and decoder to avoid interference in the air interface. A motor driver will drive the motors from using the decoder data.   We use our Raspberry pi at the transmitter end to analyze the sensor data and to transmit a data combination to the motor driver to drive the motors accordingly so that the robot can hover around. We will be using a 12 V battery on robot to power the decoder module, receiver module and the motors. At the transmitter end sensors and transmitter encoder module is powered by raspberry pi itself. Components Gesture Controlled Robot Using Raspberry Pi – Block Diagram Transmitter End   In transmitter side we have Accelerometer, raspberry pi , encoder module and RF transmitter. The gesture data flows from accelerometer to the raspberry pi and there it is processed to decide the movement of the robot and the data for motion is transferred to the encoder module via GPIO pins. The encoder module encodes the data and transmit into air interface with the help of RF transmitter. Gesture Controlled Robot Using Raspberry Pi – Receiver End     The RF receiver from the receiver end gets the data from the air interface and gives it to the decoder module. The decoder module decodes the received data and provides it to the motor driver L293D. From the motor driver the motors are driven according to the gesture data. Accelerometer Aceleration is the measurement of the change in velocity, or speed divided by time. For example if a car moves from rest 0 to 60 Km/hr in 10 seconds, the car is accelerating at 6Km/hr. So what it has to do with my hand gesture? An accelerometer is an electromechanical device used to measure acceleration forces. Such forces may be static, like the continuous force of gravity or, as is the case with many mobile devices, dynamic to sense movement or vibrations. By measuring the amount of static acceleration due to gravity, you can find out the angle the device is tilted at with respect to the earth. By sensing the amount of dynamic acceleration, you can analyze the way the device is moving. Some accelerometers use the piezoelectric effect -they contain microscopic crystal structures that get stressed by accelerative forces, which causes a voltage to be generated. Another way to do it is by sensing changes in capacitance. If you have two microstructures next to each other, they have a certain capacitance between them. If an accelerative force moves one of the structures, then the capacitance will change. Add some circuitry to convert from capacitance to voltage, and you will get an accelerometer. Accelerometers are low power devices which output acceleration in the form of Analog voltage and some accelerometers in digital form. Analog accelerometers like ADXL 335 gives you 3 analog output  X,Y,Z  base on the axis of your movement. You can convert these analog voltages...
read more

The post Gesture Controlled Robot Using Raspberry Pi appeared first on Electronic Circuits and Diagram-Electronics Projects and Design.

Topological insulators: One glimpse is enough

The Nobel Prize for physics in 2016 was awarded for the theory of topological matter. Topological insulators are new materials with special electronic properties and are of great fundamental and applications-oriented interest. Nevertheless, physicists have wrestled with a ten-year-old puzzle in which the results from the two best methods to probe their electronic states disagree. Researchers now know exactly why.

Nano-watch has steady hands

A new nanomechanical hand shows the time of an electronic clock, by spinning a tiny cylinder using light. A silicon nanorod, less than a thousandth of a millimetre long, can be trapped in thin air using focused laser beams, and spun to follow the ticking of a clock, losing only one-millionth of a second over four days.

Getting Started With Arduino and MPU6050

In this project, I’ll show you how the MPU6050 Sensor works and also how to interface Arduino with MPU6050. We will be interfacing an MPU-6050 breakout board with Arduino UNO and read the values from the Accelerometer and Gyroscope.

Before going in to the project, you need to understand a few basics of the MPU6050 Sensor. MPU-6050 is an IMU Sensor that contains a MEMS (Microelectromechanical System) Accelerometer and MEMS Gyroscope on a single chip.

Here, IMU Sensor, where IMU stands for Inertial Measurement Unit, is a device that measures the specific force using Accelerometer, angular rate using Gyroscope and magnetic field using Magnetometers.

IMU Sensors are used in self-balancing robots, aircrafts, mobile phones, tablets, spacecraft, satellites, drones, UAVs (unmanned aerial vehicles) etc. for guidance, position detection, orientation detection, motion tracking and flight control.

The two common IMUs are ADXL 335 Accelerometer and MPU-6050. The ADXL 335 contains a 3-axis Accelerometer.

In case of MPU-6050, it is a six-axis motion tracking device that combines a 3-axis Accelerometer and a 3-axis Gyroscope on a single chip. We will see more details about MPU6050 in the next section.

MPU6050 Image 1

Introduction to the MPU6050 Sensor

The MPU-6050 is a six-axis motion tracking device developed by InvenSense. The main features of the MPU6050 device are mentioned below.

  • Three – axis Accelerometer
  • Three – axis Gyroscope
  • Digital Output Temperature Sensor
  • Six 16-bit ADC (three for Accelerometer and three for Gyro)
  • Integrated Digital Motion Processor (DMP)
  • 1024B FIFO Buffer

The six-axis MPU-6050 is some time called as a 6 DoF (six Degrees of Freedom) device, as it provides six output values (three from Accelerometer and three from Gyro). The MPU-6050 can communicate using I2C Protocol.

Digital Motion Processor or the DMP is an embedded processor that can reduce the computational load from the host processor, like an Arduino, by acquiring and processing data from Accelerometer, Gyroscope and an external Magnetometer.

Interfacing MPU6050 with Arduino

As mentioned earlier, the MPU6050 supports only I2C Communication and hence, it must be connected only to the I2C Pins of the Arduino. The I2C pins of Arduino are multiplexed with the analog input pins A4 and A5 i.e. A4 is SDA and A5 is SCL.

MPU6050 Image Breakout Board

Coming to the MPU6050, we have used a normal breakout board that provided eight pins. The above image shows the schematic representation of the MPU6050 Breakout board.

In this, we will be using the SCL, SDA and the INT pins to connect with Arduino.

Components Required

Hardware

  • Arduino UNO
  • MPU6050 Breakout Board
  • Connecting Wires

Software

  • Arduino IDE
  • Processing (for 3D Visualization)

Circuit Diagram

The following image shows the circuit diagram for interfacing MPU6050 with Arduino UNO. As mentioned earlier, the interface between MPU6050 and Arduino must be implemented using I2C Protocol.

Hence, the SCL Pin of the Arduino (A5) is connected to the SCL Pin of the MPU6050. Similarly, the SDA Pin of the Arduino (A4) is connected to the SDA Pin of the MPU6050 board.

Additionally, we will be using the Interrupt feature of the MPU6050 to indicate (or interrupt) Arduino when the 1024 Byte FIFO buffer is full. So, connect the INT pin of the MPU6050 to the external interrupt 0 (INT0) pin of Arduino UNO i.e. Pin 2.

NOTE: In I2C Communication, the MPU-6050 always acts as a slave.

MPU6050 Image Circuit Diagram

Reading RAW Values from MPU6050

Before uploading the actual program, we will first see a simple program to read the raw values from the Accelerometer, Gyroscope and the Temperature Sensor. Simply connect the SCL and SDA wires of the MPU6050 to the corresponding I2C Pins of Arduino (A4 and A5) and upload the following code.

If you open the serial terminal, you will get the raw values from the Accelerometer and Gyroscope and calibrated Temperature from the Temperature Sensor. The data looks some thing like this.

MPU6050 Image 2

As you can see, reading the raw values from the MPU6050 sensor is easy but this data and we need to perform additional calculation on this data to get the Yaw, Pitch and Roll.

I’ve already mentioned that in MPU6050 sensor, there is a special processor called DMP or Digital Motion Processor that is embedded on the same chip as the accelerometer and gyro. The use of this DMP is that it can be programmed with a firmware for performing complex calculations on the data from the sensors.

But there is no clear documentation about the DMP from InvenSense’s side and as a result we are missing out on making fast calculations on the sensor’s data directly on the chip.

Jeff Rowberg and others has done an excellent job in reverse engineering the DMP related information from the I2C signal analysis.

Uploading the Code to Arduino and Testing MPU6050

Before uploading the code, we need to download two libraries for Arduino. They are I2Cdev and MPU6050. The download links and the official GitHub links are given below.

I2Cdev: DOWNLOAD I2CDEV LIBRARY or visit GitHub LINK

MPU6050: DOWNLOAD MPU6050 LIBRARY or visit GitHub LINK

Download the MPU6050 Library and extract the content by unzipping the downloaded file. You will get a folder with name “MPU6050”. Copy this folder and paste it in the libraries folder of Arduino.

In my case, it is located at “C:\Program Files (x86)\Arduino\libraries”. Do the same thing for I2Cdev library.

If everything goes well, open Arduino IDE and navigate through the following path: File -> Examples -> MPU6050 -> Examples -> MPU6050_DMP6 and open the example code MPU6050_DMP6.

MPU6050 Image 3

Upload this code to Arduino (assuming that you have already made the connections as per the circuit diagram) and once the code is uploaded, open the serial terminal.

Set the baud rate in the serial terminal to 115200 and you will get the following text.

Initializing DMP…

Initializing I2C devices…

Testing device connections…

MPU6050 connection successful

Send any character to begin DMP programming and demo:

If you don’t get any data or still getting garbage data, just reset the Arduino. If you look at the last sentence, it say “Send any character to begin DMP programming and demo”. So, type any character like 1 or a in the serial monitor and send it. As soon as you hit enter, you can start seeing the Yaw, Pitch and Roll (ypr) values on the serial monitor.

MPU6050 Image 4

NOTE: During this time, keep the MPU6050 on a stable and horizontal surface. Also, wait for 10 seconds for values from the MPU6050 to be stabilized.

3D Modeling in Processing based on values from Interfacing Arduino and MPU6050

In the next step of the project, we will take a look at 3D modeling the MPU6050 Sensor using Processing IDE, where you can view the 3D representation of the data from the sensor. Processing is a programming language and IDE that is developed for electronic arts and visual design. In fact, the Arduino IDE is also based on the Processing programming language.

To download the Processing IDE, visit this LINK. Download and Install Processing IDE using the given link.

After downloading the Processing IDE and installing it (simply unzip the contents from the downloaded zip file), you need to download a library for Processing called “Toxi”. You can download the Toxi Library from this LINK.

I’ve chosen the “toxiclibs-complete-0020” file. After downloading this file, extract the contents to a folder named “toxiclibs-complete-0020”.

Copy this folder and paste it in the libraries folder of the Processing. In my case, it was “C:\Users\Ravi\Documents\Processing\libraries”.

After copying the folder, you are now ready for 3D Modeling. First, you need to upload the previous Arduino code (MPU6050_DMP6) with few modifications.

Open the MPU6050_DMP6 (the example program which we uploaded earlier) in the Arduino IDE. Scroll down to the line that says the following.

#define OUTPUT_READABLE_YAWPITCHROLL

Comment this line by adding double forward slash in front of it.

//#define OUTPUT_READABLE_YAWPITCHROLL

Also, find the line that says  //#define OUTPUT_TEAPOT  and uncomment it by removing the double forward slash. Now, you can upload the code. What we modified in the code is instead of sending the data to the serial terminal, we are forwarding it to the Processing IDE.

Now, open Processing IDE and click on File -> Open. Now, navigate to the folder where the MPU6050 library is installed for Arduino. Open the Processing example with name “MPUTeapot”.

In my case, the location for this example is C:\Program Files (x86)\Arduino\libraries\MPU6050\Examples\MPU6050_DMP6\Processing\MPUTeapot.

This program has a provision for automatically selecting the PORT Number to which Arduino is connected. The line in the code associated with this is

String portName = Serial.list()[0];

Another way to specify the PORT number of Arduino is to manually enter the COM Port number. To do this, comment the above line and uncomment the following line and replace the COM Port number with appropriate COM Port Number to which Arduino is connected to.

//String portName = “COM4”;

Before hitting the run button in Processing, make sure that the Serial Monitor of Arduino IDE is closed. Now, click on run button in the processing IDE. You will get a window with a plane like structure. Wait for 10 seconds before 3D modeling the MPU6050.

The movements made by the MPU6050 can be seen through the 3D Object on the screen.

 

The post Getting Started With Arduino and MPU6050 appeared first on Electronics Hub.

New circuit boards can be repeatedly recycled

Researchers have developed a new PCB that performs on par with traditional materials and can be recycled repeatedly with negligible material...