checksum field

This commit is contained in:
leo 2023-09-26 11:22:56 +02:00
parent fd5bd6662e
commit 42d8cb4253
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

View File

@ -30,7 +30,7 @@ ENTITY receptionTrame_com IS
END receptionTrame_com; END receptionTrame_com;
ARCHITECTURE arch of receptionTrame_com IS ARCHITECTURE arch of receptionTrame_com IS
TYPE state IS (waiting, syncBreak0, syncBreak1, syncFieldWait, syncFieldStart, syncFieldData, syncFieldStop, idFieldWait, idFieldStart, idFieldData, idFieldStop, dataFieldWait, dataFieldStart, dataFieldData, dataFieldStop); TYPE state IS (waiting, syncBreak0, syncBreak1, syncFieldWait, syncFieldStart, syncFieldData, syncFieldStop, idFieldWait, idFieldStart, idFieldData, idFieldStop, dataFieldWait, dataFieldStart, dataFieldData, dataFieldStop, checksumFieldWait, checksumFieldStart, checksumFieldData, checksumFieldStop);
SIGNAL cState, nState : state; SIGNAL cState, nState : state;
BEGIN BEGIN
@ -149,7 +149,7 @@ CASE cState IS
if(n_0 = '1') then if(n_0 = '1') then
if(LinSynchro = '1') then if(LinSynchro = '1') then
if(nbData_0 = '1') then if(nbData_0 = '1') then
nState <= waiting; nState <= checksumFieldWait;
else else
nState <= dataFieldWait; nState <= dataFieldWait;
end if; end if;
@ -158,7 +158,30 @@ CASE cState IS
end if; end if;
end if; end if;
WHEN others => WHEN checksumFieldWait =>
if(LinSynchro = '0') then
nState <= checksumFieldStart;
end if;
WHEN checksumFieldStart =>
if(n_0 = '1') then
if(LinSynchro = '0') then
nState <= checksumFieldData;
else
nState <= waiting;
end if;
end if;
WHEN checksumFieldData =>
if(nbBit_0 = '1') then
nState <= checksumFieldStop;
end if;
WHEN checksumFieldStop =>
if(n_0 = '1') then
nState <= waiting;
end if;
end CASE; end CASE;
END PROCESS nStateUpd; END PROCESS nStateUpd;
@ -356,8 +379,46 @@ BEGIN
n_LOAD <= '0'; n_LOAD <= '0';
n_EN <= '1'; n_EN <= '1';
end if; end if;
WHEN checksumFieldWait =>
if(LinSynchro = '0') then
n_SELECT <= '1';
n_LOAD <= '1';
end if;
WHEN checksumFieldStart =>
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 checksumFieldData =>
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 checksumFieldStop =>
WHEN others =>
end CASE; end CASE;
END PROCESS RCS; END PROCESS RCS;