TODOPIC
Otros Microcontroladores / Dispositivos programables => Lógica Programable => Mensaje iniciado por: arlex en 22 de Octubre de 2009, 18:11:42
-
hola estoy tratanto de sintetizar el siguiente codigo
------------------------------------------------
--maquina de estado del LCD
------------------------------------------------
process (reset,clkout)
variable count: integer range 0 to 17;
begin
if (reset ='0') then
count:=0;
elsif(clkout'event and clkout ='1') then
if (count = X"34") then
if letra_e ='1' then
count:=34;
else
count:=X"32";
end if;
end if;
if (count = X"32") then
if letra_e='1' then
count:=33;
end if;
count:=count;
else
if count ="34" then
count:= 34;
else
count:= count+1;
end if;
end if;
case count is
when 0 => en<='0';
when 1 => en<='1';
rw<='0';
rs<='0';
lcd<=X"38";
when 2 => en<='0';
when 3 => en<='1';
rw<='0';
rs<='0';
lcd<=X"38";
when 4 => en<='0';
when 5 => en<='1';
rw<='0';
rs<='0';
lcd<=X"38";
when 6 => en<='0';
when 7 => en<='1';
rw<='0';
rs<='0';
lcd<=X"06";
when 8 => en<='0';
when 9 => en<='1';
rw<='0';
rs<='0';
lcd<=X"0C";
when 10 => en<='0';
when 11 => en<='1';
rw<='0';
rs<='0';
lcd<=X"01";
when 12 => en<='0';
when 13=> en<='1';
rw<='0';
rs<='0';
lcd<=X"80";
when 14 => en<='0';
when 15 => en<='1';
rw<='0';
rs<='1';
lcd<=X"45"; --E
when 16 => en<='0';
when 17 => en<='1';
rw<='0';
rs<='1';
lcd<=X"54"; --T
when 18 => en<='0';
when 19 => en<='1';
rw<='0';
rs<='1';
lcd<=X"4E"; --N
when 20 => en<='0';
when 21 => en<='1';
rw<='0';
rs<='1';
lcd<=X"FE"; -- " "
when 22 => en<='0';
when 23 => en<='1';
rw<='0';
rs<='1';
lcd<=X"31"; --1
when 24 => en<='0';
when 25 => en<='1';
rw<='0';
rs<='1';
lcd<=X"30"; --0
when 26 => en<='0';
when 27 => en<='1';
rw<='0';
rs<='1';
lcd<=X"34"; --4
when 28 => en<='0';
when 29 => en<='1';
rw<='0';
rs<='1';
lcd<=X"30"; --0
when 30 => en<='0';
when 31 => en<='1';
rw<='0';
rs<='0';
lcd<=X"0C"; --Nueva linea
when 32 => en<='0';
when 33 => en<='1';
rw<='0';
rs<='1';
lcd<=letra; -- del teclado
when 34 => nop<='0';
end case;
end if;
end process;
pero me arroja los siguientes errores
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 103. Value 34 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:800 - "C:/LCD_TEC/LCD.vhd" Line 106. Type of count is incompatible with type of 00110010.
ERROR:HDLParsers:3292 - "C:/LCD_TEC/LCD.vhd" Line 101. = has two or more possible definitions in this scope. For example, parameter 2 (string value) can be: std_logic_vector, SIGNED, or UNSIGNED
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 112. Value 33 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:808 - "C:/LCD_TEC/LCD.vhd" Line 116. = can not have such operands in this context.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 117. Value 34 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3292 - "C:/LCD_TEC/LCD.vhd" Line 110. = has two or more possible definitions in this scope. For example, parameter 2 (string value) can be: std_logic_vector, SIGNED, or UNSIGNED
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 169. Value 18 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 170. Value 19 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 174. Value 20 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 175. Value 21 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 179. Value 22 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 180. Value 23 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 184. Value 24 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 185. Value 25 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 189. Value 26 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 190. Value 27 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 194. Value 28 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 195. Value 29 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 199. Value 30 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 200. Value 31 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 204. Value 32 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 205. Value 33 is not included in the range, 0 to 17, of count.
ERROR:HDLParsers:3370 - "C:/LCD_TEC/LCD.vhd" Line 209. Value 34 is not included in the range, 0 to 17, of count.
-
Saludos,
Espero te sirva todavia mi respuesta.
tu problema es simple estas definiendo un rango para tu variable count de 0 a 17 y le asignas otros valores fuera de ese rango
defines :
variable count: integer range 0 to 17;
y asignas, por ejemplo:
if (count = X"34") then
if letra_e ='1' then
count:=34;
else
count:=X"32"; -- quieres asignar un hexadecimal a una variable tipo integer
end if;
end if;
lo que debes de hacer es ampliar tu rango de la variable count hasta el valor mas grande que deseas asignar a dicha variable.
otra cosa en ese misma parte del codigo, defines tu variable count como integer y despues le quieres asignar un hexadecimal
Bye
P.S. seria util que pusieras la numeración de las lineas para poder ubicar más facilmente las lineas de los errores