nyiksa eeprom spi m95256 pake bascom avr


peuting kuring ngimpi disiksa ku eeprom spi m95256, duka gara2 naon bisa ngimpi eta, maenya dina jero ngimpi kuring titah ngecek alamat hiji hiji, sebenerna kuring teh ngoprek eeprom eta teh 3 poe ka tukang, naha bet ayeuna balas dendam, cape di udak udak ku eeprom spi, teu hayang deui, teu bisa sare di jam12 -jam 04.00, mun aya ku urang di duruk

tah ieu pagawean ngadodet eeprom spi m95256

spi1ieu jeroan alamat memorina

spi2

ieu programna

$regfile = “M8DEF.DAT”
$crystal = 8000000
$baud = 9600

Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 4 , Noss = 1
Spiinit

Selct Alias Portb.1
Config Selct = Output
Set Selct

Declare Sub Eepromtest
Declare Sub E_write(byval E_addr As Word , Byval Dat As Byte)
Declare Sub E_read(byval E_addr As Word , E_dat As Byte)
Dim Schr As Byte
Dim Dat As Byte
Dim E_addr As Word
Dim E_dat As Byte
Dim E_ah As Byte
Dim E_al As Byte
Dim E_ctlw As Byte
Dim E_ctlr As Byte

Schr = &H06 ‘Write Enable
E_ctlw = &H02 ‘Write to Memory Array
E_ctlr = &H03 ‘Read from Memory Array

Dim Addr As Word
Dim Temp As Byte
Addr = 0
Temp = 0
‘==========================================
Utama:
Call Eepromtest
Incr Addr
Incr Temp
If Temp >= 100 Then
Temp = 0
End If
If Addr >= &H1000 Then
Addr = 0
Do
Print “selesai”
Loop
End If
Goto Utama
‘==========================================

Sub Eepromtest
Call E_write(addr , Temp)
Call E_read(addr , E_dat)
Print E_dat
End Sub

Sub E_write(byval E_addr As Word , Byval Dat As Byte)
E_ah = High(e_addr)
E_al = Low(e_addr)
Reset Selct
Spiout Schr , 1 ‘Write Enable
Set Selct
Reset Selct
Spiout E_ctlw , 1 ‘Schreibbefehl
Spiout E_ah , 1 ‘Adresse
Spiout E_al , 1 ‘Adresse
Spiout Dat , 1 ‘Daten schreiben
Set Selct

End Sub

Sub E_read(byval E_addr As Word , E_dat As Byte)
E_ah = High(e_addr)
E_al = Low(e_addr)
Set Selct
Waitms 10
Reset Selct
Spiout E_ctlr , 1 ‘Lesebefehl
Spiout E_ah , 1 ‘Adresse
Spiout E_al , 1 ‘Adresse
Spiin E_dat , 1 ‘Daten lesen
Set Selct
End Sub

1 thought on “nyiksa eeprom spi m95256 pake bascom avr”

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s