id field data

This commit is contained in:
leo 2023-09-26 10:49:17 +02:00
parent 7e5d636cd0
commit 483aac6162
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

View File

@ -30,7 +30,7 @@ ENTITY receptionTrame_com IS
END receptionTrame_com;
ARCHITECTURE arch of receptionTrame_com IS
TYPE state IS (waiting, syncBreak0, syncBreak1, syncFieldWait, syncFieldStart, syncFieldData, syncFieldStop, idFieldWait);
TYPE state IS (waiting, syncBreak0, syncBreak1, syncFieldWait, syncFieldStart, syncFieldData, syncFieldStop, idFieldWait, idFieldStart, idFieldData, idFieldStop);
SIGNAL cState, nState : state;
BEGIN
@ -97,6 +97,34 @@ CASE cState IS
nState <= waiting;
end if;
end if;
WHEN idFieldWait =>
if(LinSynchro = '0') then
nState <= idFieldStart;
end if;
WHEN idFieldStart =>
if(n_0 = '1') then
if(LinSynchro = '0') then
nState <= idFieldData;
else
nState <= waiting;
end if;
end if;
WHEN idFieldData =>
if(nbBit_0 = '1') then
nState <= idFieldStop;
end if;
WHEN idFieldStop =>
if(n_0 = '1') then
if(LinSYnchro = '1') then
nState <= waiting; -- data frame
else
nState <= waiting;
end if;
end if;
WHEN others =>
end CASE;
@ -112,6 +140,7 @@ BEGIN
nbBit_LOAD <= '1';
nbBit_SELECT <= '0';
end IF;
WHEN syncBreak0 =>
if(LinSynchro = '1') then
if(nbBit_0 = '1') then
@ -132,6 +161,7 @@ BEGIN
n_EN <= '1';
nbBit_LOAD <= '0';
end if;
WHEN syncBreak1 =>
if(n_0 = '1') then
if(LinSynchro = '0') then
@ -141,11 +171,13 @@ BEGIN
n_LOAD <= '0';
n_EN <= '1';
end if;
WHEN syncFieldWait =>
if(LinSynchro = '0') then
n_LOAD <= '1';
n_SELECT <= '1';
end if;
WHEN syncFieldStart =>
if(n_0 = '1') then
if(LinSynchro = '0') then
@ -160,6 +192,7 @@ BEGIN
n_LOAD <= '0';
n_EN <= '1';
end if;
WHEN syncFieldData =>
if(nbBit_0 = '1') then
n_SELECT <= '0';
@ -178,6 +211,56 @@ BEGIN
end if;
nbBit_LOAD <= '0';
end if;
WHEN syncFieldStop =>
if(n_0 = '1') then
if(LinSynchro = '1') then
else
-- ERROR sync stop
end if;
else
n_LOAD <= '0';
n_EN <= '1';
end if;
WHEN idFieldWait =>
if(LinSynchro = '0') then
n_SELECT <= '1';
n_LOAD <= '1';
end if;
WHEN idFieldStart =>
if(n_0 = '1') then
n_SELECT <= '0';
n_LOAD <= '1';
nbBit_SELECT <= '1';
nbBit_LOAD <= '1';
else
n_LOAD <= '0';
n_EN <= '1';
end if;
WHEN idFieldData =>
if(nbBit_0 = '1') then
n_SELECT <= '0';
n_LOAD <= '1';
octetRecu_EN <= '0';
else
if(n_0 = '1') then
n_LOAD <= '1';
n_SELECT <= '0';
nbBit_EN <= '1';
octetRecu_EN <= '1';
else
n_LOAD <= '0';
nbBIt_EN <= '0';
octetRecu_EN <= '0';
end if;
nbBit_LOAD <= '0';
n_EN <= '1';
end if;
WHEN others =>
end CASE;