??? 11/17/05 03:38 Read: times |
#103836 - My problrm still remains Responding to: ???'s previous message |
Hi friends , I wrote a code for driving the M48T86 in Assembly but the problem still reains and the chip doesn't respond. Here is my code.
;------------------------------------------- ORG 000 JMP MAIN ;BUS EQU 80H;P0 ;RCL EQU 94H;P1.4 ;RST EQU B1H;P3.1 ;IRQ EQU B2H;P3.2 ;DSB EQU B7H;P3.7 ;RW EQU B6H;P3.6 ;AS EQU B4H;P3.4 ;E EQU B3H;P3.3 ;------------------------------------------- ;---------- Read --------------------------- READ: CLR P3.6 CLR P3.7 CLR P3.4 SETB P3.7 SETB P3.6 ACALL DELAY SETB P3.4 CLR P3.3 MOV A, R7 MOV P0,R7 ACALL DELAY CLR P3.4 CLR P3.7 ACALL DELAY MOV P0,#0FFH ACALL DELAY MOV R6,P0 ; CLR DSB ACALL DELAY MOV A, P0 SETB P3.7 SETB P3.3 SETB P3.4 RET ;------------------------------------------- ;---------- Write -------------------------- WRITE: CLR P3.6 CLR P3.7 CLR P3.4 SETB P3.7 SETB P3.6 ACALL DELAY SETB P3.4 CLR P3.3 MOV A, R7 MOV P0, A ACALL DELAY CLR P3.4 ACALL DELAY CLR P3.6 MOV A,#0FFH MOV P0, A MOV A, R6 MOV P0, A ACALL DELAY SETB P3.6 ACALL DELAY SETB P3.3 SETB P3.4 RET ;------------------------------------------- ;-------------Delay 2 us-------------------- DELAY: MOV R4,#2H HERE: DJNZ R4,HERE RET ;------------------------------------------- ;----------- Main -------------------------- MAIN: ; Initialization CLR P1.4 CLR P3.1 SETB P1.4 SETB P3.1 ; Starting the osscilator MOV R7,#0AH MOV R6,#2FH ACALL WRITE MOV R7,#0BH MOV R6,#04EH ACALL WRITE STAY: JMP STAY END The lines at the beginning are commented because Franklin doesn't accept the , so I commented these lines and use the addresses directly. please help. thanks |
Topic | Author | Date |
M48T86 | 01/01/70 00:00 | |
Yes, I've used them before... | 01/01/70 00:00 | |
CAPHAT | 01/01/70 00:00 | |
Assembler and 'C' | 01/01/70 00:00 | |
make it easy on yourself | 01/01/70 00:00 | |
try these links | 01/01/70 00:00 | |
A part of my code! | 01/01/70 00:00 | |
My problrm still remains | 01/01/70 00:00 | |
8051 and RTC![]() | 01/01/70 00:00 |