G
Grumps
Guest
Hi
I'm not a VHDL expert, just learning, so please don't shout.
I'm using Xilinx ISE9.2sp4 and have the following code as part of a state
machine:
CP_IN_OUTPUT_DECODE: process (state_cp_in)
begin
if state_cp_in = sta_idle then
RDY <= 'Z';
BUSY <= '0';
end if;
if state_cp_in = sta_1 then
RDY <= '0';
BUSY <= '0';
end if;
if state_cp_in = sta_2 then
RDY <= '1';
BUSY <= '1';
end if;
....
....etc
The state machine goes from sta_idle, then to sta_1, then to sta_2, etc.
RDY is a pin on the device.
During operation, I can see RDY go low in sta_1, but not high in sta_2. I
know it gets to sta_2 as I can observe BUSY. I don't think RDY is tri-stated
in sta_2 as there is an external pull-up; it just stays low. Gray encoding
is used.
If I change the RDY to rdyi (signal) and then have:
RDY <= 'Z' when state_cp_in = sta_idle else rdyi;
outside of the decode process then it all behaves itself.
Apart from lack of experience, what mistake(s) have I made?
Thanks.
I'm not a VHDL expert, just learning, so please don't shout.
I'm using Xilinx ISE9.2sp4 and have the following code as part of a state
machine:
CP_IN_OUTPUT_DECODE: process (state_cp_in)
begin
if state_cp_in = sta_idle then
RDY <= 'Z';
BUSY <= '0';
end if;
if state_cp_in = sta_1 then
RDY <= '0';
BUSY <= '0';
end if;
if state_cp_in = sta_2 then
RDY <= '1';
BUSY <= '1';
end if;
....
....etc
The state machine goes from sta_idle, then to sta_1, then to sta_2, etc.
RDY is a pin on the device.
During operation, I can see RDY go low in sta_1, but not high in sta_2. I
know it gets to sta_2 as I can observe BUSY. I don't think RDY is tri-stated
in sta_2 as there is an external pull-up; it just stays low. Gray encoding
is used.
If I change the RDY to rdyi (signal) and then have:
RDY <= 'Z' when state_cp_in = sta_idle else rdyi;
outside of the decode process then it all behaves itself.
Apart from lack of experience, what mistake(s) have I made?
Thanks.