CAPITULO 4 SECUENCIA DE PROGRAMACION - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

CAPITULO 4 SECUENCIA DE PROGRAMACION

Description:

Bus Control. TxD RxD. P0 P1 P2 P3. Address/Data. 8/28/09. Ing CARLOS MAFFRAND ... JZ destino ;Se testea el Acumulador. JNZ destino. DJNZ direct address, destino ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 15
Provided by: Charl95
Category:

less

Transcript and Presenter's Notes

Title: CAPITULO 4 SECUENCIA DE PROGRAMACION


1
CAPITULO 4SECUENCIA DE PROGRAMACION
  • SECUENCIA NORMAL DE PROGRAMACION
  • INSTRUCCIONES DE SALTO
  • SALTOS CONDICIONALES

2
DIAGRAMA INTERNO
External interrupts
On-chip ROM for program code
Timer/Counter
Interrupt Control
Timer 1
On-chip RAM
Timer 0
CPU
Serial Port
Bus Control
4 I/O Ports
OSC
TxD RxD
P0 P1 P2 P3
Address/Data
3
CIRCUITO OSCILADOR Y RESET
Vcc

10 uF
31
EA/VPP
X1
30 pF
19
11.0592 MHz
8.2 K
X2
18
30 pF
RST
9
uC 8051
4
VALORES DE RESET
Valor de Reset
Registro
0000
PC
0000
ACC
0000
B
0000
PSW
0007
SP
0000
DPTR
5
MEMORIA DE PROGRAMA
6
EJECUCION NORMAL DE PROGRAMA
7
INSTRUCCIONES DE SALTO
  • Control de la secuencia de programa
  • Se ejecuta cambiando el PC

gt PC-128
SJMP Destino Salto corto
PC ACTUAL
lt PC 127
8
INSTRUCCIONES DE SALTO
0K
LJMP Destino Salto largo
  • Instrucción de 3 Bytes
  • Rango 64KB

64K
AJMP Destino Salto absoluto
2K
  • Instrucción de 2 Bytes
  • Rango 2KB

4K
9
SALTOS CONDIONALES
  • Instrucción de 2 Bytes
  • Rango 127 -128

JZ Destino Salto corto
JNZ Destino Salto corto
En C If (var!0)
10
EJERCICIO
  • Leer el puerto P1 si es igual a cero salir si no
    sacar por el puerto 2 y continuar en el lazo

11
SALIDA DE LAZO USANDO CUENTA
DJNZ direct address, destino
  • Instrucción de 3 Bytes
  • Rango 127 / -128

En C for (varcuenta, var0, var--)
12
EJERCICIO
  • A) Diseñar un programa que genere un retardo de
    100uS. Suponga que la instrucción DJNZ se
    ejecuta en 1uS.
  • B) Diseñar un programa que genere un retardo de
    1mS. Construya un diagrama de flujo

13
COMPARE Y SALTE SI NO ES IGUAL
CJNE VAR 1, VAR2, DESTINO
  • Instrucción de 3 Bytes
  • Rango 127 / -128
  • LOS NUMEROS SE TOMAN COMO SIN SIGNO (unsigned)
  • VAR 1 es siempre el ACUMULADOR o registro
    interno R0 a R7

14
INSTRUCCIONES VISTAS
  • SJMP destino
  • AJMP destino
  • LJMP destino
  • JZ destino Se testea el
    Acumulador
  • JNZ destino
  • DJNZ direct address, destino
  • DJNZ Rn, destino R0 a R7
  • CJNE A, data, destino
  • CJNE A, direct address, destino
  • CJNE Rn, data, destino R0 a R7
Write a Comment
User Comments (0)
About PowerShow.com