C
Chuck McManis
Guest
So here is a "simple" thing that clearly isn't as simple as one would like.
I'm constructing a PWM unit for a robotics application, given the shortage
of pins on my microprocessor, I'm serially clocking in my data.
My "module" has sdata_in, sdata_out, sclock_in, sclock_out, clock_in,
pwm_out.
As I'm doing this in an inexpensive CPLD, I'd like to be able to gang a
couple together and just tie the sclock_out, sdata_out, to the next chip in
series and then create a chain of these things. However, inside my CPLD I'm
using code like
process (sclock_in, sdata_in) is
begin
if rising_edge(sclock_in) then
data_reg <= data_reg(14 downto 0) & sdata_in;
sdata_out <= data_reg(15);
end if;
end process;
sclock_out <= sclock_in;
Now the trick is that I want to insure that the rising edge of sclock_out
really happens when sdata_out is valid. So basically I'd like to "push" the
assignment of sdata_out ahead of the clock or delay clock out. In a non-CPLD
design I could simply put a buffer between the output clock and the next
chip to add some setup time (at the cost of system throughput I know, I
know) but since we're way under the speed limits here (400K serial
bitstream) it wouldn't be too egregious.
Thoughts? Just let it ride? pointers to a discussion on clock management?
--
--Chuck McManis
Email to the devnull address is discarded
http://www.mcmanis.com/chuck/
I'm constructing a PWM unit for a robotics application, given the shortage
of pins on my microprocessor, I'm serially clocking in my data.
My "module" has sdata_in, sdata_out, sclock_in, sclock_out, clock_in,
pwm_out.
As I'm doing this in an inexpensive CPLD, I'd like to be able to gang a
couple together and just tie the sclock_out, sdata_out, to the next chip in
series and then create a chain of these things. However, inside my CPLD I'm
using code like
process (sclock_in, sdata_in) is
begin
if rising_edge(sclock_in) then
data_reg <= data_reg(14 downto 0) & sdata_in;
sdata_out <= data_reg(15);
end if;
end process;
sclock_out <= sclock_in;
Now the trick is that I want to insure that the rising edge of sclock_out
really happens when sdata_out is valid. So basically I'd like to "push" the
assignment of sdata_out ahead of the clock or delay clock out. In a non-CPLD
design I could simply put a buffer between the output clock and the next
chip to add some setup time (at the cost of system throughput I know, I
know) but since we're way under the speed limits here (400K serial
bitstream) it wouldn't be too egregious.
Thoughts? Just let it ride? pointers to a discussion on clock management?
--
--Chuck McManis
Email to the devnull address is discarded
http://www.mcmanis.com/chuck/