- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, i have the max10 de-10 lite and im having a small issue with the seven segments.
My code is below, so when given input the board works fine, just like expected but when it has no input the seven segment displays 63.null 7 (null, doesnt display anything). Is my default wrong on the case? I tried this 7'b000_000; but it displays 63.87, basically the same instead of the null, do u have some ideas maybe what is happening?
Thank you for your time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the inputs are unconnected and there's no pull-down resistors or other physical means to pull them down to the a low state, then you have no reason to expect that they would default to a low state. The state of a floating input should be regarded as unpredictable. In fact, with some devices, floating inputs can float to the transition region and/or oscillate, which can cause all kinds of problems including excessive power consumption and noise. Letting inputs float without some physical means to pull them definitively in one direction or the other is generally bad practice that should be avoided.
Fortunately for you, the FPGA's I/O cells have a build-in means to do this, including internal weak pull-ups that can be optionally enabled. The fact that your inputs seem to be defaulting to the high state when unconnected suggests that you might already be enabling these pull-ups, whether you knew it or not.
If I may make a suggestion about how to handle this in your design, you should make sure to enable these pull-ups, first and foremost. But then, also, you can actually take advantage of the fact that they pull your input vector to this numerically invalid state of all high. You can have your logic detect this as a way to determine that your inputs are unconnected, in which case you could put up an appropriate indication on the 7-seg displays, like "----" or "Err" or some such thing.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you mean when you say the board has "no input"? Are the input pins to the FPGA simply floating? Are there pull-ups?
Anyhow, the output pattern you're describing is exactly what you'd expect to see from your code if your inputs are all high, i.e. if inBoard = 7'b1111111 and inBoard2 = 6'b111111. This will result in:
digit0 = 127 % 10 = 7
digit1 = 127 / 10 = 12 (which your 7-segment case turns to null)
digit2 = 63 % 10 = 3
digit3 = 63 / 10 = 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, sorry for not giving enough information.
I basically have a microcontroller that reads some data, to be exact it reads the temperature of its cpu and i send it to the fpga connected with the arduino pins on the fpga.
Now when i connect the MCU to the fpga , the seven segment displays exactly what the mcu temp is reading, but when there is nothing connected on the arduino pins on the fpga i get this number . Just like you described i get all high inputs. Can u explain to me why that happens?? Shouldnt they be low inputs instead of high?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the inputs are unconnected and there's no pull-down resistors or other physical means to pull them down to the a low state, then you have no reason to expect that they would default to a low state. The state of a floating input should be regarded as unpredictable. In fact, with some devices, floating inputs can float to the transition region and/or oscillate, which can cause all kinds of problems including excessive power consumption and noise. Letting inputs float without some physical means to pull them definitively in one direction or the other is generally bad practice that should be avoided.
Fortunately for you, the FPGA's I/O cells have a build-in means to do this, including internal weak pull-ups that can be optionally enabled. The fact that your inputs seem to be defaulting to the high state when unconnected suggests that you might already be enabling these pull-ups, whether you knew it or not.
If I may make a suggestion about how to handle this in your design, you should make sure to enable these pull-ups, first and foremost. But then, also, you can actually take advantage of the fact that they pull your input vector to this numerically invalid state of all high. You can have your logic detect this as a way to determine that your inputs are unconnected, in which case you could put up an appropriate indication on the 7-seg displays, like "----" or "Err" or some such thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your time.
i will try to use pull ups to see how it works
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made some changes on the code
I basically added an always_ff and a clock that checks the inputs
The rest of the code is the same. Still im wondering why does it get high input. Would be grateful if u can answer that.
Thank for your time.
always_ff @(posedge clk)
begin
if (inBoard == 7'b1111111)
inBoard_Decimal <= 7'b0000000;
else
inBoard_Decimal <= inBoard;
if (inBoard2 == 6'b111111)
inBoard2_Decimal <= 6'b000000;
else
inBoard2_Decimal <= inBoard2;
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I see that community users have helped you in your case.
On your query related to undriven input pins, the pins can be read as high or low. It is unpredictable. Occasionally it could be read as high due to some leakage current following through the pins.
Hope this answers your question.
Regards
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page