I am planning to program a PID controller on the Basys3. For this purpose,

I first tried to get a signal from a function generator into the ADC (pmodAD1) and output it through the DAC (pmodDA2). This works fine.

I wanna take the digital output of the ADC, multiply or divide it by a real factor and output the result through the DAC. There might be better ways of doing this but in order to specify the re number, I have created two integer numbers and apply a division between them. This would allow me to get any "real" number that I want.

constant mul_number : integer := 5;

constant div_number : integer := 4;

signal mul_number_unsigned : unsigned(11 downto 0);

signal div_number_unsigned : unsigned(11 downto 0);

Dear All,

I am planning to program a PID controller on the Basys3. For this purpose,

constant mul_number : integer := 5;constant div_number : integer := 4;signal mul_number_unsigned : unsigned(11 downto 0);signal div_number_unsigned : unsigned(11 downto 0);mul_number_unsigned <= to_unsigned(mul_number,12);div_number_unsigned <= to_unsigned(div_number,12);mul_number_unsigned/div_number_unsigned = integer :the voltage height increases according to the set value.mul_number_unsigned/div_number_unsigned > 1 and real :nothing happens to the signal and the same input signal is output again.mul_number_unsigned/div_number_unsigned < 1 , positive and real :the is no output signal.I do not know how to solve the problem since the compiling does not give me any warning or error...Any help or suggestion would be really appreciated.

Thanks a lot!

PS: sorry for the code file format but the system did not allow me to upload a .vhd file.

acd_func_dac.txt

## Share this post

## Link to post

## Share on other sites