Picproje Elektronik Sitesi

DİJİTAL & ANALOG ELEKTRONİK => Pld, Spld, Pal, Gal, Cpld, Fpga => Konuyu başlatan: mecharon - 07 Mart 2013, 19:48:09

Başlık: VHDL'yle LCD kullanmak
Gönderen: mecharon - 07 Mart 2013, 19:48:09
Daha önceden açılmış ve çözüme ulaşmış bir konu var ancak asıl amacım LCD'yi kullanabilmekten ziyade sistemin nasıl işlediğini anlamak. O yüzden yeni konu açıyorum.
Önceki konu https://www.picproje.org/index.php/topic,39289.30.html (https://www.picproje.org/index.php/topic,39289.30.html) adresinde.

Yazmaya çalıştığım kodda LCD'ye veri gönderen process, işlemi bittikten sonra tekrar başa dönüyor ("comb_proctx:" etiketli olan). 82000 clock cycle süren bir işlem var (when clrDsp =>). Gönderilen verinin işlemi daha erken bitiyor. Ancak işlem bittikten sonra aynı veri 82000 clock cycle bitene kadar tekrar tekrar gönderiliyor. Spartan 3E kiti var, VHDL'yi yeni öğrendim. http://www.freerangefactory.org/site/pmwiki.php/Main/Books (http://www.freerangefactory.org/site/pmwiki.php/Main/Books) adresindeki kitabı kullandım. LED'leri düğmeleri felan kullanıp PWM'le motor sürebiliyorum. Finite State Machine diye bir konu var ve farklı Finite State Machine'ler arasındaki iletişimi nasıl sağlayacağımı çözemedim. LCD'yi kullanan hazır kodlar da var ama açıkçası anlayamadım. Yardımcı olursanız sevinirim.
Kodlar şu şekilde:

library IEEE;
use IEEE.std_logic_1164.all;

entity lcdbenim is
port(
SF_D : out std_logic_vector(3 downto 0);
LED : out std_logic_vector(7 downto 0);
CLK_50MHZ : in std_logic;
BTN_WEST : in std_logic;
LCD_E,LCD_RS,LCD_RW, SF_CE0: out std_logic

);
end lcdbenim;

architecture Behavioral of lcdbenim is

type txDurumlar is (idle, kirk1,iyo1,on1,birus,kirk2, iyo2,on2,kirkus,tamam);
signal txPS,txNS: txDurumlar;
signal txInit: std_logic:='0';
signal secici:std_logic:='0';

type initDurum is (idle, ms15, bir, iki, uc, dort, bes, alti, yedi, sekiz, tamam);
signal initPS,initNS: initDurum;

type ayarDurum is (idle, funcSet, entSet, DispOf, clrDsp, setDD, yaz, tamamAyar,cikis);
signal ayarPS, ayarNS: ayarDurum:=idle;


signal LCD_E0, LCD_E1: std_logic;
signal SF_D0,SF_D1: std_logic_vector (3 downto 0);
signal ledBasi, ledBasi1: std_logic_vector (3 downto 0);
signal gonder,gonder2: std_logic_vector(7 downto 0):="00000000";
signal gondermi: std_logic:='0';
signal adresDD: std_logic_vector(7 downto 0):="10000000";
signal karakter: std_logic_vector(7 downto 0):="01000110";
signal secim: std_logic:='0';

begin
secim<='1' when initPS=tamam else
'0';
prola: process(CLK_50MHZ)
begin

if rising_edge(CLK_50MHZ) then
if ayarPS=yaz then
LCD_RS<='1';
else
LCD_RS<='0';
end if;
LCD_RW<='0';
SF_CE0<='1';
if secim='0' then
SF_D<= SF_D0;
LED<=ledBasi & SF_D0;
LCD_E<=LCD_E0;
elsif secim='1' then
SF_D<= SF_D1;
LED<=ledBasi1 & SF_D1;
LCD_E<=LCD_E1;
end if;
end if;
end process prola;


----------------- INIT PROCESSLERI BASLADI ----------------
sync_init: process(CLK_50MHZ)
begin
if (rising_edge(CLK_50MHZ)) then
initPS<=initNS;
end if;
end process sync_init;

comb_init: process(CLK_50MHZ,initPS)
variable sayac:integer range 0 to 750000;
begin
if rising_edge(CLK_50MHZ) then
case initPS is
when idle =>
sayac:=0;
ledBasi<="1111";
initNS<=ms15;
when ms15 =>
if sayac=750000 then
initNS<=bir;
sayac:=0;
else
sayac:=sayac+1;
ledBasi<="1110";
end if;
when bir =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=iki;
sayac:=0;
else
sayac:=sayac+1;
end if;
when iki =>
LCD_E0<='0';
if sayac=205000 then
initNS<=uc;
sayac:=0;
else
sayac:=sayac+1;
end if;
when uc =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=dort;
sayac:=0;
else
sayac:=sayac+1;
end if;
when dort =>
LCD_E0<='0';
if sayac=5000 then
initNS<=bes;
sayac:=0;
else
sayac:=sayac+1;
end if;
when bes =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=alti;
sayac:=0;
else
sayac:=sayac+1;
end if;
when alti =>
LCD_E0<='0';
if sayac=2000 then
initNS<=yedi;
sayac:=0;
else
sayac:=sayac+1;
end if;
when yedi =>
SF_D0<="0010";
LCD_E0<='1';
if sayac=12 then
initNS<=sekiz;
sayac:=0;
else
sayac:=sayac+1;
end if;
when sekiz =>
LCD_E0<='0';
if sayac=2000 then
initNS<=tamam;
sayac:=0;
else
sayac:=sayac+1;
end if;
when tamam =>
ledBasi<="1100";
end case;
end if;
end process comb_init;
--------------------- INIT PROCESSLERI BITTI -----------------

------------ GONDERME BASLADI-----------
sync_proctx: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
txPS<=txNS;
end if;
end process sync_proctx;


tx4lu: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
if secici='0' then
SF_D1<=gonder(7 downto 4);
elsif secici='1' then
SF_D1<=gonder(3 downto 0);
end if;
end if;
end process tx4lu;

comb_proctx: process(CLK_50MHZ,ayarPS,gonder)
variable sayac: integer range 0 to 40000;
begin
if rising_edge(CLK_50MHZ) then
case txPS is
when idle =>
if ayarPS=cikis or ayarPS=idle then
txNS<=idle;
else
sayac:=0;
txNS<=kirk1;
end if;
when kirk1 =>
LCD_E1<='0';
if sayac =2 then
txNS<=iyo1;
sayac:=0;
else
sayac:=sayac+1;
end if;

when iyo1 =>
LCD_E1<='1';
if sayac =12 then
txNS<=on1;
sayac:=0;
else
sayac:=sayac+1;
end if;
when on1 =>
LCD_E1<='0';
if sayac =1 then
txNS<=birus;
sayac:=0;
else
sayac:=sayac+1;
end if;
when birus =>
LCD_E1<='0';
secici<='1';
if sayac =500 then
txNS<=kirk2;
sayac:=0;
else
sayac:=sayac+1;
end if;
when kirk2 =>
LCD_E1<='0';
if sayac =2 then
txNS<=iyo2;
sayac:=0;
else
sayac:=sayac+1;
end if;

when iyo2 =>
LCD_E1<='1';
if sayac =12 then
txNS<=on2;
sayac:=0;
else
sayac:=sayac+1;
end if;
when on2 =>
LCD_E1<='0';
if sayac =1 then
txNS<=kirkus;
sayac:=0;
else
sayac:=sayac+1;
end if;
when kirkus =>
LCD_E1<='0';
if sayac =2000 then
txNS<=tamam;
sayac:=0;
secici<='0';
else
sayac:=sayac+1;
end if;
when tamam =>
txNS<=idle;
sayac:=30000;
end case;
end if;

end process comb_proctx;

------------ GONDERME BITTI----------


--------------------- AYAR PROCESSLERI BASLADI ---------------
sync_ayar: process (CLK_50MHZ)
begin
if (BTN_WEST='1') then
ayarPS<=idle;
elsif rising_edge(CLK_50MHZ) then
ayarPS<=ayarNS;
end if;
end process sync_ayar;


comb_ayar: process(CLK_50MHZ)
variable sayac: integer range 0 to 82000;
begin

case ayarPS is
when idle=>
if initPS=tamam then
sayac:=0;
ayarNS<=funcSet;
end if;
when funcSet =>
gonder <="00101000";
if sayac=2000 then
if txPS=tamam then
ayarNS<=entSet;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when entSet =>
gonder<="00000110";
if sayac=2000 then
if txPS=tamam then
ayarNS<=dispOf;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when dispOf =>
gonder <="00001100";
if sayac=2000 then
if txPS=tamam then
ayarNS<=clrDsp;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when clrDsp =>
gonder<="00000001";
if sayac =82000 then
if txPS=tamam then
ayarNS<=tamamAyar;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when setDD =>
gonder<=adresDD;
if sayac=2000 then
if txPS=tamam then
ayarNS<=yaz;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when yaz =>
gonder<=karakter;
if sayac=2000 then
if txPS=tamam then
ayarNS<=cikis;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when tamamAyar =>
if sayac=2000 then
if txPS=tamam then
ayarNS<=setDD;
sayac:=0;
end if;
else
sayac:=sayac+1;
end if;
when cikis =>
sayac:=0;
end case;
end process comb_ayar;
--------------------- AYAR PROCESSLERI BITTI -----------------

end Behavioral;



UCF'si de bu:

NET "SF_D<8>" LOC = "R15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<9>" LOC = "R16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<10>" LOC = "P17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<11>" LOC = "M15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;


NET "CLK_50MHZ" LOC = "C9" | IOSTANDARD = LVCMOS33 ;
NET "BTN_WEST" LOC = "V4" | IOSTANDARD = LVTTL | PULLDOWN ;

NET "LCD_E" LOC = "M18" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "LCD_RS" LOC = "L18" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "LCD_RW" LOC = "L17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;

NET "SF_CE0" LOC = "D16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;

NET "LED<0>" LOC = "F12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<1>" LOC = "E12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<2>" LOC = "E11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<3>" LOC = "F11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<4>" LOC = "C11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<5>" LOC = "D11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<6>" LOC = "E9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<7>" LOC = "F9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: metaltrrocker - 07 Mart 2013, 20:30:53
kodlar için teşekkürler bende de basys2 var onunla sürebilirmiyim bilmiyorum ama hafta sonu bir tane lcd alıp denemek isterim belki faydam dokunur.
bu arada kullandığınız boarddaki lcd nin türü nedir?
2x16 yada 4x20 mi?
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mecharon - 08 Mart 2013, 08:38:43
Kod şu anda çalışmııyor. Yalnızca init aşamasını geçebiliyor. LCD'ye karakter gönderemiyor.
2x16. Kartın kullanım kılavuzunda yazdığına göre şunlarla uyumluymuş:
Samsung S6A0069X or KS0066U, Hitachi HD44780, SMOS SED1278
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: muuzoo - 08 Mart 2013, 08:47:56
Alıntı yapılan: mecharon - 08 Mart 2013, 08:38:43
Kod şu anda çalışmııyor. Yalnızca init aşamasını geçebiliyor. LCD'ye karakter gönderemiyor.
2x16. Kartın kullanım kılavuzunda yazdığına göre şunlarla uyumluymuş:
Samsung S6A0069X or KS0066U, Hitachi HD44780, SMOS SED1278

Belki işinize yarar:

http://gunluk.muuzoo.gen.tr/2010/01/08/xilinx-ml506-16x2-lcd-calisma/ (http://gunluk.muuzoo.gen.tr/2010/01/08/xilinx-ml506-16x2-lcd-calisma/)
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mehmet - 08 Mart 2013, 09:04:42
Elinde deneme kiti olmayan arkadaşların test yapabilecekleri
uzaktan erişimli labaratuar.
http://www.cizgi-tagem.org/e-lab/ (http://www.cizgi-tagem.org/e-lab/)
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mecharon - 08 Mart 2013, 18:32:43
@muuzoo: Teşekkür ederim. Çalışma mantığını anlamaya çalıştığım bir konu için çok faydalı oldu. Ancak yapıyı componente dönüştürüp dinamik veri göndermeye çalışıyorum. Sizinki o işe yarıyorsa bile anlayamadım. 

Kodu aşağıdaki şekilde değiştirdim. LCD'ye veri gönderen process'te ayarın ne durumda olduğuna, aynı şekilde ayarda da göndericinin ne durumda olduğuna baktım. Tekrar tekrar aynı şeyleri yazmak zorunda kaldım. Sanırım verimli bir yöntem değil. Modelsim PE Student Edition'da sinyaller istediğim gibi çıktı. Bu sefer de LCD'de üç tane dikey çizgi görünüyor ve yaptığım ayarlar tutmuyor. İmleci ve yanıp sönmesini istemiyorum misal, ama yanıp sönüyor. LED'lere baktığımda sinyalin doğru değerde olduğunu görüyorum, F yazdırmaya çalışıyorum. 

library IEEE;
use IEEE.std_logic_1164.all;

entity lcdbenim is
port(
SF_D : out std_logic_vector(3 downto 0);
LED : out std_logic_vector(7 downto 0);
CLK_50MHZ : in std_logic;
BTN_WEST : in std_logic;
LCD_E,LCD_RS,LCD_RW, SF_CE0: out std_logic

);
end lcdbenim;

architecture Behavioral of lcdbenim is

type txDurumlar is (idle, kirk1,iyo1,on1,birus,kirk2, iyo2,on2,kirkus,tamam);
signal txPS,txNS: txDurumlar:=idle;
signal txCikis: std_logic:='0';
signal secici:std_logic:='0';

type initDurum is (idle, ms15, bir, iki, uc, dort, bes, alti, yedi, sekiz, tamam);
signal initPS,initNS: initDurum;

type ayarDurum is (idle, funcSet, entSet, DispOf, clrDsp, setDD, yaz, tamamAyar,cikis);
signal ayarPS, ayarNS: ayarDurum;

signal LCD_E0, LCD_E1: std_logic;
signal SF_D0,SF_D1: std_logic_vector (3 downto 0);
signal gonder: std_logic_vector(7 downto 0):="00000000";
signal adresDD: std_logic_vector(7 downto 0):="10000000";
signal karakter: std_logic_vector(7 downto 0):="01000110";
signal secim: std_logic:='0';

begin
secim<='1' when initPS=tamam else
'0';
prola: process(CLK_50MHZ)
begin

if rising_edge(CLK_50MHZ) then

if ayarPS=yaz then
LCD_RS<='1';
else
LCD_RS<='0';
end if;
LCD_RW<='0';
SF_CE0<='1';
if secim='0' then
SF_D<= SF_D0;
LED (3 downto 0)<=SF_D0;
LCD_E<=LCD_E0;
elsif secim='1' then
SF_D<= SF_D1;
LED<=gonder;
LCD_E<=LCD_E1;
end if;
end if;
end process prola;


----------------- INIT PROCESSLERI BASLADI ----------------
sync_init: process(CLK_50MHZ)
begin
   if (BTN_WEST='1') then
initPS<=idle;
elsif (rising_edge(CLK_50MHZ)) then
initPS<=initNS;
end if;
end process sync_init;

comb_init: process(CLK_50MHZ)
variable sayac:integer range 0 to 750000;
begin
if rising_edge(CLK_50MHZ) then
case initPS is
when idle =>
sayac:=0;
initNS<=ms15;
when ms15 =>
if sayac=750000 then
initNS<=bir;
sayac:=0;
else
sayac:=sayac+1;
end if;
when bir =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=iki;
sayac:=0;
else
sayac:=sayac+1;
end if;
when iki =>
LCD_E0<='0';
if sayac=205000 then
initNS<=uc;
sayac:=0;
else
sayac:=sayac+1;
end if;
when uc =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=dort;
sayac:=0;
else
sayac:=sayac+1;
end if;
when dort =>
LCD_E0<='0';
if sayac=5000 then
initNS<=bes;
sayac:=0;
else
sayac:=sayac+1;
end if;
when bes =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=alti;
sayac:=0;
else
sayac:=sayac+1;
end if;
when alti =>
LCD_E0<='0';
if sayac=2000 then
initNS<=yedi;
sayac:=0;
else
sayac:=sayac+1;
end if;
when yedi =>
SF_D0<="0010";
LCD_E0<='1';
if sayac=12 then
initNS<=sekiz;
sayac:=0;
else
sayac:=sayac+1;
end if;
when sekiz =>
LCD_E0<='0';
if sayac=2000 then
initNS<=tamam;
sayac:=0;
else
sayac:=sayac+1;
end if;
when tamam =>
end case;
end if;
end process comb_init;
--------------------- INIT PROCESSLERI BITTI -----------------

------------ GONDERME BASLADI-----------
sync_proctx: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
txPS<=txNS;
end if;
end process sync_proctx;


tx4lu: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
if secici='0' then
SF_D1<=gonder(7 downto 4);
elsif secici='1' then
SF_D1<=gonder(3 downto 0);
end if;
end if;
end process tx4lu;

comb_proctx: process(CLK_50MHZ, ayarPS)
variable sayac: integer range 0 to 40000;
begin
if rising_edge(CLK_50MHZ) then
case txPS is
when idle =>
if initPS=tamam then
if ayarPS=cikis then
txNS<=idle;
else
txNS<=kirk1;
end if;
end if;

when kirk1 =>
LCD_E1<='0';
if sayac =2 then
txNS<=iyo1;
sayac:=0;
else
sayac:=sayac+1;
end if;
when iyo1 =>
LCD_E1<='1';
if sayac =12 then
txNS<=on1;
sayac:=0;
else
sayac:=sayac+1;
end if;
when on1 =>
LCD_E1<='0';
if sayac =1 then
txNS<=birus;
sayac:=0;
else
sayac:=sayac+1;
end if;
when birus =>
LCD_E1<='0';
secici<='1';
if sayac =500 then
txNS<=kirk2;
sayac:=0;
else
sayac:=sayac+1;
end if;
when kirk2 =>
LCD_E1<='0';
if sayac =2 then
txNS<=iyo2;
sayac:=0;
else
sayac:=sayac+1;
end if;

when iyo2 =>
LCD_E1<='1';
if sayac =12 then
txNS<=on2;
sayac:=0;
else
sayac:=sayac+1;
end if;
when on2 =>
LCD_E1<='0';
if sayac =1 then
txNS<=kirkus;
sayac:=0;
else
sayac:=sayac+1;
end if;
when kirkus =>
LCD_E1<='0';
if sayac =2000 then
txNS<=tamam;
sayac:=0;
secici<='0';
else
sayac:=sayac+1;
end if;
when tamam =>
LCD_E1<='0';
if (ayarPS=cikis) then
txNS<=idle;
end if;

if txCikis='1' then
txNS<=kirk1;
end if;

end case;
end if;

end process comb_proctx;

------------ GONDERME BITTI----------


--------------------- AYAR PROCESSLERI BASLADI ---------------
sync_ayar: process (CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
ayarPS<=ayarNS;
end if;
end process sync_ayar;


comb_ayar: process(CLK_50MHZ)
variable sayac: integer range 0 to 82000;
begin
if rising_edge(CLK_50MHZ) then
case ayarPS is
when idle=>
if initPS=tamam then
sayac:=0;
ayarNS<=funcSet;
end if;
when funcSet =>
txCikis<='0';
gonder <="00101000";
if sayac=2000 then
if txPS=tamam then
ayarNS<=entSet;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when entSet =>
txCikis<='0';
gonder<="00000110";
if sayac=2000 then
if txPS=tamam then
ayarNS<=dispOf;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when dispOf =>
txCikis<='0';
gonder <="00001100";
if sayac=2000 then
if txPS=tamam then
ayarNS<=clrDsp;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when clrDsp =>
txCikis<='0';
gonder<="00000001";
if sayac=82000 then
if txPS=tamam then
ayarNS<=tamamAyar;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when setDD =>
txCikis<='0';
gonder<="10000000";
if sayac=2000 then
if txPS=tamam then
ayarNS<=yaz;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when yaz =>
txCikis<='0';
gonder<="01000110";
if sayac=2000 then
if txPS=tamam then
ayarNS<=cikis;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when tamamAyar =>
txCikis<='0';
if sayac=2000 then
if txPS=tamam then
ayarNS<=setDD;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when cikis =>
txCikis<='0';
sayac:=0;
end case;
end if;
end process comb_ayar;
--------------------- AYAR PROCESSLERI BITTI -----------------

end Behavioral;


[IMG]http://i1293.photobucket.com/albums/b595/mecharon/08032013075_zps87a79a60.jpg[/img]
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: Ersin - 08 Mart 2013, 23:48:52
@mecharon ,
Spartan3E -500K  kiti kullanıyorsan lcd si 4 bit tir 8 değil.
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mecharon - 09 Mart 2013, 08:57:21
Verileri 4'er 4'er gönderiyorum. Kullanıcı kılavuzundaki gibi 1us'den sonra ikinci 4bit gidiyor. Sondaki 40us'lik bekleme anında da secici sinyali sıfırlanıyor.


tx4lu: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
        if secici='0' then
            SF_D1<=gonder(7 downto 4);
        elsif secici='1' then
            SF_D1<=gonder(3 downto 0);
        end if;
end if;
end process tx4lu;




when birus =>
                LCD_E1<='0';
                secici<='1';
                if sayac =500 then
                    txNS<=kirk2;
                    sayac:=0;
                else
                    sayac:=sayac+1;
                end if;



when kirkus =>
                LCD_E1<='0';
                if sayac =2000 then
                    txNS<=tamam;
                    sayac:=0;
                    secici<='0';
                else
                    sayac:=sayac+1;
                end if;
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mecharon - 12 Mart 2013, 09:13:15
Sinyal aşağıdaki şekilde ilerliyor. Kullanıcı kılavuzundaki hali de www.xilinx.com/support/documentation/boards_and_kits/ug230.pdf (http://www.xilinx.com/support/documentation/boards_and_kits/ug230.pdf) adresindeki PDF'in 50. sayfasında. Ancak görüntü halen yukarıdaki gibi. Bir el atıverin, ilerleyemiyorum.

Bir de UCF constraint'leri PDF'den almama rağmen Implement sırasında şöyle bir hata veriyor:
ERROR:ConstraintSystem:59 - Constraint <SLEW = SLOW ;> [otp.ucf(4)]: NET
   "SF_D<11>" not found.  Please verify that:
   1. The specified design element actually exists in the original design.
   2. The specified object is spelled correctly in the constraint source file.
Allow unconstrained LOC'u işaretlediğim zaman implement ediliyor. UCF dosyası şu:


NET "SF_D<8>" LOC = "R15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<9>" LOC = "R16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<10>" LOC = "P17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<11>" LOC = "M15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;


NET "CLK_50MHZ" LOC = "C9" | IOSTANDARD = LVCMOS33;
NET "BTN_WEST" LOC = "V4" | IOSTANDARD = LVTTL | PULLDOWN ;

NET "LCD_E" LOC = "M18" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "LCD_RS" LOC = "L18" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "LCD_RW" LOC = "L17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;

NET "SF_CE0" LOC = "D16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;

NET "LED<0>" LOC = "F12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<1>" LOC = "E12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<2>" LOC = "E11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<3>" LOC = "F11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<4>" LOC = "C11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<5>" LOC = "D11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<6>" LOC = "E9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<7>" LOC = "F9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;



[IMG]http://i1293.photobucket.com/albums/b595/mecharon/LCDSur1_zps3a370970.jpg[/img]

[IMG]http://i1293.photobucket.com/albums/b595/mecharon/LCDSur2_zpsc8b884db.jpg[/img]

[IMG]http://i1293.photobucket.com/albums/b595/mecharon/LCDSur3_zps8a59e079.jpg[/img]


Kodun son hali:

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_Std.all;

entity lcdbenim is
port(
SF_D : out std_logic_vector(3 downto 0);
LED : out std_logic_vector(7 downto 0);
CLK_50MHZ : in std_logic;
BTN_WEST : in std_logic;
LCD_E,LCD_RS,LCD_RW,SF_CE0: out std_logic

);
end lcdbenim;

architecture Behavioral of lcdbenim is

type txDurumlar is (idle, kirk1,iyo1,on1,birus,kirk2, iyo2,on2,kirkus,tamam);
signal txPS,txNS: txDurumlar:=idle;
signal txCikis: std_logic:='0';
signal secici:std_logic:='0';

type initDurum is (idle, ms15, bir, iki, uc, dort, bes, alti, yedi, sekiz, tamam);
signal initPS,initNS: initDurum;

type ayarDurum is (idle, funcSet, entSet, DispOf, clrDsp, setDD, yaz, tamamAyar,cikis);
signal ayarPS, ayarNS: ayarDurum;

signal LCD_E0, LCD_E1: std_logic:='0';
signal SF_D0,SF_D1: std_logic_vector (3 downto 0):="0000";
signal gonder: std_logic_vector(7 downto 0):="00000000";
signal secim: std_logic:='0';

begin
secim<='1' when initPS=tamam else
'0';
prola: process(CLK_50MHZ)
begin

if rising_edge(CLK_50MHZ) then

LCD_RW<='0';
SF_CE0<='1';
if ayarNS=yaz then
LCD_RS<='1';
else
LCD_RS<='0';
end if;

if secim='0' then
SF_D<= SF_D0;
LED <=gonder;
LCD_E<=LCD_E0;
elsif secim='1' then
SF_D<= SF_D1;
LED<=gonder;
LCD_E<=LCD_E1;
end if;
end if;
end process prola;


----------------- INIT PROCESSLERI BASLADI ----------------
sync_init: process(CLK_50MHZ)
begin
   if (BTN_WEST='1') then
initPS<=idle;
elsif (rising_edge(CLK_50MHZ)) then
initPS<=initNS;
end if;
end process sync_init;

comb_init: process(CLK_50MHZ)
variable sayac:integer range 0 to 750000;
begin
if rising_edge(CLK_50MHZ) then
case initPS is
when idle =>
sayac:=0;
initNS<=ms15;
when ms15 =>
if sayac=750000 then
initNS<=bir;
sayac:=0;
else
sayac:=sayac+1;
end if;
when bir =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=iki;
sayac:=0;
else
sayac:=sayac+1;
end if;
when iki =>
LCD_E0<='0';
if sayac=205000 then
initNS<=uc;
sayac:=0;
else
sayac:=sayac+1;
end if;
when uc =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=dort;
sayac:=0;
else
sayac:=sayac+1;
end if;
when dort =>
LCD_E0<='0';
if sayac=5000 then
initNS<=bes;
sayac:=0;
else
sayac:=sayac+1;
end if;
when bes =>
SF_D0<="0011";
LCD_E0<='1';
if sayac=12 then
initNS<=alti;
sayac:=0;
else
sayac:=sayac+1;
end if;
when alti =>
LCD_E0<='0';
if sayac=2000 then
initNS<=yedi;
sayac:=0;
else
sayac:=sayac+1;
end if;
when yedi =>
SF_D0<="0010";
LCD_E0<='1';
if sayac=12 then
initNS<=sekiz;
sayac:=0;
else
sayac:=sayac+1;
end if;
when sekiz =>
LCD_E0<='0';
if sayac=2000 then
initNS<=tamam;
sayac:=0;
else
sayac:=sayac+1;
end if;
when tamam =>
end case;
end if;
end process comb_init;
--------------------- INIT PROCESSLERI BITTI -----------------

------------ GONDERME BASLADI-----------
sync_proctx: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
txPS<=txNS;
end if;
end process sync_proctx;


tx4lu: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
if secici='0' then
SF_D1<=gonder(7 downto 4);
elsif secici='1' then
SF_D1<=gonder(3 downto 0);
else
SF_D1<="0000";
end if;
end if;
end process tx4lu;

comb_proctx: process(CLK_50MHZ, ayarPS)
variable sayac: integer range 0 to 40000;
begin
if rising_edge(CLK_50MHZ) then


--Bir sonraki LCD_E1 durumu bir önceki case'de belirleniyor.
--Böylece sonraki durum başladığında sinyal istenen durumda olmuş oluyor.
case txPS is
when idle =>
if initPS=tamam then
if ayarPS=cikis then
txNS<=idle;
else
LCD_E1<='0';
txNS<=kirk1;
end if;
end if;

when kirk1 =>

if sayac =2 then
LCD_E1<='1';
txNS<=iyo1;
sayac:=0;
else
sayac:=sayac+1;
end if;
when iyo1 =>

if sayac =12 then
LCD_E1<='0';
txNS<=on1;
sayac:=0;
else
sayac:=sayac+1;
end if;
when on1 =>

if sayac =1 then
LCD_E1<='0';
txNS<=birus;
sayac:=0;
else
sayac:=sayac+1;
end if;
when birus =>

secici<='1';
if sayac =500 then
LCD_E1<='0';
txNS<=kirk2;
sayac:=0;
else
sayac:=sayac+1;
end if;
when kirk2 =>

if sayac =2 then
LCD_E1<='1';
txNS<=iyo2;
sayac:=0;
else
sayac:=sayac+1;
end if;

when iyo2 =>

if sayac =12 then
LCD_E1<='0';
txNS<=on2;
sayac:=0;
else
sayac:=sayac+1;
end if;
when on2 =>

if sayac =1 then
LCD_E1<='0';
txNS<=kirkus;
sayac:=0;
else
sayac:=sayac+1;
end if;
when kirkus =>

if sayac =2000 then
LCD_E1<='0';
txNS<=tamam;
sayac:=0;
secici<='0';
else
sayac:=sayac+1;
end if;
when tamam =>

if (ayarPS=cikis) then
txNS<=idle;
end if;

if txCikis='1' then
txNS<=kirk1;
end if;

end case;
end if;

end process comb_proctx;

------------ GONDERME BITTI----------


--------------------- AYAR PROCESSLERI BASLADI ---------------
sync_ayar: process (CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then
ayarPS<=ayarNS;
end if;
end process sync_ayar;


comb_ayar: process(CLK_50MHZ)
variable sayac: integer range 0 to 82000;
begin
if rising_edge(CLK_50MHZ) then
case ayarPS is
when idle=>
if initPS=tamam then
sayac:=0;
ayarNS<=funcSet;
end if;
when funcSet =>
txCikis<='0';
gonder <="00101000";
if sayac=2000 then
if txPS=tamam then
ayarNS<=entSet;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when entSet =>
txCikis<='0';
gonder<="00000110";
if sayac=2000 then
if txPS=tamam then
ayarNS<=dispOf;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when dispOf =>
txCikis<='0';
gonder <="00001100";
if sayac=2000 then
if txPS=tamam then
ayarNS<=clrDsp;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when clrDsp =>
txCikis<='0';
gonder<="00000001";
if sayac=82000 then
if txPS=tamam then
ayarNS<=tamamAyar;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when tamamAyar =>
txCikis<='0';
if sayac=2000 then
if txPS=tamam then
ayarNS<=setDD;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when setDD =>
txCikis<='0';
gonder<="10000000";
if sayac=2000 then
if txPS=tamam then
ayarNS<=yaz;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when yaz =>
txCikis<='0';
gonder<="01000110";
if sayac=2000 then
if txPS=tamam then
ayarNS<=cikis;
sayac:=0;
txCikis<='1';
end if;
else
sayac:=sayac+1;
end if;
when cikis =>
txCikis<='0';
sayac:=0;
end case;
end if;
end process comb_ayar;
--------------------- AYAR PROCESSLERI BITTI -----------------

end Behavioral;

Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mecharon - 12 Mart 2013, 17:51:53
UCF dosyasında bir değişiklik yaparak dispOf durumuna kadar gelebildim. LCD'nin Strata Flash'la paylaşılmaması durumunda UCF dosyasındaki dizinin 0 (sıfır)'dan başlaması gerekiyormuş.

Yaptığım değişiklik:

NET "SF_D<0>" LOC = "R15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<1>" LOC = "R16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<2>" LOC = "P17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<3>" LOC = "M15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;


Halen daha F harfini LCD'de göremiyorum.
Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: speak48 - 12 Mart 2013, 20:06:47
burada kimse sana şuranda hata var diyemez.
bukadar çok fsmyi kimse ne yapmış diye uğraşıp bakmaz.

tasarımlarda fsm kullanan biri değilim ama şunları söyleyebilirim
ilk aşamada %100 zamanlama olması şartı yok en uzun geçikmeyi referans alıp tüm beklemeleri okadar yaparsan ve fsmleri teke indirgersen tasarım biraz daha  sadeleşir.

Başlık: Ynt: VHDL'yle LCD kullanmak
Gönderen: mecharon - 16 Mart 2013, 10:58:15
Nihayet çalıştı. Ayarlamayı yapan FSM ile LCD'ye veri gönderen FSM'nin haberleşebilmesi gerekiyormuş. Anladığım kadarıyla birinin işi bitmeden diğerinin başlamasına izin vermemek gerekiyor. Çalışan kodlar ve Spartan3e starter board için UCF aşağıda.


library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_Std.all;

entity lcdbenim is
port(
    SF_D : out std_logic_vector(3 downto 0);
    LED : out std_logic_vector(7 downto 0);
    CLK_50MHZ : in std_logic;
    BTN_WEST : in std_logic;
    LCD_E,LCD_RS,LCD_RW, SF_CE0: out std_logic
);
end lcdbenim;
architecture Behavioral of lcdbenim is
type txDurumlar is (idle,kirk1,iyo1,birus,kirk2,iyo2,kirkus,tamam);
signal txPS,txNS: txDurumlar:=idle;
type initDurum is (idle, ms15, bir, iki, uc, dort, bes, alti, yedi, sekiz, tamam);
signal initPS,initNS: initDurum;
type ayarDurum is (idle, funcSet, entSet, dispOf, clrDsp, setDD, yaz, cikis);
signal ayarPS, ayarNS: ayarDurum;
signal LCD_E0, LCD_E1: std_logic:='0';
signal SF_D0,SF_D1: std_logic_vector (3 downto 0):="0000";
signal gonder: std_logic_vector(7 downto 0):="00000000";
signal secim: std_logic:='0';
signal inT, ayT: std_logic:='0';
signal sayac: std_logic_vector(31 downto 0):="00000000000000000000000000000000";
begin
secim<='1' when initNS=tamam else
       '0';
LCD_RS <='1' when ayarNS=yaz else
'0';


LCD_RW<='0';
SF_CE0<='1';
prola: process(CLK_50MHZ)
begin
if rising_edge(CLK_50MHZ) then  
if secim='0' then
        SF_D<= SF_D0;
        LED <=gonder;
        LCD_E<=LCD_E0;
    elsif secim='1' then
        SF_D<= SF_D1;
        LED<=gonder;
        LCD_E<=LCD_E1;
    end if;
end if;
end process prola;

------------ GONDERME BASLADI-----------
sync_proctx: process(CLK_50MHZ)
begin
    if rising_edge(CLK_50MHZ) then
    txPS<=txNS;
    end if;
end process sync_proctx;

comb_proctx: process(CLK_50MHZ, inT, ayarPS,ayT)
begin
    if rising_edge(CLK_50MHZ) AND inT='1' then
         case txPS is
            when idle =>
if ayarPS=idle or ayarPS=cikis then
LCD_E1<='0';
txNS<=idle;
else
LCD_E1<='0';
sayac<=x"00000000";
SF_D1<=gonder(7 downto 4);
txNS<=kirk1;
end if;
            when kirk1 =>
if sayac = x"00000004" then
LCD_E1<='1';
txNS<=iyo1;
sayac<=x"00000000";
else
sayac<=std_logic_vector(unsigned(sayac)+1);
end if;
when iyo1 =>
if sayac = x"0000000E" then
LCD_E1<='0';
sayac<=x"00000000";
txNS<=birus;
else
sayac<=std_logic_vector(unsigned(sayac)+1);
end if;
when birus =>
if sayac = x"000001f4" then
LCD_E1<='0';
SF_D1<=gonder(3 downto 0);
sayac<=x"00000000";
txNS<=kirk2;
else
sayac<=std_logic_vector(unsigned(sayac)+1);
end if;
when kirk2 =>
if sayac = x"00000004" then
LCD_E1<='1';
txNS<=iyo2;
sayac<=x"00000000";
else
sayac<=std_logic_vector(unsigned(sayac)+1);
end if;
when iyo2 =>
if sayac = x"0000000E" then
LCD_E1<='0';
sayac<=x"00000000";
txNS<=kirkus;
else
sayac<=std_logic_vector(unsigned(sayac)+1);
end if;
when kirkus =>
if sayac = x"000007d0" then
sayac<=x"00000000";
txNS<=tamam;
else
sayac<=std_logic_vector(unsigned(sayac)+1);
end if;
when tamam =>
if ayT='0' then
sayac<=std_logic_vector(unsigned(sayac)+1);
elsif ayT='1' then
txNS<=idle;
end if;
          end case;
    end if;
end process comb_proctx;
------------ GONDERME BITTI----------
--------------------- AYAR PROCESSLERI BASLADI ---------------
sync_ayar: process (CLK_50MHZ, ayarNS)
begin
    if rising_edge(CLK_50MHZ) then
        ayarPS<=ayarNS;
    end if;
end process sync_ayar;

comb_ayar: process(CLK_50MHZ, inT, txPS, sayac)
begin
    if rising_edge(CLK_50MHZ) then
    case ayarPS is
    when idle=>
if inT = '1' then
ayarNS<=funcSet;
else
ayarNS<=idle;
end if;
    when funcSet =>
gonder<=x"28";
if txPS=tamam then
if sayac=x"000007d0" then
ayarNS<=entSet;
ayT<='1';
end if;
else
ayT<='0';
end if;
    when entSet =>
gonder<=x"06";
if txPS=tamam then
if sayac=x"000007d0" then
ayarNS<=dispOf;
ayT<='1';
end if;
else
ayT<='0';
end if;
    when dispOf =>
gonder<=x"0C";
if txPS=tamam then
if sayac=x"000007d0" then
ayarNS<=clrDsp;
ayT<='1';
end if;
else
ayT<='0';
end if;
    when clrDsp =>
gonder<=x"01";
if txPS=tamam then
if sayac=x"00014050" then
ayarNS<=setDD;
ayT<='1';
end if;
else
ayT<='0';
end if;
    when setDD =>
gonder<="10000001";
if txPS=tamam then
if sayac=x"000007d0" then
ayarNS<=yaz;
ayT<='1';
end if;
else
ayT<='0';
end if;
    when yaz =>
gonder<="00100110";
if txPS=tamam then
if sayac=x"000007d0" then
ayarNS<=cikis;
ayT<='1';
end if;
else
ayT<='0';
end if;
    when cikis =>
ayT<='0';
    end case;
    end if;
end process comb_ayar;
--------------------- AYAR PROCESSLERI BITTI -----------------
----------------- INIT PROCESSLERI BASLADI ----------------
sync_init: process(CLK_50MHZ, inT)
begin
   if (BTN_WEST='1') then
        initPS<=idle;
    elsif (rising_edge(CLK_50MHZ)) and inT='0' then
        initPS<=initNS;
    end if;
end process sync_init;
comb_init: process(CLK_50MHZ, inT)
variable sayac1:integer;
begin
if rising_edge(CLK_50MHZ) and inT ='0' then
    case initPS is
        when idle =>
            sayac1:=0;
            initNS<=ms15;
        when ms15 =>
            if sayac1=750000 then
                initNS<=bir;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when bir =>
SF_D0<="0011";
            LCD_E0<='1';
            if sayac1=12 then
                initNS<=iki;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when iki =>
            if sayac1=205000 then
                initNS<=uc;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when uc =>
SF_D0<="0011";
LCD_E0<='1';
            if sayac1=12 then
                initNS<=dort;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when dort =>
            if sayac1=5000 then
                initNS<=bes;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when bes =>
SF_D0<="0011";
            LCD_E0<='1';
            if sayac1=12 then
                initNS<=alti;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when alti =>
            if sayac1=2000 then
                initNS<=yedi;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when yedi =>
            SF_D0<="0010";
LCD_E0<='1';
if sayac1=12 then
                initNS<=sekiz;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when sekiz =>
            if sayac1=2000 then
                initNS<=tamam;
                sayac1:=0;
            else
                sayac1:=sayac1+1;
            end if;
        when tamam =>
inT<='1';
    end case;
end if;
end process comb_init;
--------------------- INIT PROCESSLERI BITTI -----------------
end Behavioral;



NET "LCD_E" LOC = "M18" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "LCD_RS" LOC = "L18" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "LCD_RW" LOC = "L17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<0>" LOC = "R15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<1>" LOC = "R16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<2>" LOC = "P17" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_D<3>" LOC = "M15" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "SF_CE0" LOC = "D16" | IOSTANDARD = LVCMOS33 | DRIVE = 4 | SLEW = SLOW ;
NET "BTN_WEST" LOC = "D18" | IOSTANDARD = LVTTL | PULLDOWN ;
NET "CLK_50MHZ" LOC = "C9" | IOSTANDARD = LVCMOS33 ;
NET "LED<0>" LOC = "F12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<1>" LOC = "E12" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<2>" LOC = "E11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<3>" LOC = "F11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<4>" LOC = "C11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<5>" LOC = "D11" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<6>" LOC = "E9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;
NET "LED<7>" LOC = "F9" | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;


[IMG]http://i1293.photobucket.com/albums/b595/mecharon/calisan_zps71d94d74.jpg[/img]