Hi,
I am working on a test jig board used to burn in new oscillators. There are 24 oscillators on the board and a Xilinx CPLD is used to select one of them to read from. The selection is performed through the CPU's data bus. The interface between the CPU and CPLD consists of a chip select, read/write, reset and the oscillator output. The output is fed into an timer input for one of the CPU's timers. The chip select and read/write signals are required because the data bus is shared between multiple peripherals, not just the CPLD.
So, I need to write the RTL for the CPLD to select the oscillator. It will basically act as a 24:1 MUX, where the select lines are 5 signals from the CPU's data bus. I've verified with a scope that I am accessing the CPLD correctly from the CPU.
My difficulty is that I need to feed the selected oscillator through to the output continuously (until another oscillator is selected, which could be any length of time). From the way I've currently written the RTL code, the output from the CPLD toggles based on the oscillator's voltage, but only at each access to the CPLD. Instead, I need the oscillator's output to be *continuously* fed through the CPLD's output to the timer input on the CPU (until the next valid access to the CPLD).
Any ideas or help is appreciated.
Here is the MUX process:
process(reset_n) begin
if(reset_n = '0') then
osc_out <= 'Z';
elsif (cs_n = '0' and rw = '0') then
if (cpu_d = "00001") then
osc_out <= osc(1);
last_osc_out <= osc(1);
elsif(cpu_d = "00010") then
osc_out <= osc(2);
last_osc_out <= osc(2);
(etc...)
(etc...)
elsif(cpu_d = "11000") then
osc_out <= osc(24);
last_osc_out <= osc(24);
end if;
else
osc_out <= last_osc_out;
end if;
end process;
I am working on a test jig board used to burn in new oscillators. There are 24 oscillators on the board and a Xilinx CPLD is used to select one of them to read from. The selection is performed through the CPU's data bus. The interface between the CPU and CPLD consists of a chip select, read/write, reset and the oscillator output. The output is fed into an timer input for one of the CPU's timers. The chip select and read/write signals are required because the data bus is shared between multiple peripherals, not just the CPLD.
So, I need to write the RTL for the CPLD to select the oscillator. It will basically act as a 24:1 MUX, where the select lines are 5 signals from the CPU's data bus. I've verified with a scope that I am accessing the CPLD correctly from the CPU.
My difficulty is that I need to feed the selected oscillator through to the output continuously (until another oscillator is selected, which could be any length of time). From the way I've currently written the RTL code, the output from the CPLD toggles based on the oscillator's voltage, but only at each access to the CPLD. Instead, I need the oscillator's output to be *continuously* fed through the CPLD's output to the timer input on the CPU (until the next valid access to the CPLD).
Any ideas or help is appreciated.
Here is the MUX process:
process(reset_n) begin
if(reset_n = '0') then
osc_out <= 'Z';
elsif (cs_n = '0' and rw = '0') then
if (cpu_d = "00001") then
osc_out <= osc(1);
last_osc_out <= osc(1);
elsif(cpu_d = "00010") then
osc_out <= osc(2);
last_osc_out <= osc(2);
(etc...)
(etc...)
elsif(cpu_d = "11000") then
osc_out <= osc(24);
last_osc_out <= osc(24);
end if;
else
osc_out <= last_osc_out;
end if;
end process;