Author Topic: What is code b (7 segment display char set)?  (Read 12425 times)

0 Members and 1 Guest are viewing this topic.

Offline AsciiSimonTopic starter

  • Newbie
  • Posts: 5
What is code b (7 segment display char set)?
« on: February 25, 2013, 08:59:12 pm »
Hi, I am working on a little 6502 based computer and it would be handy (well, at least fun) to be able to display the address/databus in HEX on 7 segment displays.

Hunting about for a quick and easy way to do this I came across the Maxim ICM7212 (http://www.maximintegrated.com/datasheet/index.mvp/id/1675) decoder/driver chips. There are also others about.

These will output in either hexadecimal (0123456789ABCDEF) or in Code B format (0123456789-EHLP ) depending on the variant.

What the heck is code B? Rather, what is it actually used for? I can find mention of other ICs that decode and output it but I can't find any mention of what it's actually for. I suppose it might be useful to have the computer say HELP.....

Simon
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4250
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: What is code b (7 segment display char set)?
« Reply #1 on: February 25, 2013, 09:04:26 pm »
It looks like just another option to allow some different characters to be shown - maybe characters to indicate "error", "high", "low" and "program"?

Offline Mr Smiley

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: gb
Re: What is code b (7 segment display char set)?
« Reply #2 on: February 25, 2013, 09:15:29 pm »
From the maxim MAX7219 data sheet, code B is described as BCD mode, where only 0-9 is decoded to the digit segments. You have to send the 8 bits, but only the lower 4 are looked at so it becomes a BCD to 7 segment decoder

From page 7 of the datasheet;

Decode-Mode Register
The decode-mode register sets BCD code B (0-9, E, H,
L, P, and -) or no-decode operation for each digit. Each
bit in the register corresponds to one digit. A logic high
selects code B decoding while logic low bypasses the
decoder. Examples of the decode mode control-regis-
ter format are shown in Table 4.
When the code B decode mode is used, the decoder
looks only at the lower nibble of the data in the digit
registers (D3–D0), disregarding bits D4–D6. D7, which
sets the decimal point (SEG DP), is independent of the
decoder and is positive logic (D7 = 1 turns the decimal
point on). Table 5 lists the code B font.
When no-decode is selected, data bits D7–D0 corre-
spond to the segment lines of the MAX7219/MAX7221.
Table 6 shows the one-to-one pairing of each data bit
to the appropriate segment line.


 :)
There is enough on this planet to sustain mans needs. There will never be enough on this planet to sustain mans greed.
 

Offline AsciiSimonTopic starter

  • Newbie
  • Posts: 5
Re: What is code b (7 segment display char set)?
« Reply #3 on: February 25, 2013, 09:21:45 pm »
But what is that code actually used on is what I am getting at. It must have a purpose. What kind of machine uses it? Status panels for something perhaps?

Simon
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: What is code b (7 segment display char set)?
« Reply #4 on: February 25, 2013, 10:42:56 pm »
The display can show HELP as an option.
 

Offline Mr Smiley

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: gb
Re: What is code b (7 segment display char set)?
« Reply #5 on: February 26, 2013, 03:29:09 am »
Well, lets take 0xff, which is 255 decimal. To show 0xff as a decimal number you convert 0xff to three bcd bytes, first byte is 0x02, second is 0x05 third is 0x05. To display these onto say a serial or lcd display you convert to ascii by adding 0x30 to each byte so now you have 0x32, 0x35 and 0x35, send these and you display 255.

Now, that's all fine, but you have to add 0x30 to each BCD value, takes a little longer and adds to your code allocation. If you want to display this onto a 7-segment display, you have to use a lookup table to convert the BCD value to the segments you want to light up. There are out there BCD to 7-segment driver chips.

So it's quicker and easier just to send BCD to the display driver chip and let that do all the segment mapping.

 :)
There is enough on this planet to sustain mans needs. There will never be enough on this planet to sustain mans greed.
 

Offline Mr Smiley

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: gb
Re: What is code b (7 segment display char set)?
« Reply #6 on: February 26, 2013, 03:37:39 am »
It's also quicker and takes up less code space if you only want to count in the decimal system up to 9. Say 999, to do bcd counting and send that directly to the display chip, so no hex to bcd  conversion.

Real time clocks also only count in BCD, so easier path from RTC to CPU to Display.

It's all down to speed and convenience.

 :)
There is enough on this planet to sustain mans needs. There will never be enough on this planet to sustain mans greed.
 

Offline AsciiSimonTopic starter

  • Newbie
  • Posts: 5
Re: What is code b (7 segment display char set)?
« Reply #7 on: February 26, 2013, 06:38:34 am »
No, no, I understand what BCD is and how the the coding works and how the IC works (but thanks for taking the time to explain). When outputting this "code B" the display will show '0123456789-EHLP ' for inputs 0-F. Normal hex would show '0123456789ABCDEF'.

But what is it that needs to display that particular code B character set. There must be some machine or device that specifically needs to display those codes if they made a display driver IC for it. What is that machine? Where would this IC be used?

I don't think I explained myself very well!

Simon
 

Offline cyr

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: se
Re: What is code b (7 segment display char set)?
« Reply #8 on: February 26, 2013, 11:55:56 am »
Well, ' ' and '-' is needed for any application where you show positive and negative values with varying number of digits. E for error is quite common...

I can easily imagine a requirements document listing 0-9, -, E and <blank> leaving the final three codes undefined and leading some bored chip designer to spell out HELP :)
 

Offline Len

  • Frequent Contributor
  • **
  • Posts: 551
  • Country: ca
Re: What is code b (7 segment display char set)?
« Reply #9 on: February 26, 2013, 07:30:29 pm »
I've seen "HI" and "LO" on 7-seg displays for out-of-range values, maybe that's what the H & L are for.
DIY Eurorack Synth: https://lenp.net/synth/
 

Offline AsciiSimonTopic starter

  • Newbie
  • Posts: 5
Re: What is code b (7 segment display char set)?
« Reply #10 on: February 28, 2013, 06:44:59 pm »
I decided to ask the source and email Maxim tech support. They spent a few days hunting and came back with this which is the best answer found so far. It is an Intersil datasheet: | http://www.intersil.com/content/dam/Intersil/documents/fn31/fn3159.pdf

On page 5 it mentions "....Code B provides a negative sign (-), a blank (for leading zero blanking), certain useful alpha characters and all numeric formats."

So it seems they are just some values selected to be useful. I think the H and L might be for High and Low as Len says. And the + and blank as cyr mentions.

E for Error or Exponent maybe?

P for, I don't know, displaying a Percentage? Probability?

Would be interesting to find someone who actually used one in a real design!

Simon

 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16340
  • Country: za
Re: What is code b (7 segment display char set)?
« Reply #11 on: February 28, 2013, 07:20:38 pm »
P - pulse.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf