element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MicroZed Hardware Design Basic pull up tri state test trouble
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 2 replies
  • Subscribers 326 subscribers
  • Views 487 views
  • Users 0 members are here
Related

Basic pull up tri state test trouble

smvo555
smvo555 over 9 years ago

Can  any one weigh in and let me know what's wrong with my basic example below?
I've implemented a very simple tri state example. I've copied two pieces of code below which correspond to the two different oscilliscope images in the attached picture. I constrained the inout csb as it connects on the top level in my block diagram as an internal pull up. I would expect to be able to toggle the pull up using verilog code A below but the inout port stays low for some reason. It seems like it gets stuck I'm hoping that what ever is wrong here is also the problem with my SPI interface.
This is done with a 7z010 Microzed and Vivado tools 2014.1

I don't see anywhere to attach my picture , I'll look more for the option after posting

Thanks so much,

Sam
///////////////////////////////////////////////////////////
//verilog code A


module tri_stated(
    inout csb,
    input clk,
    input reset
    );
    reg oreg;
    assign csb = oreg;
    reg data;
    reg [15:0] count;
    wire oen;
    assign oen = count[3];
    initial oreg = 1'bz;
    always @(posedge clk)
    if(reset)begin
    count <= 16'd0;

   
    end else
    count <= count + 1'b1;
   
       always @(oen or oreg)
       if (oen == 1'b1)
          oreg = 1'd0;
       else if(oen == 1'b0)
          oreg = 1'bz;
         
         
endmodule

///////////////////////////////////////////////////////////
//Verilog code B

module tri_stated(
    inout csb,
    input clk,
    input reset
    );
    reg oreg;
    assign csb = oreg;
    reg data;
    reg [15:0] count;
    wire oen;
    assign oen = count[3];
    initial oreg = 1'bz;
    always @(posedge clk)
    if(reset)begin
    count <= 16'd0;

   
    end else
    count <= count + 1'b1;
   
       always @(oen or oreg)
       if (oen == 1'b1)
          oreg = 1'bz;
       else if(oen == 1'b0)
          oreg = 1'bz;
         
         
endmodule

  • Sign in to reply
  • Cancel
Parents
  • smvo555
    0 smvo555 over 9 years ago

    I don't see a way to attach a picture to this message.
    You would see screen shots on the oscope of the port CSB measured after FPGA config for both code A and code B above.
    Code B goes high after config for ~150us then goes low, code B stays in a high impedance state and on the oscope you can see the port going high after configuration and staying high indefinitely

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • smvo555
    0 smvo555 over 9 years ago in reply to smvo555

    I ended up figuring out the software for some IP peripherals which were handling the tri state bus for me anyways, so I did not have to work at such a low level. Not sure how to this with a custom IP correctly but I suppose with Zynq I don't really need to

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • smvo555
    0 smvo555 over 9 years ago in reply to smvo555

    I ended up figuring out the software for some IP peripherals which were handling the tri state bus for me anyways, so I did not have to work at such a low level. Not sure how to this with a custom IP correctly but I suppose with Zynq I don't really need to

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
No Data
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 © 2025 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