Shop OBEX P1 Docs P2 Docs Learn Events
Sixteen Segment Display on Popeller Professional Development Board — Parallax Forums

Sixteen Segment Display on Popeller Professional Development Board

TheGrueTheGrue Posts: 114
edited 2009-05-29 02:45 in Propeller 1
I just received my Propeller Professional Development Board on Friday and some questions came up as I was experimenting with it.

First Why are the resistors that are in-line with the LED's on the Development Board 470 Ohm vs. the Demo Board having 240 Ohm resistors? Is this to allow them to be connected to 5V as well as 3.3V circuits?

Second Has anyone written any code to use the Sixteen Segment Displays that are on the Propeller Professional Development Board?

Third When examining the schematic for the Propeller Professional Development Board, I noticed that the Sixteen Segment Display has in-line resistors of 150 Ohms. Is my math rusty or does this figure out to 22mA per segment at 3.3V which is under the Propeller's per pin rating of 30mA but if you connect 8 pins, that would make it 176mA which is above the 8 pin limit of 100mA. Am I correct in assuming that I need to add more resistors in series to connect the segments to the Propeller chip?

Comments

  • LeonLeon Posts: 7,620
    edited 2009-03-09 11:57
    The segments are usually pulsed.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • TheGrueTheGrue Posts: 114
    edited 2009-03-09 14:05
    I realize that they are pulsed. If Parallax used 470 Ohm resistors on the LED's, why not on sixteen segment display? It seems to me that even if you pulse the segments, it still calculates out to more current than the Propeller chip is rated to handle across 8 pins. It looks like that even though the sixteen segment display was included on the Propeller Professional Development Board, it was never intended to be directly wired to the Propeller chip pins.

    My question really arises from comparing the schematics of the Propeller Professional Development Board which has the sixteen segment display using 150 Ohm resistors and the Professional Development Board for Basic Stamp which has Seven segment display using 470 Ohm resistors.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-09 14:14
    The Propeller operates from a 3.3V supply. When driving a display from a 3.3V source, there's less voltage to drop than when driving from a 5V supply. You'd have 3.3V - 1.7V = 1.6V. With a 150 Ohm resistor, the current comes out to about 10mA.

    Both the discrete LEDs and the 16 segment displays use blue LEDs. These have a much higher forward voltage (2.5-3.7V) than red LEDs (1.7V), so would have a much lower current than the same circuit with the same resistances using red LEDs.

    Post Edited (Mike Green) : 3/9/2009 2:26:48 PM GMT
  • TheGrueTheGrue Posts: 114
    edited 2009-03-09 15:53
    Thank you. That is good to know. I just wonder why the blue LED's on the board have the higher value resistors and the segments don't. I am still Googling for a data sheet on the segment display.

    That brings up another question about the current at the common cathode. In the Parallax docs for a seven segment display to be attached a BS2, the common cathode is driven low on one of the BS2 pins. If you do something similar to this with the propeller, even at 10mA then I am assuming that you could only light 3 elements in one scan for the max of 30mA per pin? So instead of doing one scan per character, you would have to do multiple scans depending on how many elements you need to create a character?
  • smbakersmbaker Posts: 162
    edited 2009-03-09 16:15
    I recently completed a project using these displays on the PPDB and I used a 74HCT138 to drive the cathodes. One caveat is that I was only displaying numbers on the displays, for a maximum of 10 segments lit at any time. While the total current is probably also beyond what the 74HCT138 is rated for, I figured it would be a cheaper place to burn out an output gate than on the prop. It seems to work fine, and has the added benefit of using only 3 pins to sink all 6 cathodes.

    My current design uses a ULN2803 darlington driver (talk about overkill, it can sink 500ma/pin). The ULN2803 results in very dim display, likely due to the voltage drop. Works fine for red displays, just not the blue displays with the 150 ohm resistors on the PPDB.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-09 16:23
    Clearly, you'd have to limit your digit current per segment to about 2mA assuming all segment are lit. Except for testing purposes, you would not use all the segments at the same time. Best would be to use some kind of digit driver, perhaps a Darlington array or some logic level MOSFETs. It would have been nice to have something like that built into the board, but it is pretty packed now. You could use the L293D to drive 4 digits if that's all you need.
  • Michael O'BrienMichael O'Brien Posts: 55
    edited 2009-03-09 16:49
    JHarris,
    ··············· Hi, I haven’t multiplexed the 6 digits on the PPDB yet, but I have created spin for a a 512 led array and a 4 x 8 blue 7seg array and encountered issues similar to yours.
    ··············· One of my earliest projects was to multiplex a 4 x 8 x 8 x 2color grid of LED’s = 512 leds from a propeller chip.· In order to avoid current issues I used 595 serial-parallel storage registers that drove both the data and the 138/154 muliplexer chips.· This way I only used 2 sets of 3 pins (clock, load, data) on the propeller.· I later switched to using 574 latches for the data lines so I could latch them in parallel.
    ··············· The following design issues come up when driving a multiplexed set of leds directly from propeller pins.
    1)····· Timing artifacts – if you assign the 3 address inputs of your mux (138) that drives the column lines to individual propeller pins you will see transitions between the columns when for example you switch from digit 3 to digit 4 (011 to 100) – because the spin interpreter will take time between changing the 3 lines (each cog is still a serial machine).
    There is a way around this with software by synchronizing pins – I haven’t looked into this.
    For an example of this, check out the photo of the 512 matrix an notice the bleeding of colors before I drove the 154 mux via a 595 and changed all the address bits simultaneously.
    2)····· If you offload current load to the 595 as + driver and the 138/154 as – driver then you can design the load and brightness independent of the propeller.· I was even able to run my LED grid without “any” discrete resistance at all – I relied on the inherent resistance of my wiring and BBoard.
    3)····· Limited brightness:· you will need 6x normal brightness when you cycle all 6 digits – this would probably overload the propeller – I would use discrete transistors or a driver chip.
    A working multiplexed solution for myself was to come into the loop with address 111 or 101 in the PDDB case and use 3 nested repeat loops surrounding a 7seg loop (16 segments for the PDDB) that wrote each digit in series and latched the word for a set time (usually no delay is required in Spin since it is slower than TTL 20Mhz timing.
    Here is a prototype 7seg board driver that does not use commercial LED drivers, only 138, 154, 595 and 574 HC chips.· I refreshed the data by rewriting RAM via Propellent.exe before I figured out how to run FullDuplexSerial with a Java comm API recently.
    Thank you
    /Michael
    ···· spin code is attached

    Post Edited (Michael O'Brien) : 3/9/2009 6:14:52 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-09 16:54
    JHarris,

    I’m actually kind of glad you brought up this subject. Last week our Tech Support guys went to demonstrate some hardware for a distributor. They asked me for a demo for the PPDB, which I helped design, and I was asked specifically for something that uses the 16-segment displays. I never stopped to think about it before but you’re right, we don’t have any sort of demo for the 16-segment displays. On the PDB we used hardware decoder chips such as the MC14489 and MAX7219. When choosing 16-segment displays I did have such decoder chips in mind, however many are limited to SMD packages.

    With that in mind I completed a small demo object for the displays last week for the tech guys. As time permits this week I am going to wrap the driver object and upload it to the object exchange as well as put it on the PPDB product page (deadline is March 16th). The reason I haven’t posted what I have is that I didn’t have time to put it all the functionality I intended for the driver and the source for the data. So the current version is very basic and uses a hacked version of the DS1302 object that was on our object exchange.

    When complete the 16-segment drive will have the following features:

    Two Modes – Static and Dynamic…in static mode the driver will take six bytes from a buffer and display them using a lookup table in the DAT section for the font. In dynamic mode the driver will scroll a string message across the displays at a user-defined speed. This version will be written in spin and may include display dimming.

    Later I will write an assembly version and possibly a version that uses shift registers to reduce the number of pins required. The assembly version may also light the segments individually rather than the digits as the current version does.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-09 16:58
    Michael,

    You’ll probably want to include the SPIN code as an attachment as the formatting is lost when pasting into a message, especially with a program this big.

    JHarris,

    I forgot to address your questions about the resistor sizes…The LEDs on the right side of the board were designed to be driven by either a 3.3V or 5V signal. The displays required a resistor in case someone was to directly wire them up, but they needed a much smaller value just to make them useful in multiplexing. If they had too high of a value resistor they would be quite dim when multiplexed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • TheGrueTheGrue Posts: 114
    edited 2009-03-09 17:33
    Chris,

    I was more worried about frying the Propeller chip than the displays. Will your objects include wiring diagrams?

    Post Edited (JHarris) : 3/9/2009 5:43:23 PM GMT
  • RetrobitsRetrobits Posts: 46
    edited 2009-03-09 18:12
    This is yet another reminder to me that I need to read datasheets and specifications before I go wiring things up.· Ugh, it's just so easy to break something.· smhair.gif·· This will teach me to spend 20 years away from the hardware, being a software guy...

    For what it's worth, I have a 6 x 16 matrix wired directly to the Prop.· As noted earlier in the thread, except for testing you'd never light all segments on the display.· However, even lighting a few on a single display apparently exceeds the rated current, especially for the common cathode pin.· I'd wondered about that.· Like the old TTL BCD decoder drivers, I guess it really is going to take some outboard chips to drive this display.· (By the way, to my knowledge, the Prop never fried...takes a licking and keeps on ticking.)

    Since I very much like the 16 segment blue display, I'll be quite interested in what folks come up with here regarding driver hardware recommendations.· The good news, I suppose, is that whatever the solution is will likely only require a few pins off the Prop, freeing them up for other uses.

    - Earl
  • TheGrueTheGrue Posts: 114
    edited 2009-03-09 18:49
    Retrobits,

    Like you I too have been 20 years away from electronics field and into the computer hardware and software business, which deals more with swapping out defective boards and not dealing directly with the hardware since the advent of Plug-N-Play. Plus now I am more a Network Administrator than anything else.

    I seem to have forgotten most of my electronics training and to compound issue, I did some house cleaning about 10 years ago and tossed out all my electronics books thinking that "I never use them anymore and will probably never need them again". I did not know that my childhood passion for robots would be rekindled after suffering from "System Admin Burn-Out". I kick myself now for all those Radio Shack books I tossed, not to mention all my school notebooks...

    Fortunately reprints of the books are found at amazon.
  • David BDavid B Posts: 591
    edited 2009-03-09 20:20
    A few weeks ago I needed a fast counter to capture and count pulse trains from another project, so I wired up my propeller professional development board to accumulate counts and display them on the segments.

    This is only designed to display numbers, so it only has a maximum of seven segments illuminated at any one time, but it worked great, and is plenty bright.·

    The propeller chip drives two 74HCT165 shift registers to switch individual segments and one UNL2803 to switch on or off complete digits.

    Here's my code and a picture. There's a partly-completed circuit diagram at the top of the code; not every connection is shown but there should be enough to get a feel for the circuit.

    This is primarily designed to measure external pulses, but I also wrote some code to fire up two additional cogs, one to generate fast bursts of pulses and one to generate a slow steady pulse train for testing the pulse counter as a standalone unit.

    I can't say that my coding of the best quality, but this works very well, and may help someone get started.

    Post Edited (David B) : 3/9/2009 8:25:32 PM GMT
    640 x 480 - 143K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-09 20:39
    Okay, I will tell you what…I will post a quick demo and sample driver. This is very bare-bones and the demo code does nothing more than populate an array and start the driver. The final driver (this is the test code) will also support the decimal points, etc. Please note that this code isn’t using any hardware to drive the displays…everything comes right from the I/O pins. The individual displays are lit up for just ~1 mS and don’t draw full current from the Propeller I/O pins.

    The final driver will contain a wiring diagram…however, since this is unsupported test code I will list the connections below here. You wire the segments up one at a time from A1 all the way to DP such that A1 goes to P0, A2 goes to P1 and so on so that all 17 connections are in sequence. The segments are not all in alphabetical order but they are in order, but you can see by the bit assignments in the driver code in the lookup table how it works.

    The digit connections move in the opposite direction and are as follows: L.DGT1 to P17, R.DGT1 to P18, L.DGT2 to P19, R.DGT2 to P20, L.DGT3 to P21 and R.DGT3 to P22. So as you can see with all the connections 23 I/O pins are consumed. Anyway, the code takes the value from the buffer and looks its value up in the table and then displays it for ~1 mS. It then moves on to the next digit and does the same thing until all 6 digits have been drawn. Only one is lit up at any time and the driver does this continuously. You can change the values in the buffer and see how that affects the display. This test code only supports numbers 0-9 however the final version will support the entire alphabet as well as special characters too such as plus, minus, etc. Decimal point support will be included as well, which is why I have the connection made for that segment line (DP to P16).

    If you have any questions just follow up in this thread and I will try to answer them as soon as possible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Michael O'BrienMichael O'Brien Posts: 55
    edited 2009-03-10 01:27
    Chris,
    ··· Excellent work, very short and efficient code - very helpfull.
    ··· I downloaded your spin code to my Propeller Professional Development Board and the 6 displays multiplex very well.
    ··· I have posted photos for brightness comparison with the onboard surface mount discrete led's and oledProp96 as reference.

    ··· thank you
    ··· /michael

    ···
  • TheGrueTheGrue Posts: 114
    edited 2009-03-10 15:53
    Chris,

    That is a super helpful demo. Short clean code and easy to understand. I feel more confident about using it now in my projects. In the future I will probably be using it for quick and dirty numerical only outputs like displaying sensor data etc. I'll probably scale back the segment count since I only would need numbers but it will be nice to your object to fully utilize the display.

    Thank You.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-03-10 16:10
    There's some good information in this thread as well.

    http://forums.parallax.com/showthread.php?p=745806

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-10 19:29
    I just looked back…I apologize for not commenting each line for everyone. If you have any questions you can always ask here. The final driver will be fully documented and commented. When I completed the first test board someone asked how many I/O lines were left. After connecting the DS1302 to display the time and date there were only two. This is when I pointed out the following…

    You essentially have an SPI bus formed for the DS1302…using the remaining two I/O lines could give you for example, 16 inputs and 16 outputs using shift registers (which I have done on that demo). You also have the I2C lines normally used by the EEPROM which could be used for whatever you need, though I would probably use an I2C I/O expander.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-10 19:33
    Michael,

    Thanks for the comments and feedback. The displays are dimmer than they could be. I did experiment with dimming them down from that level but I found that in SPIN there is a point which, when past is too low for the minimum WAITCNT value and then it ‘locks up’, so to speak. So the dimming may have to wait for the assembly version. We’ll see. Since this is proof of concept when making your own project you would obviously use smaller resistors than those on the PPDB. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • TheGrueTheGrue Posts: 114
    edited 2009-03-11 06:34
    turn.gif Very Cool!

    I look forward to your finished driver!

    Thanks
    640 x 480 - 119K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-11 19:07
    Harris, I guess I am going to implement dimming as far as within the limitations of SPIN. I will also be implementing blanking and decimal points.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • TheGrueTheGrue Posts: 114
    edited 2009-03-11 19:18
    Actually Chris, The brightness is perfect. Take a look at it in normal lighting... The first pic was shot in a darker room under poor florescent lighting and my older digital camera hates it...LOL scool.gif
    640 x 480 - 121K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-11 19:20
    Yes but the final object I release will have a setting for brightness and you will be able to dim the display down. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • TheGrueTheGrue Posts: 114
    edited 2009-03-19 22:34
    Chris,

    When do you think that the object will be available on the object exchange?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-20 14:39
    JHarris, I will try to put it up by Monday. Lost last weekend for coding due to family arriving from far, far away...

    A weekend is a lot for me these days. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • DanicoDanico Posts: 10
    edited 2009-05-05 12:53
    Chris,

    Your 16 segment driver code was very impressive, straight to the point.· Using it as a base for some multiplexed LEDs took all of about an hour to get going, where I thought it would be so difficult and take all night - thanks!

    Now to look at the dimming of these LEDs, but before doing so, thought to check if you had implemented that on this code?· Could not locate it on the object exchange.· Just thought it best to check instead of re-doing the wheel.

    D.
  • BADHABITBADHABIT Posts: 138
    edited 2009-05-28 23:50
    Chris,

    How's the display driver coming?

    Maybe you thought that you could get away w/o posting it since the thread died after you last entry. Either way the orig works good enough and is definitely appreciated -·and got the party started, so to speak. hop.gif

    OBC,

    How's the 101 cool projects for the PPDB coming along?
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-05-29 02:45
    101 projects is on hold while I'm working on these two expos.

    Between work and expo stuff I'm staying pretty busy, and I'm not
    willing to give up the little bit of actual bench time I get with the Prop. [noparse]:)[/noparse]

    I'll return to the book after August and the weather starts to cool again.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
Sign In or Register to comment.