From: Martin Prudek Date: Sun, 5 Apr 2015 15:27:53 +0000 (+0200) Subject: Tested version of ADC state machine. Tested only to prove that 'something works'... X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/rpi-motor-control.git/commitdiff_plain/6aed1bb7f39be0834cce9351ecc4f09c3c8aef06 Tested version of ADC state machine. Tested only to prove that 'something works'. Cannot verify measured data - so thah implemented communication protocol might not be workung. --- diff --git a/pmsm-control/rpi_mc_simple_dc.vhdl b/pmsm-control/rpi_mc_simple_dc.vhdl index 11f97af..0ff098e 100644 --- a/pmsm-control/rpi_mc_simple_dc.vhdl +++ b/pmsm-control/rpi_mc_simple_dc.vhdl @@ -238,6 +238,7 @@ begin dat_reg(63 downto 61) <= hal_in(1 to 3); --halovy sondy dat_reg(60 downto 36) <= (others => '1'); --let the rest fill with ones dat_reg(35 downto 0) <= adc_channels(35 downto 0); --current mesurments + adc_reset<='0'; --remove reset flag, and wait on its rising edge elsif (ce0_old = "01") then --rising edge of SS, we should read the data adc_reset<=dat_reg(95); end if; @@ -315,13 +316,16 @@ begin if (data_ready='1') then case channel is when ch0=> - adc_channels(35 downto 24)<=adc_data(11 downto 0); + --adc_channels(35 downto 24)<=adc_data(11 downto 0); + adc_channels(35 downto 24)<=(others=>'0'); channel:=ch1; when ch1=> - adc_channels(23 downto 12)<=adc_data(11 downto 0); + --adc_channels(23 downto 12)<=adc_data(11 downto 0); + adc_channels(23 downto 12)<=(others=>'1'); channel:=ch2; when ch2=> - adc_channels(11 downto 0)<=adc_data(11 downto 0); + --adc_channels(11 downto 0)<=adc_data(11 downto 0); + adc_channels(11 downto 0)<=(others=>'0'); channel:=ch0; end case; end if;