Maker Pro
Maker Pro

12 Bit serial to 7 Segment Decoder

H

Heindorf

Jan 1, 1970
0
Hello display experts,
is there a simple way (perhaps 1 IC) to decode the 12 Bit serial Data
delivered by the AD2S90 to a 3 digit 7-Segment-Display? The best IC I've
found so far is the MAX7219 but the serial format of the AD2S90 is pure
binary.
Any suggestions?
Rolf
 
P

Paul Burke

Jan 1, 1970
0
Heindorf said:
Hello display experts,
is there a simple way (perhaps 1 IC) to decode the 12 Bit serial Data
delivered by the AD2S90 to a 3 digit 7-Segment-Display? The best IC I've
found so far is the MAX7219 but the serial format of the AD2S90 is pure
binary.

I'll be the boring one... easiest way is to use a microcontroller (PIC,
MSP, Z8, ST6, etc etc etc). It might be slow, but there's no point in
updating a display faster than the human brain can read it.

Where did you get your 2S90s? I used to use them (years ago, for
Inductosyn), but when delivery times went out to 30 weeks I gave up.

Paul Burke
 
H

Heindorf

Jan 1, 1970
0
We're going to use the 2S90 for a Rotasyn. Spoerle delivers it within a week
or so. Only the 2S99 has several weeks .
Rolf
 
S

Spehro Pefhany

Jan 1, 1970
0
I'll be the boring one... easiest way is to use a microcontroller (PIC,
MSP, Z8, ST6, etc etc etc). It might be slow, but there's no point in
updating a display faster than the human brain can read it.

Yup. In fact if the display could be bouncing back and forth between
two values, its better to update it relatively slow (like maybe 5Hz)
to that it will perceptible instead of possibly (for example)
combining 0 and 2 to give 8. A micro with a little program would be
ideal.

Best regards,
Spehro Pefhany
 
S

Stefan Heinzmann

Jan 1, 1970
0
Heindorf said:
Hello display experts,
is there a simple way (perhaps 1 IC) to decode the 12 Bit serial Data
delivered by the AD2S90 to a 3 digit 7-Segment-Display? The best IC I've
found so far is the MAX7219 but the serial format of the AD2S90 is pure
binary.
Any suggestions?

Do you want to use hexadecimal output? If using decimal, 12 bit won't
fit into 3 digits.

The hex solution can be done with a 12-bit shift register and suitable
7-segment decoder chips.

The decimal solution needs more complex decoding, and if you don't want
to use a microprocessor, you could try it with a CPLD, otherwise you
would end up with a whole lot of logic. A special IC for this is
unlikely to exist. Anyway, simple CPLDs and simple microprocessors can
both give you a sub-$1 solution.
 
H

hamilton

Jan 1, 1970
0
Stefan said:
Do you want to use hexadecimal output? If using decimal, 12 bit won't
fit into 3 digits.

The hex solution can be done with a 12-bit shift register and suitable
7-segment decoder chips.

The decimal solution needs more complex decoding, and if you don't want
to use a microprocessor, you could try it with a CPLD, otherwise you
would end up with a whole lot of logic. A special IC for this is
unlikely to exist. Anyway, simple CPLDs and simple microprocessors can
both give you a sub-$1 solution.

I was thinking the same thing, however sub-$1 !!!

If software multiplexing is used to drive the LEDs, that would
be 7 segments plus 4 digits = 11 pins so far.

Two pins for reading the AD2S90,
Two power pins,
Two crystal pins,
One reset pin.
( can you think of anything else )

Thanks 18 pins minimum.

For a one off project, I don't think this can be done for less
then $5.00.

And then there's the time to program what ever device is chosen.

The OP asked for a "simple way" (TM). I would ask the OP, is
"simple" to mean "cheapest" or "easiest" or "on time".
( pick any two )

hamilton

PS: Did the OP mean 3 digits for 0-359 degrees ??
 
S

Stefan Heinzmann

Jan 1, 1970
0
hamilton said:
I was thinking the same thing, however sub-$1 !!!

If software multiplexing is used to drive the LEDs, that would
be 7 segments plus 4 digits = 11 pins so far.

Two pins for reading the AD2S90,
Two power pins,
Two crystal pins,
One reset pin.
( can you think of anything else )

Thanks 18 pins minimum.

For a one off project, I don't think this can be done for less
then $5.00.

For a one-off $1 is pushing it, I admit. My cheapest would be a Z8E000
for 0.79 Euros and an external LC tank instead of a crystal and a few
passives for reset, bypassing etc. That will get me close to 1 Euro, and
this is somewhat more than a dollar.

I intentionally didn't count the LEDs and all the rest.
And then there's the time to program what ever device is chosen.

The OP asked for a "simple way" (TM). I would ask the OP, is
"simple" to mean "cheapest" or "easiest" or "on time".
( pick any two )

hamilton

PS: Did the OP mean 3 digits for 0-359 degrees ??

At least he wasn't asking for the optimal way ;-)
 
S

Spehro Pefhany

Jan 1, 1970
0
I was thinking the same thing, however sub-$1 !!!

If software multiplexing is used to drive the LEDs, that would
be 7 segments plus 4 digits = 11 pins so far.

Maybe. Could be 8 (using a driver chip) or 12 (4 digits + decimal
point). I think 4 digits w/DP would be nice.
Two pins for reading the AD2S90,

Three. You *need* /CS for framing, you can't just tie it low.
Two power pins,
Yes.

Two crystal pins,

Don't see why if the uP has an internal RC clock option.
One reset pin.
Maybe.

( can you think of anything else )

Thanks 18 pins minimum.

So an 18 or 28 pin PIC with bit-banged SPI and binary->32-bit math
scaling->bcd->7segment driving 4 digits (0..360.0 angular degrees with
resolution about 0.1 degree).
For a one off project, I don't think this can be done for less
then $5.00.

Parts should be around that one-off (+$5 shipping ;-)) . If someone
asked me to do this commercially, I'd probably budget more than half a
day, though, even assuming the AD2S90 system was available to test
with.

Best regards,
Spehro Pefhany
 
H

hamilton

Jan 1, 1970
0
Spehro said:
So an 18 or 28 pin PIC with bit-banged SPI and binary->32-bit math
scaling->bcd->7segment driving 4 digits (0..360.0 angular degrees with
resolution about 0.1 degree).

360 / 4096 = 0.087890625 degree per tick.

resolution of "about .1 degree" would not be very accurate, but maybe
good enough for the OP.

by the way, what happend to the Original Poster.

Did he find another solution we have not thought of ??

hamilton
 
S

Spehro Pefhany

Jan 1, 1970
0
360 / 4096 = 0.087890625 degree per tick.

resolution of "about .1 degree" would not be very accurate, but maybe
good enough for the OP.

??? The chip is rated +/-10.6 arc-min + 1 lsb (in)accuracy. I don't
see how displaying it to the nearest 0.1 degree (6 arc min) is going
to have much effect on that. It will have the occasional change in the
LSB that won't have any effect on the display, which is why I wrote
"about 0.1 degree resolution". OTOH, displaying it only to 1 angular
degree would lose a lot (~90%) of the resolution the AD2S90 has
internally.

The scaling and rounding will NOT result in any accumulated error in
the display, in case you misunderstood my shorthand.
by the way, what happend to the Original Poster.
Did he find another solution we have not thought of ??

Frequently happens.

Best regards,
Spehro Pefhany
 
H

Heindorf

Jan 1, 1970
0
Hi,
I only wanted a simple (easy and of course cheap) solution to test the
resolver board without µC and software. Somehow I was thinking the data output
is BCD and I thought a 3 digit 360 degree display would be nice. Naturally the
resolution is better and now I must choose between a more complex and easy to
read 4 digit decimal display or a simpler Hex display that's worse to read .
I have no other solution yet. The PIC or CPLD solutions seem interesting but
I've never worked with it. Is it worthwhile?
Rolf
 
H

Heindorf

Jan 1, 1970
0
Hello,
I've just found the MC14489/99 and must check its suitability. Because of
all received and appreciated hints I've now decided to build a 4 digit
decimal display 0 to 4095.
The OP is still alive and must check all suggestions.
Rolf
 
S

Stefan Heinzmann

Jan 1, 1970
0
Heindorf said:
Hi,
I only wanted a simple (easy and of course cheap) solution to test the
resolver board without µC and software. Somehow I was thinking the data output
is BCD and I thought a 3 digit 360 degree display would be nice. Naturally the
resolution is better and now I must choose between a more complex and easy to
read 4 digit decimal display or a simpler Hex display that's worse to read .
I have no other solution yet. The PIC or CPLD solutions seem interesting but
I've never worked with it. Is it worthwhile?

I would say: yes, it is. But that is just my subjective view. If you
work with CPLDs and/or Microprocessors you need to program them. You
need tools for this, and they cost some money and need some time and
effort until you master them. But the flexibility you get is far beyond
simple discrete logic. And if you are doing more than just this design,
then the expense and effort spent in the tools pays off more easily. If
you are doing a one-off only and you have no prior knowledge of the
technology you may find the learning curve a bit steep.

Having said that, I think a simple task like the one you have in mind
seems just right to start investigating microcontrollers. I propose to
use microcontrollers rather than CPLDs since you seem to have no clear
idea regarding the display format. This will be easiest to define and
change when using a microcontroller.

You will probably want to use a flash-based microcontroller which you
can reprogram in-circuit. Popular examples for this are AVR devices from
Atmel or some devices in the PIC family. Toolsets for these can be
bought for little money. Once you have those around and know how to use
them, new projects will be a piece of cake.
 
S

Spehro Pefhany

Jan 1, 1970
0
Hello,
I've just found the MC14489/99 and must check its suitability. Because of
all received and appreciated hints I've now decided to build a 4 digit
decimal display 0 to 4095.
The OP is still alive and must check all suggestions.
Rolf

If you just want to check it out, you can bit-bang an SPI interface
over your PC parallel port, then do whatever you like with the 12 bits
(convert to decimal, scale, etc.). Timing is not critical for SPI as
long as it's longer than the minimums.

Best regards,
Spehro Pefhany
 
J

John Fields

Jan 1, 1970
0
Hi,
I only wanted a simple (easy and of course cheap) solution to test the
resolver board without µC and software. Somehow I was thinking the data output
is BCD and I thought a 3 digit 360 degree display would be nice. Naturally the
resolution is better and now I must choose between a more complex and easy to
read 4 digit decimal display or a simpler Hex display that's worse to read .
I have no other solution yet. The PIC or CPLD solutions seem interesting but
I've never worked with it. Is it worthwhile?

---
Yes, but there's a learning curve which may be prohibitive if you're
looking for a quick solution. If you want to do it all in hardware
here's an easy way:

First, shift the data out of the 2S90 into a 12 bit serial to parallel
shift register. At this point you don't care about a synchronous output
register, so you could use a couple of '164's. Next, load the 12 bits
into a 12 bit binary down counter (three '193's would work) and count
the counter down with a 113.75 kHz clock. While the counter is counting
down, use a 1.0000 MHz clock to clock a 5 digit BCD up counter (five
'160's, '162's) and connect the outputs of the up counters to your
favorite BCD to seven-segment decoders and those outputs to your LED
displays. That's a total of 15 chips not counting the glue logic, but
that's still a lot easier than learning to write code for, and
programming, a µC.

"OK", you might say, "but how does it work?"

Since the 2S90 has a 12 bit output which represents 360.00 degrees and
it would be nice to display the output in degrees, then we need a 5
digit output with a fixed decimal point (360.00) to be able to do that.

But, the output of the 2S90 is a 12 bit binary number which varies from
0000 0000 0000 (000 hex) for 0° to 1111 1111 1111 (0fff hex) for 360°,
so we need to convert that to read from 000.00 for 0° to 360.00 for 360°

If we use a 5 digit BCD up counter to drive the display and count to
36000 while the down counter counts from 0fff to 000 then that should
work. Now, if we want the up counter to count 36000 clocks when the
down counter counts 4095 clocks, then the up counter's clock must go
36000/4095 = 8.791209 times faster than the down counter's clock, and
the up counter must be enabled while the down counter is counting. It
doesn't really matter what the two clock frequencies are as long as the
ratio between their frequencies is 36000/4095 and you don't violate any
timing rules. Interestingly, if you choose the up counter to run at 4
MHZ, the down counter can run at 455 kHz, which brings to mind another
possibility, that of using a mixer to make the ratio of either the LO or
the RF to the IF equal to 36000/4095 and driving yourself crazy looking
for oscillators!
 
P

petrus bitbyter

Jan 1, 1970
0
John Fields said:
---
Yes, but there's a learning curve which may be prohibitive if you're
looking for a quick solution. If you want to do it all in hardware
here's an easy way:

First, shift the data out of the 2S90 into a 12 bit serial to parallel
shift register. At this point you don't care about a synchronous output
register, so you could use a couple of '164's. Next, load the 12 bits
into a 12 bit binary down counter (three '193's would work) and count
the counter down with a 113.75 kHz clock. While the counter is counting
down, use a 1.0000 MHz clock to clock a 5 digit BCD up counter (five
'160's, '162's) and connect the outputs of the up counters to your
favorite BCD to seven-segment decoders and those outputs to your LED
displays. That's a total of 15 chips not counting the glue logic, but
that's still a lot easier than learning to write code for, and
programming, a µC.

"OK", you might say, "but how does it work?"

Since the 2S90 has a 12 bit output which represents 360.00 degrees and
it would be nice to display the output in degrees, then we need a 5
digit output with a fixed decimal point (360.00) to be able to do that.

But, the output of the 2S90 is a 12 bit binary number which varies from
0000 0000 0000 (000 hex) for 0° to 1111 1111 1111 (0fff hex) for 360°,
so we need to convert that to read from 000.00 for 0° to 360.00 for 360°

If we use a 5 digit BCD up counter to drive the display and count to
36000 while the down counter counts from 0fff to 000 then that should
work. Now, if we want the up counter to count 36000 clocks when the
down counter counts 4095 clocks, then the up counter's clock must go
36000/4095 = 8.791209 times faster than the down counter's clock, and
the up counter must be enabled while the down counter is counting. It
doesn't really matter what the two clock frequencies are as long as the
ratio between their frequencies is 36000/4095 and you don't violate any
timing rules. Interestingly, if you choose the up counter to run at 4
MHZ, the down counter can run at 455 kHz, which brings to mind another
possibility, that of using a mixer to make the ratio of either the LO or
the RF to the IF equal to 36000/4095 and driving yourself crazy looking
for oscillators!

John,

I agree using '164's to do the shift out but I guess building your counting
decoder to require at least the same skill level in binary electronics as
required in microcontrolers to use one (microcontroler). I advise to use to
use some good old EPROMs to do the conversion. Three of them - even old
'2764's - will do and you can still use your favorite BCD to seven segment
decoders. Which makes eleven chips and no glue. The contents of the EPROMs
can be made by a quick and dirty program using old gwbasic for instance. (I
can write it if necessary, can still program them too.)

petrus
 
G

GPG

Jan 1, 1970
0
work. Now, if we want the up counter to count 36000 clocks when the
down counter counts 4095 clocks, then the up counter's clock must go
36000/4095 = 8.791209 times faster than the down counter's clock, and
the up counter must be enabled while the down counter is counting. It
doesn't really matter what the two clock frequencies are as long as the
ratio between their frequencies is 36000/4095 and you don't violate any
timing rules. Interestingly, if you choose the up counter to run at 4
MHZ, the down counter can run at 455 kHz, which brings to mind another
possibility, that of using a mixer to make the ratio of either the LO or
the RF to the IF equal to 36000/4095 and driving yourself crazy looking
for oscillators!

Using 3 binary rate multipliers, eg 4089, progrmmed with (msb)14,1,1 (lsb)
in add mode gets .87915, close enough?
 
H

hamilton

Jan 1, 1970
0
Heindorf said:
Hi,
I only wanted a simple (easy and of course cheap) solution to test the
resolver board without µC and software. Somehow I was thinking the data output
is BCD and I thought a 3 digit 360 degree display would be nice. Naturally the
resolution is better and now I must choose between a more complex and easy to
read 4 digit decimal display or a simpler Hex display that's worse to read .
I have no other solution yet. The PIC or CPLD solutions seem interesting but
I've never worked with it. Is it worthwhile?
Rolf

There is no other way of doing this.

If you look at the data sheet, there are only microprocessor interfaces
shown. If Analog Devices thought a "simpler" way was needed for the
market they built this for, they would show it in their data sheet.

To those who consider a CPLD a good solution, ( I am not a CPLD person )
how many gates ( macro cells ) would be necessary to convert the 12 bit
data stream into a decimal number ( or hex number ).

I have used PLDs before for simple state machines, so the simple state
machines I have built would require over 40 F/F macro cells.

Another suggestion would be a small CPU that converts the 12-bit data
stream into async serial to send to a PC for display.

I have built 3-4 digit LED display modules that read a 12-bit A/D
converter and displays the results, after some simple calculations.

So to me a micro would be easiest.

So simple to and simple for you are drastically different things.

Good Luck.

hamilton

PS: Rolf, I see by your email address that you are in Europe somewhere.

I assume Germany. There are many low cost single board computers
available. Find one online and try it out. Some have easy to learn Basic
language interprets and some have free development tools included.
You may find a new career for yourself. :)
 
P

PaulCsouls

Jan 1, 1970
0
I just did 10 bits to 3 digit BCD in an altera EPM7128. I don't
remember how many cells but it took alot. It would not compile in fast
mode. I had to set it to optimize area mode. I used the add 3 and
shift routine. It would have been alot easier in a microprocessor. I
bet you could do it in a 68hc705 if motorola still makes them.

Paul
 
G

GPG

Jan 1, 1970
0
Watch for the 13th bit no matter what you decide.
 
Top