Changeset 9939 for firmware/FTU/rs485


Ignore:
Timestamp:
09/22/10 18:08:06 (14 years ago)
Author:
weitzel
Message:
FTU RS485 interface is now connected to main control
Location:
firmware/FTU/rs485
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • firmware/FTU/rs485/FTU_rs485_control.vhd

    r9928 r9939  
    33-- Engineer:       Q. Weitzel, P. Vogler
    44--
    5 -- Create Date:    09/13/2010 
     5-- Create Date:    09/13/2010
    66-- Design Name:
    7 -- Module Name:    FTU_rs485_control - Behavioral 
     7-- Module Name:    FTU_rs485_control - Behavioral
    88-- Project Name:
    99-- Target Devices:
     
    1111-- Description:    top level entity of FTU RS485 module
    1212--
    13 -- Dependencies: 
     13-- Dependencies:
    1414--
    1515-- Revision:
     
    5050    tx_d                    : OUT std_logic;
    5151    tx_en                   : OUT std_logic;
    52     new_DACs                : OUT std_logic;  -- new DACs arrived via RS485
    53     new_enables             : OUT std_logic;  -- new enables arrived via RS485
    54     new_prescaling          : OUT std_logic;  -- new prescaling arrived via RS485
    55     read_rates              : OUT std_logic;  -- FTM wants to read rates
    56     read_DACs               : OUT std_logic;  -- FTM wants to read DACs
    57     read_enables            : OUT std_logic;  -- FTM wants to read enable pattern
    58     read_prescaling         : OUT std_logic;  -- FTM wants to read prescaling value
    59     --rs485_error           : OUT std_logic;  -- to be discussed!
     52    new_DACs                : OUT std_logic := '0';  -- new DACs arrived via RS485
     53    new_enables             : OUT std_logic := '0';  -- new enables arrived via RS485
     54    new_prescaling          : OUT std_logic := '0';  -- new prescaling arrived via RS485
     55    read_rates              : OUT std_logic := '0';  -- FTM wants to read rates
     56    read_DACs               : OUT std_logic := '0';  -- FTM wants to read DACs
     57    read_enables            : OUT std_logic := '0';  -- FTM wants to read enable pattern
     58    read_prescaling         : OUT std_logic := '0';  -- FTM wants to read prescaling value
    6059    dac_array_rs485_out     : OUT dac_array_type;
    6160    enable_array_rs485_out  : OUT enable_array_type;
     
    278277        when SET_DAC_WAIT=>  -- wait until FTU control says "done" and then answer to FTM
    279278          if (DACs_ready = '1') then
    280             new_DACs <= '0';           
     279            new_DACs <= '0';
    281280            FTU_rs485_control_State <= SET_DAC_TRANSMIT;
    282281          else
     
    288287          if (enables_ready = '1') then
    289288            new_enables <= '0';
    290             FTU_rs485_control_State <= RECEIVE;
     289            FTU_rs485_control_State <= SET_ENABLE_TRANSMIT;
    291290          else
    292291            new_enables <= '1';
     
    297296          if (prescaling_ready = '1') then
    298297            new_prescaling <= '0';
    299             FTU_rs485_control_State <= RECEIVE;
     298            FTU_rs485_control_State <= SET_PRESCALING_TRANSMIT;
    300299          else
    301300            new_prescaling <= '1';
     
    306305          if (rates_ready = '1') then
    307306            read_rates <= '0';
    308             FTU_rs485_control_State <= RECEIVE;
     307            FTU_rs485_control_State <= READ_RATES_TRANSMIT;
    309308          else
    310309            read_rates <= '1';
     
    315314          if (DACs_ready = '1') then
    316315            read_DACs <= '0';
    317             FTU_rs485_control_State <= RECEIVE;
     316            FTU_rs485_control_State <= READ_DAC_TRANSMIT;
    318317          else
    319318            read_DACs <= '1';
     
    324323          if (enables_ready = '1') then
    325324            read_enables <= '0';
    326             FTU_rs485_control_State <= RECEIVE;
     325            FTU_rs485_control_State <= READ_ENABLE_TRANSMIT;
    327326          else
    328327            read_enables <= '1';
     
    333332          if (prescaling_ready = '1') then
    334333            read_prescaling <= '0';
    335             FTU_rs485_control_State <= RECEIVE;
     334            FTU_rs485_control_State <= READ_PRESCALING_TRANSMIT;
    336335          else
    337336            read_prescaling <= '1';
  • firmware/FTU/rs485/FTU_rs485_interpreter.vhd

    r9928 r9939  
    110110            int_read_enables    <= '0'; 
    111111            int_read_prescaling <= '0';
    112             dac_array_rs485_out_sig <= (conv_integer(unsigned(data_block(47 downto 32))),
    113                                         conv_integer(unsigned(data_block(63 downto 48))),
    114                                         conv_integer(unsigned(data_block(79 downto 64))),
    115                                         conv_integer(unsigned(data_block(95 downto 80))),
    116                                         0,0,0,
    117                                         conv_integer(unsigned(data_block(111 downto 96)))
     112            dac_array_rs485_out_sig <= (conv_integer(unsigned(data_block(43 downto 32))),
     113                                        conv_integer(unsigned(data_block(59 downto 48))),
     114                                        conv_integer(unsigned(data_block(75 downto 64))),
     115                                        conv_integer(unsigned(data_block(91 downto 80))),
     116                                        DEFAULT_DAC(4),
     117                                        DEFAULT_DAC(5),
     118                                        DEFAULT_DAC(6),
     119                                        conv_integer(unsigned(data_block(107 downto 96)))
    118120                                        );
    119121            FTU_rs485_interpreter_State <= WAIT_FOR_DATA;
Note: See TracChangeset for help on using the changeset viewer.