Ironlord
Member level 3
I tried to edit my last post, but was impossible. Anyway, yes, I do, and I changed the state machine as it should be, just with the states. So...
Now I don't manipulate signals on the state machine, just the status.
I assign the signals out of the process, so now I don't get latches on "data" nor "command".
But I have the following problem, latch on "es".
I don't know why I have a latch in that point. I also tried to remove the "when others" condition, because I'm describing all possible conditions, and to remove "es" from the sensitivity list, but the result is exatly the same.
About your questions, yes, I know the differences between combinational and sequential circuits, but I'm not an electronic engineer, I'm a computer engineer and I often think in software where it isn't. I must change my mind but it's not a thing I can do from today to tomorrow, the process takes it time.
If I'm programming this I2C is because I need to make the protocol work. You've seen in this thread that at first I tried to use IPCores from other people, now I'm doing it by myself, I'm putting effort, I just want to learn and make it work.
Code:
PROCESS(ep, es, reset, change)
BEGIN
IF(reset='1')then
es<=e0;
ELSE
CASE ep IS
WHEN e0 => --Estado de conf
es<=e1;
WHEN e1 =>
if(change='1')then
es<=e2;
end if;
WHEN e2 =>
es<=e2;
WHEN OTHERS =>
es<=es;
END CASE;
END IF;
END PROCESS;
espera<='1' when ep=e1 else '0';
go<='1' when ocupado='0' else '0';
command<=cmd_config when ep=e0 else cmd_write when ep=e2 else command when ep=e1;
data<=data_ports when ep=e0 else data_out when ep=e2 else data when ep=e1;
Now I don't manipulate signals on the state machine, just the status.
I assign the signals out of the process, so now I don't get latches on "data" nor "command".
But I have the following problem, latch on "es".
Warning (10631): VHDL Process Statement warning at pruebaI2C.vhd(58): inferring latch(es) for signal or variable "es", which holds its previous value in one or more paths through the process
I don't know why I have a latch in that point. I also tried to remove the "when others" condition, because I'm describing all possible conditions, and to remove "es" from the sensitivity list, but the result is exatly the same.
About your questions, yes, I know the differences between combinational and sequential circuits, but I'm not an electronic engineer, I'm a computer engineer and I often think in software where it isn't. I must change my mind but it's not a thing I can do from today to tomorrow, the process takes it time.
If I'm programming this I2C is because I need to make the protocol work. You've seen in this thread that at first I tried to use IPCores from other people, now I'm doing it by myself, I'm putting effort, I just want to learn and make it work.
Last edited: