J
joedarton
Guest
Volám sa Joe, Student vo Vietname.
Prosím, pomôžte mi!
Mám záverečnej skúšky v univerzite.Téma "Programovanie ISP 89S51 pomocou 89c51".Je rád "89Sxx In-obvodov Serial Programmer".
Mám promblem s "Serial Programovanie Načasovanie".
Som kódovanie niektorých funkcií.Ale nevyzerá funkcie `t práce.
Potom, čo som volať funkciu "Programming_Enable" výstupné dáta Podľa = 0.(Nie = 01101001B)
Pleaze Pomôžte mi opraviť niektoré problémy.
Ďakujeme, že ste veľmi veľmi veľmi veľmi .....moc.
Pin connet:
Master At89c51 otrokář AT89s51
P1.0 RST
P1.1 SCK
P1.2 miso
P1.3 mosi
Moja Kód:
"*****************************"
"Funtion napiš Jeden Byte Chcete 89s52"
"*****************************"
WRITE_BYTE:
JB ACC.0, LABEL0
CLR P1.3
LJMP LA0
LABEL0: osev P1.3
LA0: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.1, Label1
CLR P1.3
LJMP LA1
Label1: osev P1.3
LA1: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.2, Label2
CLR P1.3
LJMP LA2
Label2: osev P1.3
LA2: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.3, LABEL3
CLR P1.3
LJMP LA3
LABEL3: osev P1.3
LA3: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.4, LABEL4
CLR P1.3
LJMP LA4
LABEL4: osev P1.3
LA4: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.5, LABEL5
CLR P1.3
LJMP LA5
LABEL5: osev P1.3
LA5: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.6, LABEL6
CLR P1.3
LJMP LA6
LABEL6: osev P1.3
LA6: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.7, LABEL7
CLR P1.3
LJMP La7
LABEL7: osev P1.3
La7: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
RET
************************************************** ******
"***************************************"
"Funtion napiš 4 Byte pre AT89s51"
"Vstup: R0: začať riešiť pamäte pomocou ukladanie dát"
"***************************************"
WRITE_4_BYTE:
MOV R1, # 4
LAP_WRITE_4_BYTE:
MOV A, @ R0
INC R0
LCALL WRITE_BYTE
DJNZ R1, LAP_WRITE_4_BYTE
RET
************************************************** *
"***************************************"
"Funtion Programovanie Enable"
"DATA: MOV 20H, # 10101100B"
"MOV 21h, # 01010011B"
"MOV 22h, # 0"
"MOV 23h, # 0"
"Vstup: R0: začať riešiť pomocou pamäťovej úložiska dát (# 20H)"
"Výstup: ACC = 01101001B"
"***************************************"
PROGRAMING_ENABLE:
Osev P1.0
NOP
NOP
NOP
NOP
NOP
NOP
MOV R0, # 20H
LCALL WRITE_4_BYTE
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP0
Osev ACC.0
LJMP RAP0
READP0: CLR ACC.0
RAP0: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP1
Osev ACC.1
LJMP RAP1
READP1: CLR ACC.1
RAP1: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP2
Osev ACC.2
LJMP RAP2
READP2: CLR ACC.2
RAP2: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP3
Osev ACC.3
LJMP RAP3
READP3: CLR ACC.3
RAP3: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP4
Osev ACC.4
LJMP RAP4
READP4: CLR ACC.4
RAP4: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP5
Osev ACC.5
LJMP RAP5
READP5: CLR ACC.5
RAP5: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP6
Osev ACC.6
LJMP RAP6
READP6: CLR ACC.6
RAP6: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP7
Osev ACC.7
LJMP RAP7
READP7: CLR ACC.7
RAP7: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
RET
************************************************** ********
"***************************************"
"Funtion Zmazať data"
"DATA: MOV 24H, # 10101100B"
"MOV 25h, # 10000000B"
"MOV 26h, # 0"
"MOV 27H, # 0"
"Vstup: R0: začať riešiť pomocou pamäťovej úložiska dát (# 24H)"
"***************************************"
ERASE_DATA:
MOV R0, # 24H
LCALL WRITE_4_BYTE
MOV R3, # 10
LAP_ERASE_DATA0:
MOV R4, # 250
LAP_ERASE_DATA1:
MOV R5, # 200
DJNZ R5, $
DJNZ R4, LAP_ERASE_DATA1
DJNZ R3, LAP_ERASE_DATA0
RET
************************************************** ******
"***************************************"
"Funtion Programovanie Enable"
"DATA: MOV 28h, # 00100000B"
"MOV 29h,"
"MOV 2AH, # 0"
"MOV 2BH, # 0"
"Vstup: R0: začať riešiť pomocou pamäťovej úložiska dát (# 28h)"
"Výstup: ACC: data readed"
"***************************************"
READ_BYTE:
MOV R0, # 28h
LCALL WRITE_4_BYTE
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ0
Osev ACC.0
LJMP RA0
READ0: CLR ACC.0
RA0: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ1
Osev ACC.1
LJMP RA1
READ1: CLR ACC.1
RA1: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ2
Osev ACC.2
LJMP RA2
READ2: CLR ACC.2
RA2: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ3
Osev ACC.3
LJMP RA3
READ3: CLR ACC.3
RA3: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ4
Osev ACC.4
LJMP RA4
READ4: CLR ACC.4
RA4: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ5
Osev ACC.5
LJMP RA5
READ5: CLR ACC.5
RA5: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ6
Osev ACC.6
LJMP RA6
READ6: CLR ACC.6
RA6: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ7
Osev ACC.7
LJMP RA7
READ7: CLR ACC.7
RA7: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
RET
*************************************************
Pridané po 11 minútach:Váš email: Joedarton (at) gmail.com
Prosím, pomôžte mi!
Mám záverečnej skúšky v univerzite.Téma "Programovanie ISP 89S51 pomocou 89c51".Je rád "89Sxx In-obvodov Serial Programmer".
Mám promblem s "Serial Programovanie Načasovanie".
Som kódovanie niektorých funkcií.Ale nevyzerá funkcie `t práce.
Potom, čo som volať funkciu "Programming_Enable" výstupné dáta Podľa = 0.(Nie = 01101001B)
Pleaze Pomôžte mi opraviť niektoré problémy.
Ďakujeme, že ste veľmi veľmi veľmi veľmi .....moc.
Pin connet:
Master At89c51 otrokář AT89s51
P1.0 RST
P1.1 SCK
P1.2 miso
P1.3 mosi
Moja Kód:
"*****************************"
"Funtion napiš Jeden Byte Chcete 89s52"
"*****************************"
WRITE_BYTE:
JB ACC.0, LABEL0
CLR P1.3
LJMP LA0
LABEL0: osev P1.3
LA0: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.1, Label1
CLR P1.3
LJMP LA1
Label1: osev P1.3
LA1: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.2, Label2
CLR P1.3
LJMP LA2
Label2: osev P1.3
LA2: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.3, LABEL3
CLR P1.3
LJMP LA3
LABEL3: osev P1.3
LA3: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.4, LABEL4
CLR P1.3
LJMP LA4
LABEL4: osev P1.3
LA4: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.5, LABEL5
CLR P1.3
LJMP LA5
LABEL5: osev P1.3
LA5: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.6, LABEL6
CLR P1.3
LJMP LA6
LABEL6: osev P1.3
LA6: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
JB ACC.7, LABEL7
CLR P1.3
LJMP La7
LABEL7: osev P1.3
La7: NOP
Osev P1.1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
NOP
RET
************************************************** ******
"***************************************"
"Funtion napiš 4 Byte pre AT89s51"
"Vstup: R0: začať riešiť pamäte pomocou ukladanie dát"
"***************************************"
WRITE_4_BYTE:
MOV R1, # 4
LAP_WRITE_4_BYTE:
MOV A, @ R0
INC R0
LCALL WRITE_BYTE
DJNZ R1, LAP_WRITE_4_BYTE
RET
************************************************** *
"***************************************"
"Funtion Programovanie Enable"
"DATA: MOV 20H, # 10101100B"
"MOV 21h, # 01010011B"
"MOV 22h, # 0"
"MOV 23h, # 0"
"Vstup: R0: začať riešiť pomocou pamäťovej úložiska dát (# 20H)"
"Výstup: ACC = 01101001B"
"***************************************"
PROGRAMING_ENABLE:
Osev P1.0
NOP
NOP
NOP
NOP
NOP
NOP
MOV R0, # 20H
LCALL WRITE_4_BYTE
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP0
Osev ACC.0
LJMP RAP0
READP0: CLR ACC.0
RAP0: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP1
Osev ACC.1
LJMP RAP1
READP1: CLR ACC.1
RAP1: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP2
Osev ACC.2
LJMP RAP2
READP2: CLR ACC.2
RAP2: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP3
Osev ACC.3
LJMP RAP3
READP3: CLR ACC.3
RAP3: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP4
Osev ACC.4
LJMP RAP4
READP4: CLR ACC.4
RAP4: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP5
Osev ACC.5
LJMP RAP5
READP5: CLR ACC.5
RAP5: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP6
Osev ACC.6
LJMP RAP6
READP6: CLR ACC.6
RAP6: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READP7
Osev ACC.7
LJMP RAP7
READP7: CLR ACC.7
RAP7: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
RET
************************************************** ********
"***************************************"
"Funtion Zmazať data"
"DATA: MOV 24H, # 10101100B"
"MOV 25h, # 10000000B"
"MOV 26h, # 0"
"MOV 27H, # 0"
"Vstup: R0: začať riešiť pomocou pamäťovej úložiska dát (# 24H)"
"***************************************"
ERASE_DATA:
MOV R0, # 24H
LCALL WRITE_4_BYTE
MOV R3, # 10
LAP_ERASE_DATA0:
MOV R4, # 250
LAP_ERASE_DATA1:
MOV R5, # 200
DJNZ R5, $
DJNZ R4, LAP_ERASE_DATA1
DJNZ R3, LAP_ERASE_DATA0
RET
************************************************** ******
"***************************************"
"Funtion Programovanie Enable"
"DATA: MOV 28h, # 00100000B"
"MOV 29h,"
"MOV 2AH, # 0"
"MOV 2BH, # 0"
"Vstup: R0: začať riešiť pomocou pamäťovej úložiska dát (# 28h)"
"Výstup: ACC: data readed"
"***************************************"
READ_BYTE:
MOV R0, # 28h
LCALL WRITE_4_BYTE
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ0
Osev ACC.0
LJMP RA0
READ0: CLR ACC.0
RA0: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ1
Osev ACC.1
LJMP RA1
READ1: CLR ACC.1
RA1: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ2
Osev ACC.2
LJMP RA2
READ2: CLR ACC.2
RA2: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ3
Osev ACC.3
LJMP RA3
READ3: CLR ACC.3
RA3: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ4
Osev ACC.4
LJMP RA4
READ4: CLR ACC.4
RA4: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ5
Osev ACC.5
LJMP RA5
READ5: CLR ACC.5
RA5: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ6
Osev ACC.6
LJMP RA6
READ6: CLR ACC.6
RA6: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
NOP
NOP
NOP
Osev P1.1
NOP
NOP
JB P1.2, READ7
Osev ACC.7
LJMP RA7
READ7: CLR ACC.7
RA7: NOP
NOP
NOP
NOP
NOP
NOP
CLR P1.1
RET
*************************************************
Pridané po 11 minútach:Váš email: Joedarton (at) gmail.com