Shop OBEX P1 Docs P2 Docs Learn Events
An SX HEX Display Driver — Parallax Forums

An SX HEX Display Driver

awassonawasson Posts: 57
edited 2005-06-07 20:41 in General Discussion
I haven't started this project yet but I would like to create a 6 digit hex led display driver using an SX28. Has anyone tried or created a project like this yet?

I've got some microprocessor projects that output address and data information in HEX and I think using an SX would keep the parts count and costs down.

For use with my projects it will need to take a binary input and produce a hex output to seven segment led displays. I would like to use 4 digits for address and 2 digits for data. I'll probably just do a 2 digit data version to test it out and then expand it to include the 4 digit address portion.

Any thoughts and or direction?

Thanks,
Andrew

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-17 02:32
    Should be pretty easy. I made an 8-digit 7-segment display driver that takes data from a serial input pin. You can find that code and schematics in the January issue of Nuts & Volts magazine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • BeanBean Posts: 8,129
    edited 2005-05-17 02:39
    Andrew,

    Sounds like a winner. You should only need 7+6=13 I/O pins for the digits. The SX28 has 20, and more than enough speed to multiplex them.

    Are you planning on use SX/B or straight assembler ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    Product web site: www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • awassonawasson Posts: 57
    edited 2005-05-17 03:06
    Thanks Jon and Bean,
    I've got the January Nuts & Volts and I've pretty much worn the pages right out of it, reading and re-reading that article. That was one of my inspirations to try this out. The other reason is that TIL311's cost a small fortune, you can cook with them when they're running and Binary/HEX to seven segment drivers are getting pricey and rare as well.

    Bean I was thinking of going the straight Assembler route. I've dabbled in assembler for way to long and it's about time I actually made an honest go of it and learned it properly.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-05-17 15:01
    Andrew,

    at www.parallax.com/dl/src/prod/sx/ProgSXEdPre.zip you can download all the sample programs contained in my book. Check for APP012.SRC which contains sample code, demonstrating how to drive a six-digit 7-segment LED display, and APP013.SRC shows how to modify the application in order to display three SX registers in hex.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • awassonawasson Posts: 57
    edited 2005-05-17 17:07
    Thanks G
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-17 17:51
    SX/B now works with the SX48 and SX52, so you have access to plenty of pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-05-17 18:15
    Andrew,

    thanks for your comments on my book. I agree with you, and I have made the same experience - typing in the examples, testing, modifying, and refining them helps a lot to boost up the learning curve. I'm glad to learn that you really use this as a "workbook".

    Hmm - reading an 8-bit address bus and an 8-bit data bus would "eat up" 16 SX port pins (say RB, and RC), leaving you with just four pins (RA3...0) for the display. Nevertheless with two cascaded 8 bit serial-in/parallel out registers with output latches, like the 74HC595, it should be possible. You would need three SX pins to drive the shift register's serial data input, the shift register clock input, and the storage register clock input pins, leaving one free SX port pin for some other use. As the 74HC595 may not be capable of directly driving the 7 segment displays (I did not check the DC specs), you might need additional transistors to drive the display segment and column lines.

    I think, an SX28 clocked at 50 MHz with an ISR handling the shift registers, i.e. shifting out the segment and column bits for the 7-segment display, and strobing the parallel latches, together with a main program polling the address and data input lines should do the job.

    Another alternative would be using an SX52 giving you enough I/O pins to directly control the display. You would even have enough input pins available for reading 16-bit addresses.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • awassonawasson Posts: 57
    edited 2005-06-04 04:04
    Ok I'm Back!

    I've pretty much figured out how I'm going to read my 8 bit buss (!RB) and create an asynchronous ISR to update the register that will hold the value. I've also written some assembler to drive 2 7-seg hex displays. I had common cathode Fairchild MAN6740's kicking around so that's what I used.

    The code borrows heavily from Programming the SX Microcontroller but I really wanted to figure it out for myself so... It is not a line for line duplicate. As a result, it doesn't do exactly what I want just yet and I'm stumped on one issue. I've uploaded my source just in case someone wants to help out. It's a work in progress so I'm sure there are many wasted cycles along with a few "what the heck is he thinking" programming mistakes.
    • I use 2 RA ports for my cathodes and 8 RC ports for my anodes.
    • I'm using an identical but opposite (+ Logic) Decode subroutine from Programming the SX to set the bits on the anodes
    • I've got a ClearData sub that is called at the Start of the program
    Once started my main program consists of 2 loops.

    The outer loop assigns a digit (constant) to each of the digits registers, sets the (number of digits) counter, assigns the first column and sets the value of the first digit into the digit variable.

    The inner loop decrements the counter (if zero jumps to the outer loop), assigns the low bit to the appropriate cathode (RA), assigns the bits to the appropriate anodes (RC), gets ready for the next digit and number then jumps to the inner loop.

    This is all well and fine however, I can't for the life of me figure out how to assign a register to my digits variable so that I can experiment with changing hex values.

    I hope this makes sense.

    As I've been working through the exercise, I have realized that this is actually quite a simple task once you know what you're doing. I don't just quite yet but I'm getting there.

    I've uploaded my polling ISR source as well. It's also quite experimental at the moment but it's a good start.

    Cheers,
    Andrew

    Post Edited (awasson) : 6/4/2005 7:57:18 PM GMT
  • awassonawasson Posts: 57
    edited 2005-06-07 05:50
    I'm not sure if anyone is following this project but if so feel free to jump in and share any tips and/or comments.

    * I deleted a handfull of my earlier posts as they were more ramblings than anything worthwhile.

    I have a working 8 bit in 2 hex display out prototype or, at least it works to the small degree of testing I have done with it so far. This is probably only of interest to someone who needs to view 8 bit data in hex and in my case I'll be attempting to hook it up to some vintage 8-bit microprocessors to see how it functions as a replacement for TIL311's or other high heat low efficiency devices.

    I've been running it non-stop for a few days and it's just barely warm at 4MHz.

    I've attached a schematic and listing if anyone is interested.

    Cheers,
    Andrew

    Post Edited (awasson) : 6/7/2005 5:56:22 AM GMT
  • PLJackPLJack Posts: 398
    edited 2005-06-07 10:59
    Nice Job awasson.

    Looks great.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jack
  • awassonawasson Posts: 57
    edited 2005-06-07 20:41
    Thanks Jack,
    Now that it works, the project is getting a little more interesting. It's far from refined and I'll bet I'm going to have to revisit timing issues and perhaps rethink using it as an asynchronous interupt.

    I also think that Gunther's suggestion of using the SX for input and 74HC595's to drive the displays will be a good route. I'll be back asking for advice about that I'm quite sure.

    I just hooked it up to the address of an RCA CDP1802ACE Chip that is clocked quite slow and running free (no halt instructions, etc...). So far so good. I'm really amazed because I haven't buffered the SX input at all and half expected it to hang once it got going.

    Update: I just added 2 pictures of the unit under test for approximately 6 hours continuously. Sorry the pictures are so poor. I actually got some shots with Hex A0 and Cb and A8 however my skills with the camera lack and they were quite blurred.

    These SX chips Rock!

    Next step is to see how it handles something running a bit faster. I'll take a picture with our digital and post it later.

    Andrew

    PS: I'm amazed at how much learned from the Parallax Development System Manual and Gunther's book. I wouldn't have even attempted this project without such great reference materials.

    Post Edited (awasson) : 6/8/2005 1:38:08 AM GMT
Sign In or Register to comment.