Atmel vs Microchip

Estado
Cerrado para nuevas respuestas.
a mi secundaria llegaron unas placas multifuncionales super completas con detodo desde usb, displays,irda,wifi,serie,paralelo, etc etc
gobernadas por este micro
muy interesante
 
Meta dijo:
Muchos saben PIC, AVR, Motorola sin saber mucho de electrónica, ni Inglés.
Por eso encuentro preguntas tontas de por que me salia asi, Por la grafica del labview del adc me sale mal
hay muchos hobbistas apredieron a programar mirando a otros sin saber sus principios y como funcionan las cosas
en la electronica. Claro hay otros de la especialidad que solo estudian para pasar el ciclo nada mas.
 
Saludos, pues sucede que tengo un pequeño problema y este tema es el primero que salió en el buscador, así que me disculpo con anticipación si desvirtúo un poco. Sucede que soy estudiante de Ingeniería y este semestre voy a ver una materia que se llama sistemas microprocesados. Nosotros vamos a trabajar con el micro atmega16 de atmel. Pues sucede que me han pedido para laboratorio que investigue cuáles son las ayudas del avrstudio 4 y cuales son las principales características del ensamblador de este software. He estado buscando información por todo lado y puedo dar fe de lo que algunos indican en este foro: la información es poquísima en español, al contrario que en el caso de los PICs, de los que abundan libros en la biblioteca. Ya me descargué el programa y encontré algunas características pero nada de las "ayudas" del programa (de hecho no sé si se refiere a algún tipo de instrucciones o qué) y deseaba ver si alguien con experiencia puede darme una guía.

Además, me he leído todas las páginas del post y me parecieron muy interesantes y deseo plantearles una duda: ¿que opinan del hecho de que tengamos que usar el assembler, con esa cantidad de instrucciones, si nos hemos pasado la vida programando en C?, ¿Realmente representa una alternativa en algún momento a la programación en C?

Saludos
 
Javiaerandres

Además, me he leído todas las páginas del post y me parecieron muy interesantes y deseo plantearles una duda: ¿que opinan del hecho de que tengamos que usar el assembler, con esa cantidad de instrucciones, si nos hemos pasado la vida programando en C?, ¿Realmente representa una alternativa en algún momento a la programación en C?

Yo estoy empezando con el ensablador y tengo ya varios programas hechos, es cierto que tiene muchas instrucciones y si lo comparas con los pic es complicado pero es bastante interesante, por supuesto C es mas rapido pero yo usaria los dos.


P.D. Tal y como dije a partir de abril empezare a traducir este libro ya que es el mas util para principiantes.


Aunqe me llevará algun tiempo traducir tanto.

Un saludo
 
La subire a su debido momento, llevara su tiempo. Intentare poner mis propios ejemplos bien explicados y comentados.

Si alguien tiene programas o kiere ayudar, por mi encantado
 
Vi el libro. Es mucho para una sola persona.

Ni siquiera están traduciendo el datasheet del 16F628A que tantas ganas tenía en un principio. (Doy por hecho que abandonaron).

https://www.forosdeelectronica.com/about8516.html

Eso si, en otros foros ya están traduciendo el 12F629/675 y queda menos. Le hice un ejemplo en PDF y está muy agradecido porque se lo dejé bien.

Bueno, vamos a ver que vas hacer con esa traducción a tu manera, que tengas suerte.

Yo sigo haciendo manuales a mi manera.
http://electronica-pic.blogspot.com/

Saludo.
 
Perfecto, lo intentare hacer al estilo del " MICONTROLADOR PIC16F84, Desarrollo de proyectos" de RA-MA que esta muy completo y es con el que aprendi.

Tenia pensado usar proteus y el AVR AT90S2313, con el que tengo hechas 4 cosas y probablemente sea mas facil de conseguir que el AT90S1200 que ya esta en desuso.

los Tiny son faciles de conseguir y no hay mucha diferencia, tambien he buscado grabadores baratos y USB que hay pocos pero los hay.
 
Si ya tienes cosas hechas, entonces lo tienes más fácil de lo que creía.

[quote author=CesarS link=topic=185.msg901#msg901 date=1226158364]
Información general para AVR

Guia de productos ATMEL Descarga

AVR Studio 4.15 Descarga

WinAVR compilador GCC (se integra al AVR Studio) Descarga

AVRdelayloop Descarga

AVR Baud Rate Calculator

AVRCalc Descarga

Tutorial assembler para AVR AT90S2313 Flash

Fusibles AVR CGI

Programadores

Programador ISP

Programador para familia AT89S

STK200 y PonyProg

Información y proyectos con ATtiny11

Registros en ATtiny11 Descarga

LED intermitente con ATtiny11 Descarga

Tono con ATtiny11 Descarga

Motor Paso a Paso con ATtiny11 Descarga

INT0 en ATtiny11 Descarga

UART con ATtiny11 Descarga

Información y proyectos con AT90S1200

Curso básico de AT90S1200

LED intermitente con AT90S1200 usando variable Descarga

Información y proyectos con ATmega16

BCD-7SEG con ATmega16 Descarga


[/quote]
 
Borratodo los archivos temporales de tu navegador, las cookies no hace falta.

Carga la web completa y vete a los archivos temporales para tener el swf. Cuando lo tengas a tu escritorio, pincha dos veces sobre él para ejecutarlo, arriba pulsa Archivo-->Guardar como... o algo similar y se guarda en exe.

Está bien explicado, me dan gana de hacer algo parecido con el PIC el que sea.
 
La verdad es que es muy util, aunque no logro hacerlo, despues de borrar los archivos temporales de internet y cargar la página, vuelvo a mirar en la carpeta y no encuentro nada, solo los cookies
 
Mucha gracias Cristian, realmente me resultó muy útil la información. Pues bueno no me queda otra que empezar a aprender instrucciones, espero que como me dijo un amigo solo tenga que aprender unas cuantas como base ya que muchas instrucciones son variantes de éstas.

Saludos, Javier.
 
La verdad que el ASM de los AVR no se me dan nada bien.

Código:
;  ------  DALLAS DS1990A based lock ------
;  ------  Supports 9 keys + 1 master-key -----


;TARGET	= AT89C2051
DEBUG	= 0		;0-off, 1-rdfn ports, 2-on
#INCLUDE "LIBR51.ASM"	;8051 SFR set

CLK_KHZ	= 10000		;OSC frequency, KHZ
RTC_MS    = 20                ;system clock, MS

RTCV	= -(CLK_KHZ*RTC_MS)/12

;Macros:

#DEFINE LO(XXX) XXX & 0FFH
#DEFINE HI(XXX) (XXX >> 8) & 0FFH

#IF (DEBUG>1)
#INCLUDE "LIBDEF.ASM"
#ENDIF

;  ------ Constantes ------

MAXK	.EQU 9		;max number of keys
I2C_ADDR	.EQU 0A0H		;I2C address for 24C02 (A0,A1,A2=0)
TMATMV	.EQU 25		;x20mS TM access delay time
AENTMV	.EQU 2		;x20mS TM access enable delay
OPNTMV	.EQU 150		;x20mS open pulse duration
RETTMV	.EQU 250		;x20mS return to normal mode delay

;  ------ Ports ------

DDATA	.EQU P1		;display data port
KEYOP	.EQU INT0		;key OPEN
OWP	.EQU INT1		;1-Wire port
SDA	.EQU T0		;I2C SDA line
SCL	.EQU T1		;I2C SCL line
SOLEN	.EQU R		;solenoid control line
WD	.EQU T		;watchdog line
KEYSL	.EQU P3.7		;key SELECT

;  ------ Variables ------

;Bit addressing memory:

RTPC	.EQU 020H		;Real time program counter
T040M	.EQU O20H.0	;40mS  period bit
T080M	.EQU O20H.1	;80mS  period bit
T160M	.EQU O20H.2	;160mS period bit
T320M	.EQU O20H.3	;320mS period bit
T640M	.EQU O20H.4	;640mS period bit
T1S28	.EQU O20H.5	;1.28S period bit
T2S56	.EQU O20H.6	;2.56S period bit
T5S12	.EQU O20H.7	;5.12S period bit

RTPCS	.EQU 021H		;Real time program counter (100mS part)

FLAGS1	.EQU 022H
PROG	.EQU O22H.0	;program mode flag
SNUM	.EQU O22H.1	;set number flag
BLINK	.EQU O22H.2	;display blink bit
SLKPR	.EQU O22H.3	;SELECT press flag
OPNPR	.EQU O22H.4	;OPEN   press flag

;Internal Data Memory:

	.ORG 0030H	;data memory segment

ROMD	.DS 8		;touch memory ROM data
TEMP	.DS 1		;temporary byte (used in ACCESS90)

TMATM	.DS 1		;touch memory access timer
AENTM	.DS 1		;TM access enable timer
OPNTM	.DS 1		;open timer
RETTM	.DS 1		;return timer

NUM	.DS 1		;current PRG number (1..9)

;Debugger variables:

#IF (DEBUG>1)
DBGVA	.DS 1		;debugger variable address in internal memory
DBGVV	.DS 1		;debugger variable value   in internal memory
DBGA	.EQU 0FFFFH	;debugger address          in external memory
#ENDIF

STACK:			;stack location

;  ------ Vectors Area ------

	.ORG 0000H	;reset vector
	LJMP INIT
	.ORG 000BH	;INT TIMER 0 vector
	LJMP RTC

;  ------ Main Program ------

INIT:	MOV SP,#STACK	;stack init
#IF (DEBUG>1)
	DEBUGINIT		;debug init
#ENDIF

;Variables init:

	CLR A
	MOV FLAGS1,A	;clear flags 1
	MOV TMATM,A	;touch memory access timer clear
	MOV AENTM,A	;touch memory access delay timer clear
	MOV OPNTM,A	;open timer clear
	MOV RETTM,A	;return timer clear

;Periferal setup:

	CLR TR0		;timer 0 stop
	CLR TR1		;timer 1 stop
	MOV TMOD,#11H    	;timer 0 and timer 1 init
	MOV TL0,#LO(RTCV)  	;timer 0 load
	MOV TH0,#HI(RTCV)
	SETB TR0		;timer 0 start
	CLR PT0          	;int. timer 0 low priority
	SETB ET0		;int. timer 0 enable
	SETB EA		;interrupts enable

;  ------ Main Loop ------

;Read touch memory:

MAIN:	LCALL ACCESS90	;read touch memory
	JNC NOTCH		;no touch
	JB PROG,PRG	;jump to process PROG mode
	LCALL CHKMAS	;check for master code
	JC OPN
	LCALL CHKMEM	;check for member code
	JC OPN
	SJMP NOTCH
PRG:	LCALL PROGT	;process PROG mode when touch
	SJMP NOTCH
OPN:	LCALL OPEN	;open door

;Check open key:

NOTCH:	LCALL CHKOPK	;check open key
	JNC NOOPN
	LCALL OPEN	;open door

;Check select key:

NOOPN:	LCALL CHKSLK	;check select key
	JNC NOSEL
	LCALL PROGS	;process PROG mode when select

;Open timer check:

NOSEL:	MOV A,OPNTM
	JNZ NOCLS
	LCALL CLOSE	;solenoid off

;Return timer check:

NOCLS:	MOV A,RETTM
	JNZ NORET
	LCALL RETMD	;return to normal mode

;Display, watchdog wakeup:

NORET:	LCALL DISP	;display
	LCALL WAKEUP	;watchdog wakeup
	LJMP MAIN

;  ------ Subroutines Area ------

;Process PROG mode when touch:

PROGT:    JB SNUM,PRGT1	;SNUM = 1 ?
	LCALL CHKMAS	;check for master
	JC PRGT3
	RET

PRGT3:	SETB SNUM		;set "set number" flag
	CLR BLINK		;clear blink flag
	MOV NUM,#1	;clear number
	MOV RETTM,#RETTMV	;load return delay
	RET

PRGT1:	JB BLINK,PRGT2	;PROG = 1, BLINK = 0 ?
	SETB BLINK	;set blink flag
	MOV RETTM,#RETTMV	;load return delay
	RET

PRGT2:	LCALL SAVE	;NVM[NUM] <- new key
	CLR BLINK		;clear blink flag
	MOV RETTM,#RETTMV	;load return delay
	RET

;Process PROG mode when select:

PROGS:    JB PROG,PRGS1	;PROG = 1 ?
	SETB PROG		;set program mode flag
	CLR  SNUM		;clear "set number" flag
	CLR BLINK		;clear blink flag
	MOV RETTM,#RETTMV	;load return delay
	RET

PRGS1:    JNB SNUM,PRGS2	;SNUM = 0 ?
	CLR BLINK		;clear blink flag
	INC NUM		;NUM + 1
	MOV A,NUM
	CJNE A,#MAXK+1,PRGS2
	MOV NUM,#1
PRGS2:	MOV RETTM,#RETTMV	;load return delay
	RET

;Return to normal mode:

RETMD:	CLR BLINK		;clear blink flag
	CLR PROG		;clear program mode flag
	CLR SNUM		;clear "set number" flag
	RET

;Open door:

OPEN:	CLR SOLEN
	MOV OPNTM,#OPNTMV	;load open pulse duration
	RET

;Solenoid off:

CLOSE:	SETB SOLEN
	RET

;Check open key:
;Returns C=1 if pressed

CHKOPK:   JNB KEYOP,OP1	;jump if key OPEN pressed
	CLR OPNPR		;clear OPEN pressed flag
OP3:	CLR C
	RET

OP1:	JB OPNPR,OP2
	LCALL DEL15	;delay 15 mS
	JB KEYOP,OP3
	SETB OPNPR	;set OPEN pressed flag
OP2:	SETB C		;C <- 1 if key OPEN pressed
	RET

;Check select key:
;Returns C=1 if pressed

CHKSLK:   JNB KEYSL,SL1	;jump if key SELECT pressed
	CLR SLKPR		;clear SELECT pressed flag
SL2:	CLR C
	RET

SL1:	JB SLKPR,SL2
	LCALL DEL15	;delay 15 mS
	JB KEYSL,SL2
	SETB SLKPR	;set SELECT pressed flag
	SETB C		;C <- 1 if key SELECT pressed
	RET

;Watchdog wakeup:

WAKEUP:	MOV C,T040M
	MOV WD,C
	RET

;  ------ 1-Wire bus support ------

;Send reset pulse to OWP and receive presence pulse
;Out: C = 1 if OK

TRESET:   PUSH B
	CLR OWP		;OWP <- 0
	MOV B,#CLK_KHZ/48
	DJNZ B,$		;delay 500 uS
	CLR EA		;interrupt disable
	SETB OWP		;OWP <- 1  (0uS)

	MOV B,#CLK_KHZ/2000
	DJNZ B,$		;delay
	MOV C,OWP		;read OWP  (14 uS)
	JNC FAIL		;fail if OWP = 0

	MOV B,#CLK_KHZ/500
	DJNZ B,$		;delay
	MOV C,OWP		;read OWP  (66 uS)
	JC FAIL		;fail if OWP = 1

	SETB EA		;interrupts enable
	MOV B,#CLK_KHZ/100
	DJNZ B,$		;delay
	MOV C,OWP		;read OWP  (312 uS or more)
	JC RESOK		;OK if OWP = 1

FAIL:	CLR C
	SETB EA		;interrupts enable (if fail)
RESOK:	POP B
	RET

;Read/Write byte via 1-Wire bus
;Input: A  - input byte
;       R4 - CRC
;Out:   A  - output byte
;       R4 - updated CRC

TBYTE:    PUSH B
	MOV B,#8		;perform to read 8 bit
TBYTE1:	RRC A		;C <- bit
	LCALL TBIT	;transmit bit
	DJNZ B,TBYTE1	;next bit
	RRC A		;A <- last bit
	POP B
	RET

;Read/Write bit via 1-Wire bus
;Input: C  - input bit.
;       R4 - CRC
;Out:   C  - output bit
;       R4 - updated CRC

TBIT:     PUSH ACC
	CLR EA		;interrupts disable
	CLR OWP		;OWP <- 0 (begin of time slot)
	NOP		;delay to be sure...
	NOP		;that thermometr...
	NOP		;looks low level
	JC TB_1
	SJMP TB_0		;if data bit = 0 then OWP <- 0
TB_1:	SETB OWP		;if data bit = 1 then OWP <- 1
	NOP      		;delay for data setup
TB_0:	NOP
	NOP
	NOP
	NOP
;	NOP		;10 MHz !
;	NOP
	MOV C,OWP		;read port 15 uS later
	PUSH B  		;save register B
	MOV B,#CLK_KHZ/706
	DJNZ B,$ 		;delay to complete 60 uS slot
	POP  B   		;restore register B
	SETB OWP		;OWP <- 1, end of time slot
	SETB EA		;interrupts enable

	PUSH PSW		;update CRC, save C
	RLC A		;ACC.0 <- C
	XRL A,R4		;~ACC.0 if CRC.0 = 1
	RRC A		;ACC.0 -> C
	MOV A,R4		;A <- CRC
	JNC BCRC0
	XRL A,#18H	;update CRC
BCRC0:	RRC A		;shift CRC
	MOV R4,A		;CRC <- new value
	POP PSW		;restore C

	POP ACC
	RET

;  Accesses to DALLAS DS1990A touch memory.
;  Returns C=1 in case of valid code, else C=0.
;  Out:  ROMD (8 bytes)

ACCESS90: CLR C		;indicate failure
	MOV A,AENTM	;check access enable timer
	JNZ RET90		;exit if AENTM > 0
	MOV AENTM,#AENTMV	;reload access enable timer

	LCALL TRESET	;issue reset pulse
	JNC   RET90	;leave if no parts on bus

	CLR C		;indicate failure
	MOV A,TMATM	;check TM access timer
	JNZ DIS90		;exit if TMATM > 0

	MOV   A,#033H	;read ROM command
	LCALL TBYTE	;send command byte

	MOV R0,#ROMD	;init pointer
	MOV R1,#8		;init counter
	MOV R4,#0		;initialize CRC variable

RDMORE:	MOV   A,#0FFH	;prepare to read a byte
	LCALL TBYTE	;read byte
	MOV @R0,A		;save byte
	INC R0		;next address
	DJNZ R1,RDMORE	;repeat until finished

	MOV  A,R4		;get CRC value in ACC
	JZ   CRC_OK	;jump if successful
	CLR  C		;indicate failure
	SJMP RET90

CRC_OK:	LCALL CHKZ	;check code for zero
	JNC RET90		;invalid code

DIS90:	MOV TMATM,#TMATMV
RET90:	RET		;return to caller

;Check TM code for zero:

CHKZ:	MOV R0,#ROMD	;init pointer
	MOV R1,#8		;init counter
NEXTZ:	MOV A,@R0
	ADD A,#0FFH	;C = 1 if A>0
	JC OKZ
	INC R0		;next address
	DJNZ R1,NEXTZ
OKZ:	RET

;  I2C NVM memory 24C02 support:
;
;  I2C - bus supported subroutines:
;
;  I2C_WR   - Write byte from A via I2C bus
;  I2C_RD   - Read byte to A via I2C bus
;  I2C_LRD  - Read last byte to A via I2C bus (no ASK)
;  I2C_SUB  - Send subaddress from R1 to I2C device
;  I2C_SUBR - Send subaddress from R1 and perform read.
;  I2C_STOP - Stop condition generation on I2C bus
;
;  I2C slave address  I2C_ADDR (0A0H for 24C02 A0,A1,A2=0)
;  I2C data line	  SDA
;  I2C clock line	  SCL

;Send subaddress to I2C device.
;Input: R1 - subaddress.

I2C_SUB:  MOV A,#I2C_ADDR	;I2C device address, write mode
	LCALL I2C_WR	;send device address
	MOV A,R1		;subaddress
	LCALL I2C_WR	;send subaddress
	RET

;Send subaddress and perform read.
;Input: R1 - subaddress.

I2C_SUBR:	LCALL I2C_SUB	;send subaddress
	LCALL I2C_STOP	;stop
	MOV A,#I2C_ADDR+1	;I2C device address, read mode
	LCALL I2C_WR	;send device address
	RET

;Send byte from A via I2C bus.

I2C_WR:   PUSH B
	MOV B,#9H		;bit counter load
	SETB C		;set C, for bit 9 = 1 (when ACK)
	LCALL SDA0	;SDA 1 -> 0 - start
I2CWR1:	LCALL SCL0	;SCL 1 -> 0
	RLC A
	JC OUTP1		;jump if bit = 1
	LCALL SDA0	;else SDA=0
	SJMP OUTP0
OUTP1:	LCALL SDA1	;SDA=1, if bit = 1
OUTP0:	LCALL SCL1	;SCL 0 -> 1
	DJNZ B,I2CWR1	;loop
	POP B
	RET

;Read byte via I2C to A.

I2C_RD:	MOV A,#1H		;A init to receive 8 bit
I2CRD1:	LCALL SCL0	;SCL 1 -> 0
	LCALL SDA1	;SDA=1 - SDA line release
	LCALL SCL1	;SCL 0 -> 1
	MOV C,SDA		;move bit from SDA line to C
	RLC A		;shift bit C into A
	JNC I2CRD1	;loop until C = 1
	LCALL SCL0	;SCL 1 -> 0
	LCALL SDA0	;SDA=0 - ACK generation
	LCALL SCL1	;SCL 0 -> 1
	RET

;Read byte via I2C to A without ASK
;(receive last byte).

I2C_LRD:	MOV A,#1H		;A init to receive 8 bit
I2CLRD1:	LCALL SCL0	;SCL 1 -> 0
	LCALL SDA1	;SDA=1 - SDA line release
	LCALL SCL1	;SCL 0 -> 1
	MOV C,SDA		;move bit from SDA line to C
	RLC A		;shift bit C into A
	JNC I2CLRD1	;loop until C = 1
	LCALL SCL0	;SCL 1 -> 0
	LCALL SCL1	;SCL 0 -> 1 when SDA=1: no ACK
	RET

;STOP condition generation:

I2C_STOP:	LCALL SCL0
	LCALL SDA0
	LCALL SCL1
	LCALL SDA1
	RET

;SDA and SCL lines control:

SDA0:	CLR SDA	;SDA 1/0
	RET
SDA1:	SETB SDA	;SDA 0/1
	RET
SCL0:	CLR SCL	;SCL 1/0
	RET
SCL1:	SETB SCL	;SCL 0/1
	RET

;EEPROM address map:

;00H - page not used
;08H - touch memory code 1
;10H - touch memory code 2
;...

;Save new key:
;NUM - key number (1..9)

SAVE:     MOV A,NUM
	MOV B,#8
	MUL AB		;NUM x 8
	MOV R1,A		;R1 <- subaddress
	LCALL I2C_SUB	;send subaddress
	MOV R1,#8		;init counter
	MOV R0,#ROMD	;init pointer
DOWR:	MOV A,@R0
	LCALL I2C_WR	;send data
	INC R0
	DJNZ R1,DOWR
	LCALL I2C_STOP	;stop
	LCALL DEL15	;delay 15mS to page write
	RET

;Check for member:
;Returns C=1 if code O.K.

CHKMEM:	MOV R2,#1		;init key counter

NEXT:	MOV A,R2
	MOV B,#8
	MUL AB		;NUM x 8
	MOV R1,A		;R1 <- subaddress
	LCALL I2C_SUBR	;send subaddress and read mode
	MOV R1,#8		;init counter
	MOV R0,#ROMD	;init pointer

DORD:	LCALL I2C_RD	;read data
	XRL A,@R0
	JNZ INVAL		;jump if invalid code
	INC R0		;next address
	DJNZ R1,DORD
	LCALL I2C_LRD	;stop read
	LCALL I2C_STOP
	SETB C		;valid code, C <- 1
	RET

INVAL:    LCALL I2C_LRD	;stop read
	LCALL I2C_STOP
	INC R2		;next key
	MOV A,R2
	CJNE A,#MAXK+1,NEXT
	CLR C		;invalid code, C <- 0
	RET

;Check for master:

CHKMAS:   MOV R1,#8		;init counter
	MOV DPTR,#MK	;init pointer to ROM
	MOV R0,#ROMD+7	;init pointer to RAM
DOCM:	CLR A
	MOVC A,@A+DPTR	;read ROM
	XRL A,@R0		;ROM[DPTR] = RAM[R0] ?
	JNZ INVM		;jump if invalid code
	INC DPTR		;next ROM address
	DEC R0		;next RAM address
	DJNZ R1,DOCM
	SETB C		;valid master code, C <- 1
	RET

INVM:	CLR C		;invalid master code, C <- 0
	RET

;Display support:
;Input: NUM = value
;if PROG = 0 display is blanked
;if PROG = 1 and BLINK = 1 display is blinking

DISP:     MOV A,#BLANK	;blank display if PROG = 0
	JNB PROG,IND
	MOV A,#CH_P	;display "P" if SNUM = 0
	JNB SNUM,IND
	MOV A,NUM		;display NUM if PROG = 1 and SNUM = 1

IND:	MOV C,T320M	;load blink period bit
	ORL C,/BLINK	;check blink enable bit
	JC IND1
	MOV A,#BLANK
IND1:	MOV DPTR,#FONT	;font table pointer
	MOVC A,@A+DPTR	;read font
	MOV DDATA,A	;indicator control
	RET

;Delay 15mS:

DEL15:	PUSH  B
	PUSH  ACC
	MOV   B,#30
DEL05:	MOV   A,#CLK_KHZ/48
	DJNZ  ACC,$
	LCALL WAKEUP	;watchdog wakeup
	DJNZ  B,DEL05
	POP   ACC
	POP   B
	RET

;  ------ Interrupt Holders ------

;  TIMER 0 Interrupt
;  System clock (20mS)

RTC:      PUSH ACC
	CLR TR0          	;timer 0 stop
	MOV TH0,#HI(RTCV)  	;timer 0 load for 20mS
	MOV TL0,#LO(RTCV)
	SETB TR0         	;timer start

	INC RTPC         	;advance Real Time Program Counter

;  20mS program counters

RTC1:	MOV A,TMATM
	JZ RTC2
	DEC TMATM

RTC2:	MOV A,AENTM
	JZ RTC3
	DEC AENTM

RTC3:	MOV A,OPNTM
	JZ RTC4
	DEC OPNTM

RTC4:	MOV A,RETTM
	JZ RTC5
	DEC RETTM

RTC5:	POP ACC
	RETI

;	    FGABSCDE
FONT	.DB 01001000B	;code 00H, character 0
	.DB 11101011B	;code 01H, character 1
	.DB 10001100B	;code 02H, character 2
	.DB 10001001B	;code 03H, character 3
	.DB 00101011B	;code 04H, character 4
	.DB 00011001B	;code 05H, character 5
	.DB 00011000B	;code 06H, character 6
	.DB 11001011B	;code 07H, character 7
	.DB 00001000B	;code 08H, character 8
	.DB 00001001B	;code 09H, character 9
	.DB 00001010B	;code 0AH, character A
	.DB 00111000B	;code 0BH, character B
	.DB 01011100B	;code 0CH, character C
	.DB 10101000B	;code 0DH, character D
	.DB 00011100B	;code 0EH, character E
	.DB 00011110B	;code 0FH, character F
	.DB 11111111B	;code 10H, character blank
	.DB 10111111B	;code 11H, character -
	.DB 00001110B	;code 12H, character P

;Characters codes table:

BLANK	.EQU 010H		;character "blank" code
CH_MIN	.EQU 011H		;character "-" code
CH_P	.EQU 012H		;character "P" code

;Master key code:

MK	.DB 062H,000H,000H,002H,0D6H,089H,029H,001H

#IF (DEBUG>1)
#INCLUDE "LIBDBG16.ASM"
#ENDIF
	.END

Fuente:
http://www.yoreparo.com/nav/?url=ht...ms.com/mcu/page-1/268/ibutton-electronic-lock

Saludo.
 
eh estado viendo durante algun tiempo recopilando información de aqui y de alla sobre los microcontroladores y aqui he encontrado las respuestas mas atinadas asi que aqui va una pregunta a ver quien me puede ayudar, tengo en la mira para comprar uno de los dos siguientes kits para adentrarme en esto de los micros uno es el de pic 2 que viene con su manual y todo y el otro es el c programming for microcontrollers utilizando avr esta es la pagina http://store.nutsvolts.com/product.php?productid=16750&cat=0&page=1 a ver si alguien me puede dar su opinion se lo agradeceria bastante. eh estado trabajando con microcontroladores parallax pero son caros muyyyyyyy caros aprox. 50 dlls aunque son muy buenos o al menos eso creo son caros para cosas que no se requiere tanto gasto, tambien si alguien los conoce y me puede dar su opinion se los agradeceria.. ..[/url]
 
Mi respuesta de siempre.... si quieres iniciar de cero es mejor el PIC, si quieres hacer cosas mas complejas es mejor el AVR, para ambos sistemas existen programadores y compiladores gratuitos y ambos son muy faciles de conseguir...

Aunque si admito que PIC es un poco mas facil de conseguir que AVR y tambien tienes mas documentacion disponible en varios idiomas... con AVR la información casi siempre esta en ingles...
 
LAs cosas complejas para eso está FreeScale y ARM, que son mejores, al menos eso dicen. PIC para inicniarse, jugar con ellos, AVR parece serio, y los de antes mejor que mejor.

Te puedes entretener con www.mypic32.com
 
Estado
Cerrado para nuevas respuestas.
Atrás
Arriba