Loading ...
Sorry, an error occurred while loading the content.

9974RE: [cosmacelf] Re: Seven Segment Displays

Expand Messages
  • bill rowe
    Apr 9, 2012
    • 0 Attachment
      so ted, this was one backplane for the whole LCD and 7 segment leads per digit - right. Looking back at my code i guess almost all the complexity came from the multilexing and needing to run 4 backplanes at 3 or 4 voltages each.

      To: cosmacelf@yahoogroups.com
      From: ted_rossin@...
      Date: Mon, 9 Apr 2012 20:41:25 +0000
      Subject: [cosmacelf] Re: Seven Segment Displays




























      A few years back I wrote a little Verilog code to control a 4 digit LCD using a Xilinx Coolrunner 2 CPLD evaluation board. I used the same technique that Lee recommended and basicly drove a slow clock (about 100 Hz) into the back plane and then inverted the segments based on the slow clock. Segments that were on were driven out of phase while segments that wer off were driven in phase.



      For fun if you hook the common plane to ground and put 5V on a segment, it will darken and then begin to fade. Using the clock keeps them dark.



      You can find the project (a bit stale) here:



      http://www.tedrossin.net46.net/Electronics/Xilinx/Xilinx.html



      I only put the code for one digit but the picture shows that I implemented all the digits eventually.



      A little bit of code:



      assign COMMON_DRIVE = ~ClockDiv[`RATE_BIT];

      assign DIGIT1 = ClockDiv[`RATE_BIT] ? Raw7Seg1 : ~Raw7Seg1;



      The entire module:



      module Lcd(CLK,RESET,COMMON_DRIVE,LED,DIGIT4,DIGIT3,DIGIT2,DIGIT1);

      input CLK;

      input RESET;

      output COMMON_DRIVE;

      output LED;

      output[6:0] DIGIT4,DIGIT3,DIGIT2,DIGIT1;



      wire[3:0] Counter0,Counter1,Counter2,Counter3;

      reg[19:0] ClockDiv;

      wire[6:0] Raw7Seg4,Raw7Seg3,Raw7Seg2,Raw7Seg1;

      wire ClockDivZero = (ClockDiv==0) ? 1 : 0;



      always @(posedge CLK) begin

      ClockDiv <= (RESET) ? 0 : ClockDiv + 1;

      end



      assign LED = 0; // Save power



      assign COMMON_DRIVE = ~ClockDiv[`RATE_BIT];



      DigitCounter DigitCounter0(CLK,RESET,ClockDivZero,Counter0);

      DigitCounter DigitCounter1(CLK,RESET,ClockDivZero & (Counter0==9),Counter1);

      DigitCounter DigitCounter2(CLK,RESET,ClockDivZero & (Counter0==9 && Counter1==9),Counter2);

      DigitCounter DigitCounter3(CLK,RESET,ClockDivZero & (Counter0==9 && Counter1==9 & Counter2==9),Counter3);



      CharGen DigitDecoder3(Counter0[3:0],Raw7Seg1);

      CharGen DigitDecoder2(Counter1[3:0],Raw7Seg2);

      CharGen DigitDecoder1(Counter2[3:0],Raw7Seg3);

      CharGen DigitDecoder0(Counter3[3:0],Raw7Seg4);



      assign DIGIT4 = ClockDiv[`RATE_BIT] ? Raw7Seg4 : ~Raw7Seg4;

      assign DIGIT3 = ClockDiv[`RATE_BIT] ? Raw7Seg3 : ~Raw7Seg3;

      assign DIGIT2 = ClockDiv[`RATE_BIT] ? Raw7Seg2 : ~Raw7Seg2;

      assign DIGIT1 = ClockDiv[`RATE_BIT] ? Raw7Seg1 : ~Raw7Seg1;



      endmodule



      --- In cosmacelf@yahoogroups.com, bill rowe <bill_rowe_ottawa@...> wrote:

      >

      >

      > driving a raw lcd is a bit of a bugger. I did it to prove to myself that i could but it didn't seem very practical. I was using a multiplex display which makes it a lot tougher though. The voltages and timing needed are all well within the 1802's capabilities so it's not a bad project idea. If you're interested, these posts and the links can give you voltages and timing ideas if you need them.http://hackaday.com/2011/02/10/driving-a-salvaged-lcd/http://arduino.cc/forum/index.php/topic,51464.0.html a good general LCD reference: http://ww1.microchip.com/downloads/en/AppNotes/00658a.pdf (it is somewhat PIC oriented but it's more general than that).

      > > To: cosmacelf@yahoogroups.com

      > > From: leeahart@...

      > > Date: Fri, 6 Apr 2012 10:39:39 -0500

      > > Subject: Re: [cosmacelf] Re: Seven Segment Displays

      > >

      > > On 4/5/2012 9:07 AM, aa3nm wrote:

      > > > use a dead stupid LCD and wiggle the wires in simple

      > > > hardware to get the contrast for the bits. In my case I was not

      > > > going to go for a hex display but rather use the segments to

      > > > represent the binary data bits...

      > >

      > > This should be easy for a simple binary display. There are a few

      > > non-multiplexed LCDs on the market with all the segments brought out to

      > > an actual pin. They look like an IC chip, but are glass instead of

      > > plastic. They are typically found in bottom-of-the-line multimeters.

      > >

      > > These non-multiplexed LCDs have high contrast and wide viewing angle so

      > > they often don't need a backlight. Power consumption is often very low,

      > > down in the microamps region. They are pretty easy to drive. You need to

      > > apply an AC signal (5v square wave is OK) between the segment and the

      > > common backplane. It could be as simple as an exclusive-OR gate for

      > > every pin. There are 1-digit BCD-to-7seg LCD drivers like the 4543,

      > > though I don't know of any that display hex, however.

      > >

      > > There are a couple multi-digit hex-to-7seg LCD driver chips; the ICM7211

      > > (not the A version) will drive four 7-segment LCDs, and displays hex

      > > (0-9,A-F). The drawback is that the *input* is multiplexed. It's

      > > intended to be driven by from a micro's output port with software, so it

      > > will take a fair amount of hardware to make it work as a front panel

      > > display.

      > >

      > > > My idea was to use segments E& C for a pair of data bits on each of

      > > > 4 digits (thus 8 bits are displayed) representing either a 1 or be

      > > > blank. Then I realized that I'd left a-whole-nother 8 bits unused...

      > > > Why not use the upper set of segments (F& B) in a similar way for

      > > > address display (good enough for a quarter K). This differed only

      > > > slightly from a concept Lee had considered´┐Ż- that of using an 8 digit

      > > > display and forming the bit number (1 - 7) to represent a 1.

      > >

      > > That would certainly work. I considered a binary display, but decided it

      > > would be confusing (which pixel is which bit?). LCDs are sold by the

      > > square inch, pretty much regardless of how many segments are in it. So I

      > > figured it would be better to tie all the segments together to form the

      > > actual numbers. It didn't change the hardware at all, but only required

      > > an 8-digit display for 8 bits. I think my schematic for such a display

      > > is still posted in the files section.

      > >

      > > --

      > > First they ignore you; then they mock you; then they fight you; then you

      > > win.

      > > -- Mahatma Gandhi

      > > --

      > > Lee A. Hart, 814 8th Ave N, Sartell MN 56377, leeahart at earthlink.net

      > >

      > >

      > > ------------------------------------

      > >

      > > ========================================================

      > > Visit the COSMAC ELF website at http://www.cosmacelf.comYahoo! Groups Links

      > >

      > >

      > >

      >

      >

      > [Non-text portions of this message have been removed]

      >


















      [Non-text portions of this message have been removed]
    • Show all 18 messages in this topic