Eski model bir bilgisayar yardımıyla; kolaylık olsun diye LPT portu ile bir EEprom Programlayıcı yaptım. Daha önceki Programlayıcı beni yavaÅŸlatıyordu. Z80 kodları arttıkça yazmak zaman alıyordu.
Åžimdi ise ; Visual C# ile yazdığım 20-25 satırlık programla, Z80 Makine kodlarını EEproma çok hızlı bir ÅŸekilde yazabiliyorum.
Kısa video aşağıda:
8 YeÅŸil led: Adresler
8 kırmızı led: datalar-makine kodları
Geri plandaki 4 yeÅŸil led ise 74ls393 clock, EEprom Write, ve Sayıcı resetleme için
--------------
LPT porta bu data, adres ve senkronizasyonu gönderen C# kodları ise aÅŸağıda.
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing; using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace eprom_prog { public partial class Form1 : Form { public Form1() { InitializeComponent(); } int ustb, altb, sonb; int gec = 0; public class lpt { [DllImport("Inpout32.dll")] public static extern short Inp32(int address); [DllImport("Inpout32.dll")] public static extern short Out32(int address, int data); //private int baseadres=0x378; public static void WriteDataPort(int baseadres, int data) { Out32(baseadres, data); } } public void beklet() { int sayac; for (sayac = 1; sayac < 6500000; sayac++) // 50-60 mikro saniye {//nop nop 2.800.000.000---2.8 GHZ} } } public void reset() { // 7493 resetleme lpt.Out32(0x37A, 4); beklet(); lpt.Out32(0x37A,5); beklet(); lpt.Out32(0x37A, 4); //lpt.Out32(0x37A, 4); beklet(); } public void yaz() { // CLOCK DAHİL BURASI lpt.Out32(0x37A, 5); beklet(); lpt.Out32(0x37A, 7); beklet(); lpt.Out32(0x37A, 1); } public void clock() { lpt.Out32(0x37A, 5); beklet(); lpt.Out32(0x37A, 7); beklet(); } public void wrt() { // eeprom yazma sinyali } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { int say; int kar_say; string kod; string ch; kod=textBox1.Text; kar_say = kod.Length; //label2.Text = kar_say.ToString()+" bYTE vERi gönderildi"; gec = 0; kar_say = kar_say / 2; lpt.Out32(0x378, 0); beklet(); // data sıfırlanıyor // reset(); // adres sayıcı resetleniyor---- for (say = 1; say <= kar_say; say++) { ch = kod.Substring(gec, 1); if (ch == "A") { ustb = 10; } if (ch == "B") { ustb = 11; } if (ch == "C") { ustb = 12; } if (ch == "D") { ustb = 13; } if (ch == "E") { ustb = 14; } if (ch == "F") { ustb = 15; } if (ch == "9") { ustb = 9; } if (ch == "8") { ustb = 8; } if (ch == "7") { ustb = 7; } if (ch == "6") { ustb = 6; } if (ch == "5") { ustb = 5; } if (ch == "4") { ustb = 4; } if (ch == "3") { ustb = 3; } if (ch == "2") { ustb = 2; } if (ch == "1") { ustb = 1; } if (ch == "0") { ustb = 0; } //ALT BAYT ch = kod.Substring(gec+1, 1); if (ch == "A") { altb = 10; } if (ch == "B") { altb = 11; } if (ch == "C") { altb = 12; } if (ch == "D") { altb = 13; } if (ch == "E") { altb = 14; } if (ch == "F") { altb = 15; } if (ch == "9") { altb = 9; } if (ch == "8") { altb = 8; } if (ch == "7") { altb = 7; } if (ch == "6") { altb = 6; } if (ch == "5") { altb = 5; } if (ch == "4") { altb = 4; } if (ch == "3") { altb = 3; } if (ch == "2") { altb = 2; } if (ch == "1") { altb = 1; } if (ch == "0") { altb = 0; } sonb = (ustb << 4) + altb; textBox2.Text = textBox2.Text +"-"+ sonb.ToString(); lpt.Out32(0x378, sonb); yaz(); beklet(); // clock(); gec = gec +2; } // DENEME KODLARI /*/*/*/*/*/*/*/*/*/*/ label1.Text = "..." + (say-1).ToString() + " Byte veri gönderildi."; } private void button2_Click(object sender, EventArgs e) { reset(); } private void button3_Click(object sender, EventArgs e) { lpt.Out32(0x37A, 4); beklet(); lpt.Out32(0x37A, 0); beklet(); lpt.Out32(0x37A, 4); beklet(); //lpt.Out32(0x37A, 4); } private void button4_Click(object sender, EventArgs e) { lpt.Out32(0x37A, 8); beklet(); lpt.Out32(0x37A, 0); beklet(); lpt.Out32(0x37A, 8); } }}