First hardware project - a system to check car battery

WBahn

Joined Mar 31, 2012
30,077
Your ADC appears to be an 8-bit ADC. Usually, D0 is the least significant bit. So you are only sending the least four sig figs of your conversion result to the preload bits of the counter.

If you want to get 8-bits, then you need an 8-bit counter (which can be done by cascading two 4-bit counters).
 

Thread Starter

raziell122

Joined Mar 28, 2023
63
Your ADC appears to be an 8-bit ADC. Usually, D0 is the least significant bit. So you are only sending the least four sig figs of your conversion result to the preload bits of the counter.

If you want to get 8-bits, then you need an 8-bit counter (which can be done by cascading two 4-bit counters).
I see, can you please explain me how the way connect them in cascade? and where do their outputs go to? as you can see I did not connect the counter's outputs to anywhere yet.
 

WBahn

Joined Mar 31, 2012
30,077
If you want to use the count-down/count-up method to convert from binary to BCD, then you will end up with a BCD representation of the binary value.

But that binary is just a number. In the case of an 8-bit ADC, it's going to represent how far into the input range the current input voltage is.

If you have a 0 V to 10 V reference range and you apply 5 V, then your output is going to be about half way, or 10000000 (give to take). When you convert that to BCD, you will get (1)(2)(8) (again, give or take).

If you want to display the value of the voltage, then you need to get the binary value scaled so that it represents the voltage.
 

WBahn

Joined Mar 31, 2012
30,077
I see, can you please explain me how the way connect them in cascade? and where do their outputs go to? as you can see I did not connect the counter's outputs to anywhere yet.
What is the point of this assignment? Usually, it's for YOU to put in some effort to figure these things out and not for you to just expect others to tell you how to do every little piece. There is very little learning to be had with that approach.
 

crutschow

Joined Mar 14, 2008
34,468
I have created this circuit so far, and it's counting from 0 to 9 and repeat.
That's because you are just letting the counter free run.
You need to think about the steps needed to do what you want, not just arbitrarily connect things together.

Follow these steps:
  1. Parallel load the A/D value into the binary down counter, at the same time resetting the BCD to zero. This requires a pulse to both counters.
  2. Count down and detect when the binary counter reaches zero, using that to stop the count, giving the BCD counter value.
  3. Rinse and repeat (go back to 1).
We are here to help you with concepts, not spoon feed you the complete design.
 

Thread Starter

raziell122

Joined Mar 28, 2023
63
What is the point of this assignment? Usually, it's for YOU to put in some effort to figure these things out and not for you to just expect others to tell you how to do every little piece. There is very little learning to be had with that approach.
I agree with what you said, it's just pretty difficult for me since I don't even know where to start..
lecturers gave us the task to build a project from zero, and we don't even know the components yet.
Thanks for your advice anyway..
 

WBahn

Joined Mar 31, 2012
30,077
I agree with what you said, it's just pretty difficult for me since I don't even know where to start..
lecturers gave us the task to build a project from zero, and we don't even know the components yet.
Thanks for your advice anyway..
Well, that's the way it's usually going to be out in the real world. Remember, an engineer is someone that solves other peoples' problems.

Have you looked at the data sheet for any of the parts you are using? You seem to be coming from a perspective that all you need is for the part to be in Multisim and that from there you just need others to tell you what to do with it. That's not engineering.

You've been given a huge hint -- namely, cascade two 4-bit counters to make an 8-bit counter. So now it's up to YOU to go look at the data sheets and figure out how to do that. Remember, the people that wrote the data sheets WANT you to use those parts for as many different things as possible, so they almost always have reference designs for how to do some of them.
 

Thread Starter

raziell122

Joined Mar 28, 2023
63
Have you never studied digital logic or used digital logic ICs before?
Iv'e studied about logic gates, multiplexers, decoders etc. only theoretical material, I mean I never used them practically to build a circuit and I never really used datasheets before. Also, Iv'e done analog electronics course few months ago, but about digital logic ICs Iv'e only started a course around 3 weeks ago and haven't studied yet about anything except for basic DAC/ADC and again, only theoretical material to solve exercises.
 

crutschow

Joined Mar 14, 2008
34,468
Iv'e studied about logic gates, multiplexers, decoders etc. only theoretical material, I mean I never used them practically to build a circuit
Then I suggest you get very familiar with the data sheets for the IC's you want to use.
It's necessary for any design work you need to do.

It can be daunting at first, and will take a fair amount of time, but you should be able to then determine which parameters are important to your application, and which are minor or not important.

Place particular attention the the timing of the various digital signals to achieve proper operation of the IC.
Any deviation from the proper timing will likely lead to failure of the circuit to operate properly.
 
Last edited:

Thread Starter

raziell122

Joined Mar 28, 2023
63
Then I suggest you get very familiar with the data sheets for the IC's you want to use.
It's necessary for any design work you need to do.
It can be daunting at first, and will take a fair amount of time but you should be able to determine which parameters are important to your application, and which are minor or not important.
Place particular attention the the timing of the various digital signals to achieve proper operation of the IC.
Thanks a lot for your advice! It definitely will require hardworking for me since English is not my native language so it doesn't make the way shorter :D
 

crutschow

Joined Mar 14, 2008
34,468
Thanks a lot for your advice! It definitely will require hardworking for me since English is not my native language so it doesn't make the way shorter :D
I can appreciate the added difficulty of that, but it's likely something you will have to continually deal with in your career.
Can you find any datasheets in your native language?
 

Thread Starter

raziell122

Joined Mar 28, 2023
63
I can appreciate the added difficulty of that, but it's likely something you will have to continually deal with in your career.
Can you find any datasheets in your native language?
Unfortunately not, except for some (and not much) general info around the cyber. But yeah, I know that I gotta deal with it in the whole career, that's the reason we take some English courses and also gotta practice the usage of English datasheets.
 

MrAl

Joined Jun 17, 2014
11,496
I have created this circuit so far, and it's counting from 0 to 9 and repeat.
how the way make the 7-segment display show me only the number 5? since my analog input voltage is 5V

View attachment 291191

Hi,

Some questions come to mind you might want to think about.

First, your ADC puts out 8 bits. You may not have to use them all, but if you do, you should know that 8 bits can represent a decimal number from 0 to 255. This means that if you want to display the entire 8 bit code, you will either have to show one number at a time ('2' then '5' then '5' for example) or use three seven segment LEDs. If you dont mind weird patterns, you can get by with just two, but why do that.

Second, why are you using counters? It's true you can do it that way, but they make decoders that will convert binary to BCD. You may need three of the chips to do it though, maybe even more. It's much faster than using counters too.
But if you do use counters, dont you need three of them for the whole 8 bits?
Also, you show 4 bits going to the 74193 to be loaded, which is good, but i dont see any clock that will trigger the load (on the 'Load' pin).
When you use counters for this you have to get the timing right. They may even have to be synchronized to the ADC or else you probably should stop the ADC while you do a load, otherwise you can get a mix of results that will show up as garbage, unrelated to the actual voltage being measured.

You may be allowed to do just the least or most significant bits of the ADC output, but even if you do just 4 bits you need to be able to show 0 to 15, and anything over 9 either requires a two digit display, or one digit and allow strange figures to show up on the display for anything above 9 (including one code that might produce a blank display).

It does look like you are making some progress though so that's good to see. I am surprised to see that you were given this assignment if you never did any digital logic circuits before this. I hear that now and then though from various students and i wonder how that happens. It's true you need to be able to think for yourself, but you should be taught the basics. Maybe the teacher wants you to learn how to do the research along with the actual design. I think you are doing pretty well so far though for what you have been given.
 

MrAl

Joined Jun 17, 2014
11,496
Nice, are the names of I/O pins in Multisim the same as pins names in datasheets?
Hi,

That i dont know because i dont use Multisim. However, it should be easy to find out. Just look at the data sheet and compare functional operations.
Many of us here use LT Spice, also known as "SwitcherCad". It's a free simulator that many members here know the operation of very well.
 

Thread Starter

raziell122

Joined Mar 28, 2023
63
Hi,

Some questions come to mind you might want to think about.

First, your ADC puts out 8 bits. You may not have to use them all, but if you do, you should know that 8 bits can represent a decimal number from 0 to 255. This means that if you want to display the entire 8 bit code, you will either have to show one number at a time ('2' then '5' then '5' for example) or use three seven segment LEDs. If you dont mind weird patterns, you can get by with just two, but why do that.

Second, why are you using counters? It's true you can do it that way, but they make decoders that will convert binary to BCD. You may need three of the chips to do it though, maybe even more. It's much faster than using counters too.
But if you do use counters, dont you need three of them for the whole 8 bits?
Also, you show 4 bits going to the 74193 to be loaded, which is good, but i dont see any clock that will trigger the load (on the 'Load' pin).
When you use counters for this you have to get the timing right. They may even have to be synchronized to the ADC or else you probably should stop the ADC while you do a load, otherwise you can get a mix of results that will show up as garbage, unrelated to the actual voltage being measured.

You may be allowed to do just the least or most significant bits of the ADC output, but even if you do just 4 bits you need to be able to show 0 to 15, and anything over 9 either requires a two digit display, or one digit and allow strange figures to show up on the display for anything above 9 (including one code that might produce a blank display).

It does look like you are making some progress though so that's good to see. I am surprised to see that you were given this assignment if you never did any digital logic circuits before this. I hear that now and then though from various students and i wonder how that happens. It's true you need to be able to think for yourself, but you should be taught the basics. Maybe the teacher wants you to learn how to do the research along with the actual design. I think you are doing pretty well so far though for what you have been given.
Thanks for your reply dear friend!
Exactly, I've never did any digital logic circuit before, never taught about timing the devices with a clock (except for flip flops - but the idea there is pretty easy as they store only 1 bit), and even your comment is pretty hard for me to be understood because English is not my native language so I have to read slowly and use translation from time to time, same thing when using datasheets or other information in English around the cyber.
 
Top