Shop OBEX P1 Docs P2 Docs Learn Events
X-Y Bargraph — Parallax Forums

X-Y Bargraph

NewzedNewzed Posts: 2,503
edited 2006-03-17 23:53 in General Discussion
I have just finished laying out a PC board for an X-Y bargraph.· The horizontal X and the vertical Y each have 16 LEDs.· The idea is to visually display the output of a Memsic.· The board has 8 SOIC chips and 64
SMD 1206 components.· Three boards will cost me $59.00 and there is no way I would ever use more than one, so I am looking for two adventurous souls to buy the other two boards.· I will write the basic program to read the Memsic and use its output to drive the LEDs.· If you take one of the boards you will get the program along with it if you like, although you may have to calibrate your own Memsic.· If you have ExpressPCB, PM me and I will send you a copy of the board layout so you can see what it looks like.

Sid

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-01 20:58
    Couldn't you just post the ExpressPCB files and code here for anybody to look at?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • NewzedNewzed Posts: 2,503
    edited 2006-03-01 21:09
    I don't have the code written yet, but yes, I can post the ExpressPCB file.· I have checked the layout but it needs to be checked again.· For info, there is a blank space at the X-y intersection.· The +Y and -Y resistors are on the left side of the LED, the -X resistors are below the LEDs, nounted on the bottom.· The +X resistors are above the LEDs.· Each 2803 is marked to show which section it controls.· The notation "1-8" means Pin Qa of the 595 is driving Pin I8 of the 2803.· The notation "1-1" means Pin Qa of the 595 is driving Pin I1 of the 2803.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-01 21:19
    Did you not start with a schematic (ExpressSCH) first? I found that prevents a whole bunch of errors by using the netlist to tell you what point is supposed to be connected to what.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • NewzedNewzed Posts: 2,503
    edited 2006-03-01 21:25
    I seldom use schematics unless it is something for a customer.· I find that using the PCB layout as the "schematic" works quite well for me.· Creating a schemtic can be an arduous task sometimes, and invariably you have to create new symbols to identify new parts you are using.· Sometimes it takes almost as much time to do the schematic as it does to lay out the board.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-03-02 18:20
    Well, no takers on the two extra PC boards yet.

    I have attached the code for the project.· An expert programmer can probably improve on it, but I wrote the only way I know.

    Some notes - since some of the Memsic outputs are negative numbers I had some problems handling them, so I padded the values of Xtilt and Ytilt with 1000 so I would always be working in the positive area.

    I don't have a board to work with yet so I'm not sure about the MSBFIRST/LSBFIRST·modes - I may have them backwards.· I got all the right answers for the four bytes going to the shift registers but I'll have to wait and see about the modes.

    This progrm will run on anything from a BS2 on up.· The conditional #SELECT takes care of all the pulse width conversions.

    The DEBUG screen displays the output of the Memsic and the BIN8 values of the four bytes going to the shift registers.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-03-03 16:17
    One board gone - one left to go.· In case you are on the edge, here is a list of parts required to assemble the bargraph:

    attachment.php?attachmentid=73959


    All parts are Digikey.· Parts cost is about $15.00, plus, of course, a Memsic and the PC board.

    Sid
    363 x 106 - 3K
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-03-03 16:23
    There is already code to do an asterisk on a debug terminal based on Memsic tilt- You can find it in this document:

    http://www.parallax.com/dl/docs/prod/compshop/TiltDispCntrl.pdf


    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • NewzedNewzed Posts: 2,503
    edited 2006-03-03 16:31
    Thanks, Ryan, but I needed a stand-alone visual display.· Hence the board and the code I wrote.

    Sid
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-03-03 16:45
    The point was code already existed. Adaptation to a board with LEDs or other device should be relatively trivial.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • NewzedNewzed Posts: 2,503
    edited 2006-03-03 17:31
    Ryan, I don't think writing the additional code for four shift registers, each with their own SELECT/CASE, was really trivial.· Took me several hours to write and debug.· But maybe then I over-value my efforts.

    Sid
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-03-03 17:54
    I was trying to help save you time Sid, not insult you. I'm sorry you took it that way, it was not my intent to belittle your efforts, but to help you save time.

    I often stand on the shoulders of giants myself [noparse];)[/noparse]

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • NewzedNewzed Posts: 2,503
    edited 2006-03-03 18:52
    I was trying to help save you time Sid, not insult you

    That was the way I took it, Ryan. There was no insulting or belittling received.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-03-17 23:18
    I finally got my X-Y bargraph finished.· After the board was up and running, I made a mask for it that covered everything but the LEDs.· Turned out a bit too big and it's showing a little more of the board than I wanted it to.

    Each LED represents 5 degrees of tilt, which is a bit much.· I'm going to change the scaling to maybe 4 degrees per LED - 32 degrees max - or maybe 3 degrees per LED - 24 degrees max.

    I've attached a couple of pictures, one of the bare board and one of the board operating with the mask in place.· The LEDs are showing 20 degrees tilt left and 10 degrees tilt down (front end down).

    I'll post a revised program as soon as I decide on the scaling.· Comments as to whether it should be 5, 4 or 3 degrees per LED would be helpful.

    Sid
    450 x 336 - 10K
    450 x 338 - 7K
  • NewzedNewzed Posts: 2,503
    edited 2006-03-17 23:53
    Here is a picture without the mask - same operating conditions.· Not that bad, really.· Maybe I'll do away with the mask.

    Sid
    450 x 297 - 10K
Sign In or Register to comment.