element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum programming AD75019 with FPGA
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 37 replies
  • Subscribers 480 subscribers
  • Views 4113 views
  • Users 0 members are here
Related

programming AD75019 with FPGA

Former Member
Former Member over 13 years ago
Report Post       Today, 06:56 AM

Hello,
please , i want to program AD75019 , an analogue Cross point Switch from analogue devices 16x16, with FPGA, ad75019 have a serial interface, i'have to shift 256 bit into 256 bit shift register , once the register is full i apply a PCLK pulse to to transfer the register to latch (like it's mentionned in the datasheet) my problem is, that i can'T close or open any switch image
please , anyone could help, thanks in Advance

 

this my configuration:

 

VDD:11V
VCC:5V
VSS: 0V

 

SCLK: 1MHZ

 

this how i did the spi interface : a shift register of 256 bit with a state machine for controlling PCLK signal:

 


-- spi_SM.vhd

 


library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;
use ieee.std_logic_arith.all;

 

entity spi_SM is

 

generic(N:integer :=256; C:integer :=9; D:integer :=4 );
-- generic(C:integer :=9);
port(
clk :in std_logic;
rst_n:in std_logic;

 

data: in std_logic_vector (N-1 downto 0);
SCLK: inout std_logic; --inout pour qu'il peut etre lu en process
SIN imageut std_logic;
PCLK: out std_logic

 

);
end spi_SM;

 

architecture rtl of spi_SM is

 


type States is (ACTIF, UPDATE, IDLE);
signal state : States := ACTIF;
signal EndSend : std_logic_vector(8 downto 0);
signal t_rst_cnt_n : std_logic ;

 

--Diviseur (pour generer la frequence d'horloge du port SPI(20Khz-5Mhz))
component diviseur
generic ( N : integer := 4 );
port(
clk : in std_logic ;
rst_n : in std_logic ;
clk_out : out std_logic
);
end component;

 

--Compteurnbit
component Compteurnbit
generic ( N : integer := 16 );
port(
clk : in std_logic ;
rst_cnt_n : in std_logic ;
OutCount : inout std_logic_vector(N-1 downto 0)
);
end component;

 


--Sregister
component Sregister
generic ( N : integer := 256 );
port(
clk : in std_logic;
rst_n : in std_logic;
S :in std_logic_vector (N-1 downto 0);-- durée de train d'impulsion
Q : out std_logic
);
end component;

 


begin

 

U0_diviseur : diviseur generic map(D) port map(clk, rst_n, SCLK); ---definir frequence de SPI (clk de base=20 Mhz)
U0_Sregister : Sregister generic map(N) port map(SCLK,rst_n,data,SIN);
U0_Compteurnbit : Compteurnbit generic map(C) port map(SCLK,t_rst_cnt_n,EndSend);-- counting 256 pulse to set EndSend

 


send : process (SCLK,EndSend)
begin

 

if (rst_n='0') then
t_rst_cnt_n<='0';
else
case state is
when
actif=>
if (unsigned(EndSend) = 256) then -- opertation arithmetique donc convertit std_logic_vector en unsigned
PCLK<='0';--0
t_rst_cnt_n<='0';
state<= UPDATE;
else
t_rst_cnt_n<='1';
PCLK<='1';
state<= ACTIF;
end if;
when UPDATE=>
PCLK<='1';--0
-- state<= actif ;
state<= IDLE;
when IDLE=>
PCLK<='1';
state<= IDLE;

 


end case;

 

end if;
end process;

 

end;


  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 13 years ago

    Hello Michael,

     

    i improve my code to respect exactly the delay as it's mentioned on the time diagram , here tow screenshot for the simulation, i did a state machine to control SCLK and PCLK , the master clock of the FSM is clk2=2.5 MHZ, so i have SCLK with F=625 KHZ

    unfortunately, still i can't control switch image, what do you think ?

     

    imageimage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 13 years ago in reply to Former Member

    Hello Hachani,

     

    Your simulated signals look OK to me.

     

    Try running your code and monitor the SOUT pin of the AD75019 - you should see a delayed version of your input (you might need more than 256 clock cycles).

     

    Michael Kellett

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to michaelkellett

    when i monitor my cicrcuit this what i found:

    this is the data  to send to the AD75019 X"0001000000000000000000000000000000000000000000000000000000000000";

    SCLK in the output is always running imageimageimage( SCLK is supposed to stop after 256 cycleimage)

    SOUT is always  high image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 13 years ago in reply to michaelkellett

    when i monitor my cicrcuit this what i found:

    this is the data  to send to the AD75019 X"0001000000000000000000000000000000000000000000000000000000000000";

    SCLK in the output is always running imageimageimage( SCLK is supposed to stop after 256 cycleimage)

    SOUT is always  high image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • michaelkellett
    michaelkellett over 13 years ago in reply to Former Member

    Try connecting SIN to 0V and see if SOUT changes (with a clock running) and PCLK high.

     

    What logic levels are you seeing on SCLK, PCLK and SIN ?

    (Should be 0 - 3.3V)

     

    Michael Kellett

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to michaelkellett

    SOUT=3.3V (RMS)

    image When i connect SIN to 0V, SOUT change to 4.3 V and then it return to 3.3V(RMS) even after i re connect SIN to 0V

     

    SCLK: 1.8 V(RMS) 5.36V(MAX)

    PCLK: 3.3V (RMS)

    SIN: 0V

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 13 years ago in reply to Former Member

    How are you measuring the signal levels ?

     

    RMS doesn't seem quite right. You need to tell me the low level of the clock and data and the high level - the waveforms should look like the diagram in the data sheet.

     

    I would expect them to about 0v for low (perhaps up to 0.2V) and 3.3V for high. (Have you set up the FPGA for 3.3V outputs ?).

     

    SOUT will be 0V - 5V approx.

     

    Michael Kellett

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to michaelkellett

    hi Michael,

     

    i use oscilloscope to do measuring

     

    the output of the FPGA is configured to 3.3V

     

    SOUT: 3.60V (MAX)  3.04V (MIN)

    SCLK: 5.52V (MAX) -2.48V (MIN)  ( image i don't no why it's negative, i make auto set for the oscilloscope and it still negative )

    PCLK: 3.60V (MAX)  3.04V (MIN)

    SIN   : 0V

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube