In this part of my state machine for controlling a UART. I am expecting my count variable to well... the code is pretty simple:
when stReceive =>
rdSig <= '0';
wrSig <= '0';
-- If new data is available for reading
if (rdaSig = '1') then
-- Later want to read the length, then keep reading until we see a full packet
aucDataPacketBuf(brCount) <= dbOutSig;
-- This check never passes... why?
if (brCount < 15) then
brCount <= brCount + 1;
stNext <= stReceive;
else
brCount <= 0;
-- Ready to send data
dbInSig <= "01111001"; -- 'y'
stNext <= stSend;
end if;
else
stNext <= stReceive;
end if;
I have declared the signal between architecture and begin in my top-level component as follows:
-- RXD packet counter signal, bytes remaining
signal brCount : integer range 0 to 15 := 0;
Should this be working? the if (brCount < 15) statement fails every single time, but I set it to 0 in the else. I am certain the else is hitting as I get a y character back in hyperterm every time I send a character.
when stReceive =>
rdSig <= '0';
wrSig <= '0';
-- If new data is available for reading
if (rdaSig = '1') then
-- Later want to read the length, then keep reading until we see a full packet
aucDataPacketBuf(brCount) <= dbOutSig;
-- This check never passes... why?
if (brCount < 15) then
brCount <= brCount + 1;
stNext <= stReceive;
else
brCount <= 0;
-- Ready to send data
dbInSig <= "01111001"; -- 'y'
stNext <= stSend;
end if;
else
stNext <= stReceive;
end if;
I have declared the signal between architecture and begin in my top-level component as follows:
-- RXD packet counter signal, bytes remaining
signal brCount : integer range 0 to 15 := 0;
Should this be working? the if (brCount < 15) statement fails every single time, but I set it to 0 in the else. I am certain the else is hitting as I get a y character back in hyperterm every time I send a character.