Search This Blog

Friday, September 23, 2011

List of LCD instructions(ultra short)

Clear display
Return home
Entry mode set
Display On/off control
Cursor or Display shift
Function set
Set CG RAM address( CG = Character generator)
Set DD RAM address( DD = Display Data)
Read busy flag(BF) and address
Write data CG or DD RAM
Read data CG or DD RAM.

For further details of LCD stay connected.

MOVX dest-byte, source-byte

It moves external memory.
No flags are afffected.
This transfers data between external memory and register A.
this allows us to access external memory connected to the controller.
The address of external memory access can be either 8 bit or 16 bit.

For 16 bit
use DPTR.
like
MOVX A, @DPTR    ;

moves data from external memory stored at address DPTR to accumulator.
External data is moved into the CPU.

MOVX @DPTR, A    ;

moves data from Aaccumulator to address stored at DPTR.
data is moved from CPU to external memory.

For 8 bit
use R0 or R1 register.
like

MOVX A, @Ri ; WHERE i IS 0 OR 1

moves data from external memory stored at address Ri to accumulator.
External data is moved into the CPU.

MOVX @Ri, A ; WHERE i IS 0 OR 1

moves data from Aaccumulator to address stored at Ri.
data is moved from CPU to external memory.

The 16 bit is used for accessing external memory whereas 8 bit is used for accessing external I/O ports.

MOVC A, @A+DPTR

It moves code byte.
No flags are affected
This moves a byte of data located in program code ROM into Accumulator A.
This allows to create a lookup table of sorts in code space and read them into CPU.
The address of the desired byte in code space is formed by adding A + DPTR

Example:

ORG 0000
MOV DPTR, #200H    ;
LOOP : CLR A    ;
MOVC A,@A+DPTR    ; MOVE DATA @A+DPTR IN A
JZ EXIT        ;
MOV P1, A    ;
INC DPTR    ;
SJMP LOOP    ;
EXIT :
-----
-----
ORG 200H
DB 'A','B','C',0;
END

another example can be finding square or square root of numbers.
This is strictly used for on chip ROM. for off chip memory we use MOVX.


MOVC A, @A+PC

It moves code byte.
No flags are affected
Same as above instruction inly difference is that the PC is used instead of DPTR.

Example:

MOV A, R3    ;
INC A        ;
MOVC A, @A+PC    ;
RET
DB 0,1,4,9,16,25;

The following should be noted:

The program counter, which is pointing to the RET is taken for addition.
Always remember that always the next code value is taken in PC before adding to Accumulator A.
 This method is preferrable over "MOVC A, @A+DPTR" when we do not want to divide the program code space into 2 separate

areas of code and data. As a result we save considerable amount of space on chip

Differentiate between ADDC and SUBB

ADDC
Does addition with carry
changes OV, AC, CY flags
This does A = A + byte + CY
used in multibyte addition
example
addition of 3456H and 2345H

CLR C        ;CY =0
MOV A, #56H    ;
ADDC A, #45H    ;
MOV R7, A    ; STORE LOWER BYTE IN R7
MOV A, #34H    ;
ADDC A, #23H    ; UPPER BYTE

Result = 3456 + 2345 = 579B

Addressing modes
Immediate:         ADDC A, #data
Register:          ADDC A, Rn
Direct:            ADDC A, 30H
Register-Indirect:     ADDC A, @R0
            ADDC A, @R1

SUBB
Does subtraction with borrow
Changes OV, Ac, CY flags
This subtracts source byte and carry flag from accumulator and puts result in accumulator.
The steps for subtraction:
Take 2's complement
Add to A
Invert carry.

CY
dest>source 0 result is positive
dest=source 0 result is 0
dest<source 1 result is negative in 2's complement

No SUB instruction in 8051
A = A - byte - CY
example:
MOV A, #45H
CLR C
SUBB A, #23H
Result 22H

Addressing modes
Immediate:         SUBB A, #data
Register:          SUBB A, Rn
Direct:            SUBB A, 30H
Register-Indirect:     SUBB A, @R0
            SUBB A, @R1

Thursday, September 1, 2011

Atmel Product Based 8051 Architecture



Flash ISP single Core
The Atmel® AT89LP family takes 8051 microcontroller power to a new level. These high performance 8-bit microcontrollers execute most instructions in a single clock cycle, compared to 12 clock cycles in the classic 8051 CPU. At the same MIPS throughput as the classic 8051, existing applications can use a much lower clock frequency, enabling power consumption reduction by up to 80 percent. Application performance can be boosted up to 20 MIPS throughput 12 times faster than the traditional 8051 core.
For example AT89LP214, AT89LP215, AT89LP216 etc, etc.

Flash ISP (In system Programmable)
Atmel offers a variety of high performance Flash 8051 microcontrollers featuring in-system programming (ISP). Their integrated Flash memory can be programmed either in parallel mode or in serial mode with the appropriate parallel/ISP software, respectively.
They feature a wide range of internal RAM configurations, plus rich features such as interrupt controllers and timer/counters. Select models feature an A/D converter, Boot Flash memory, and Programmable Counter Arrays. Their highly efficient design can help reduce system power consumption by bringing the clock frequency down to any value — even DC — without loss of data.
Software-selectable modes of reduced activity and an 8 bit clock prescaler can further control power consumption.
The rich functionality and efficiency of Atmel 8051 Flash ISP microcontrollers make them ideal for applications that need A/D conversion, pulse width modulation, high speed I/O and counting capabilities such as industrial control, consumer goods, alarms, motor control, and more.
For example AT89C5115, AT89LS , AT89S series.
Flash Reprogrammable
Atmel offers several 8051 reprogrammable Flash microcontrollers that can support a variety of embedded applications. For example, the AT89C4051 is a low-voltage, high-performance CMOS 8-bit microcontroller with 4K bytes of Flash programmable and erasable read-only memory. The device is manufactured using Atmel's high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set.
For Example AT89C2051, AT89C5051 etc.

CAN Networking MCU'S
Introduced in 1986, Controller Area Network (CAN) technology was originally intended for automotive engine control communication. It has rapidly gained popularity to support a wide range of growing applications, including medical devices, avionics, factory and industrial automation, and maritime environments.
Atmel is well positioned to support CAN networking with a broad portfolio of 8051 microcontroller flash technology, together with extensive experience in CAN networking.
For example, the AT89C51CC01, AT89C51CC02, AT89C51CC03 deliver 5 MIPS at 5V, and 16KBytes to 64KBytes Flash. They can support a wide range of slave applications such as proximity sensor, DeviceNet I/O, textile machine I/O, and many other applications.
For low voltage applications, the following controllers maintain up to 3.3MIPS down to 2.7 volts.
The AT89C51CC02 with 16Kbytes Flash and 0.5Kbytes RAM + a simple 4 message objects CAN engine packaged into a Small Pin Count package is excellent for low end applications where a minimum DeviceNet or CANopen slave stacks are used. It is an ideal low cost product for a CAN controller push-button.
The AT89C51CC01 features 32Kbytes Flash and 1.2 Kbytes RAM, and is well-positioned for slave applications. It offers 2 Kbytes of Boot flash, with at least 3 MIPS remaining for the application on top of a CANopen or DeviceNet stack. The chip features an 8 channel 10 bit A/D converter, 3 timers, a 5-channel high speed input/output timer units, and 32 I/Os. Its 15 message objects and the 1.2Kbytes RAM make the chip suitable for complex I/O systems.
The AT89C51CC03 provides 64Kbytes Flash for application programs and 2Kbytes RAM for a larger object Dictionary. The built-in SPI port also assists communication with other devices. It features 15 message objects as well as 2Kbytes Bootloader and 2Kbytes EEPROM.
USB MCU'S
Built for today's increasingly connected applications, Atmel 8051 USB microcontrollers offer powerful interface options that are ideal for devices like Flash recorders, cameras, and cell phones. The AT89C5131A, a popular device in this series, offers an efficient combination of features and performance. It combines 32K bytes of Flash memory, 1.2K bytes RAM, 1K EEPROM, 7 USB Endpoints, TWI, SPI, UART, and Programmable Counter Array (PCA).
The AT89C5132 is a mass storage device controlling data exchange between various Flash modules, HDD and CD-ROM. It includes 64K Bytes of Flash memory and allows In-System Programming through an embedded 4K Bytes of Boot Flash Memory.
This versatile device provides all the necessary features for man-machine interface including, timers, keyboard port, serial or parallel interface (USB, SPI, IDE), ADC input, I2S output, and all external memory interface (NAND or NOR Flash, SmartMedia, MultiMedia, and DataFlash cards).
LIGHTING MCU'S
Optimized for lighting control applications, the Atmel AT83EB5114 is a high performance version of the 80C51 8-bit microcontroller in a low pin count package. It has all the features of the standard 80C51 with 4 Kbytes program memory, 256 bytes of internal RAM, a 7-source, 4-level interrupt system, an on-chip oscillator, and two timers/counters. The AT83EB5114 includes a serial two-wire interface EEPROM housed together with the microcontroller die in the same package.
ROMLESS
Atmel offers a powerful ROMless 8051 microcontroller suitable for existing ROMless applications that require a combination of performance, flexibility, and power efficiency. The AT80C51RD2 microcontroller retains all features of the Atmel 80C52, with 256 bytes of internal RAM, a 7- source 4-level interrupt controller, and three timer/counters.
To enhance system performance, this ROMless microcontroller features a programmable counter array, an XRAM of 1024 bytes, a hardware watchdog timer, and a keyboard interface. It also includes a versatile serial channel that facilitates multiprocessor communication (EUART), and a speed improvement mechanism (X2 mode).