Page 2 of 2

Re: SPI 4 digit 7 segmet displays

PostPosted: Thu Sep 27, 2012 7:04 pm
by CheezeWiz
Well I can try chaining them together.

.. I really have NO idea what I'll do with these things at all. I thought they were neat and picked them up off ebay.

I'm pretty new to C++ and things like this are pretty interesting to play around with learning how SPI works, seeing the buspirate syntax while being able to sift though the sample C code is actually handy to see how both function.

I however, need to be able to get the C++ code and the BusPirate syntax from looking at the part documentation.... that's the goal at least.

I still need to find out what I'm going to do with 5x of the 16 char displays from deal extrem.. those are pretty cool as well.. I ordered a I2c or SPI Baro sensor, thought about doing a test with displaying with baro pressue on a display..

the other idea is use the displays stacked 5x16 as somehow a larger display....again no idea just poking around really.

I'm going to try fiddling with these things tonight and let you know if I find anything interesting.

I'm courious on how you display something on the 2nd display while keeping the first one blank if you have them chained together? Since It has the feature of Dout I'm guessing the mfg has somehow included this feature.

--Aaron

Re: SPI 4 digit 7 segmet displays

PostPosted: Thu Sep 27, 2012 10:46 pm
by CheezeWiz
rajabalu

Bit of an update,
I chained them together and able to get the first display to light up! I also get the erronous lit display on the right with another weird one.. I'm guessing its noise?

I'm not an expert at SPI... by far... I'm still wrapping my head around it.. but I would have to think the data out pin would have to different then the data going into data in for the device to fully increment/carry over to the next display.
.. I know that devices have addresses although if these are all the same I don't get how I could have one display carry to the other for an 8 digit display..

On the off chance I was thinking with something like a shift register.. This would make the command [0x02][0x40][0x8F][0xC0,0x3F] turn into something with some clock ticks before to shift up the register send data, shift it again, send some more data to the 2nd display.

Right?

Or am I thinking about this whole shindig incorrectly.

Thanks,
--Aaron

Re: SPI 4 digit 7 segmet displays

PostPosted: Fri Sep 28, 2012 3:04 pm
by mattbarn
You can connect all the other lines in parallel, but you need an individual CS for each display.

Re: SPI 4 digit 7 segmet displays

PostPosted: Sun Sep 30, 2012 1:38 pm
by CheezeWiz
Hi Mattbarn,

I'm thinking what you could use is a shift register with multiple outputs, then clock the CS line to display1, 2, 3, x with multiple ticks..

It might work? although if the shift register fubared up a tick it might be difficult to recover from it, other then reseting your project.

Maybe these displays suck? :)

Re: SPI 4 digit 7 segmet displays

PostPosted: Sat Oct 06, 2012 10:59 pm
by voidptr
touch wrote:I picked up some cheap 4 digit 7 segment displays over on eBay for $10 + shipping. They Include a SPI PT6961 driver chip built in that deals with PWM and Multiplexing, saves on microcontroller ports & current limiting resistors.
ZAP

http://www.ebay.com/itm/10-New-Oasis-4- ... 2ec116e572


Interesting but shipping to Canada is $31 ! lol kind of a scam !
I'm gonna send the seller a message to be sure ....

Re: SPI 4 digit 7 segmet displays

PostPosted: Sun Oct 07, 2012 2:02 pm
by rajabalu
Aaron - I have used a 74HC595 to control multiple displays. I use the shift register to select the STB of the display we want to control. I wrote a small program using Energia to control 2 displays, but, the idea is the same to control more displays.

The hardware setup is to connect the VCC, CLK, DIN and GND terminals of the displays in parallel and use the Q0 and Q1 from the Shift register to control the STB of the displays.

This article http://www.arduino.cc/en/Tutorial/ShiftOut helped me a lot.

Here is a picture of the HW setup Image.

And a video of the display in action at https://plus.google.com/photos/114723575852368105195/albums/5796643611597344577?authkey=CMOflL7LpK-hPQ.

I have listed my Energia code below.
Code: Select all
#include <SPI.h>

// P1.5 -> CLK
// P2.0 -> CS/SB - Not used here as we are using the shift register
// P1.6 -> DIN
// [0x02][0x40][0x8F][0xC0,0x3F] for bus pirate use
// [0xC0,0x00][0xC2,0x00][0xC4,0x00][0xC6,0x00]
// [0xC0,0x06][0xC2,0x5b][0xC4,0x4f][0xC6,0x66]

// P2.3 -> Data
// P2.4 -> Clock
// P2.5 -> Latch

//const int slaveSelectPin = SS;
const char DISP[16] {
  0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x58, 0x5e, 0x79, 0x71};

int latchPin = P2_5;
int clockPin = P2_4;
int dataPin = P2_3;

void setup()
{
  pinMode (latchPin, OUTPUT);
  pinMode (clockPin, OUTPUT);
  pinMode (dataPin, OUTPUT);
  SPI.begin();
  SPI.setBitOrder(LSBFIRST);
  SPI.setDataMode(SPI_MODE2);
  delay(500);
}

void loop()
{
  //set display to 6x12 segments
  // First Display FE 1111 1110
  chipSelect(0XFE);
  SPI.transfer(0x02);
  chipSelect(0xFF);

  // Second Display 1111 1101
  chipSelect(0XFD);
  SPI.transfer(0x02);
  chipSelect(0xFF);
 
  //set to writing mode, auto increment address after data write
  chipSelect(0xFE);
  SPI.transfer(0x40);
  chipSelect(0xFF);

  chipSelect(0xFD);
  SPI.transfer(0x40);
  chipSelect(0xFF);
 
  //first clear 8 bytes of the display RAM
  chipSelect(0xFE);
  SPI.transfer(0xC0);
  for(int i=0; i<8; i++)
  {
    SPI.transfer(0x00);
  }
  chipSelect(0xFF);

  chipSelect(0xFD);
  SPI.transfer(0xC0);
  for(int i=0; i<8; i++)
  {
    SPI.transfer(0x00);
  }
  chipSelect(0xFF);

  //display on, max brightness
  chipSelect(0xFE);
  SPI.transfer(0x8F);
  chipSelect(0xFF);

  chipSelect(0xFD);
  SPI.transfer(0x8F);
  chipSelect(0xFF);

  //count through 0-9,a-f
  chipSelect(0xFD);
  SPI.transfer(0xC0);
  for(int i=0; i<4; i++)
  {
    SPI.transfer(DISP[i]);
    SPI.transfer(0x00);   
  }
  chipSelect(0xFF);
  delay(500);

  chipSelect(0xFE);
  SPI.transfer(0xC0);
  for(int i=4; i<8; i++)
  {
    SPI.transfer(DISP[i]);
    SPI.transfer(0x00);   
  }
  chipSelect(0xFF);
  delay(500);

}

void chipSelect(int value)
{
  digitalWrite(latchPin, LOW);
  // shift out the bits:
  shiftOut(dataPin, clockPin, MSBFIRST, value); 
  //take the latch pin high so the LEDs will light up:
  digitalWrite(latchPin, HIGH);
  // pause before next value:
  delay(500);
}


Re: SPI 4 digit 7 segmet displays

PostPosted: Sun Oct 07, 2012 9:26 pm
by voidptr
voidptr wrote:
touch wrote:I picked up some cheap 4 digit 7 segment displays over on eBay for $10 + shipping. They Include a SPI PT6961 driver chip built in that deals with PWM and Multiplexing, saves on microcontroller ports & current limiting resistors.
ZAP

http://www.ebay.com/itm/10-New-Oasis-4- ... 2ec116e572


Interesting but shipping to Canada is $31 ! lol kind of a scam !
I'm gonna send the seller a message to be sure ....



lol I received an answer from the seller shipping to Canada is really $31 or $22 if he remove plastic container
they are supposed to be in ... ( shipping in US seems to be $4 )

I would had bought some, but not at that price ! I shipped pizza box size motherboard to and from US to Canada for like $8
so I guess the seller is putting more bucks in his pocket or is this USA protectionism market strategy ...
lol

Re: SPI 4 digit 7 segmet displays

PostPosted: Thu Oct 11, 2012 11:26 pm
by touch
I'll ship them internationally if anyone wants some. I can just take them out of the tube and put them on some anti-static foam and ship them in a padded envelope. I don't really know what the cost would be put just shoot me a PM if you want some.

Re: SPI 4 digit 7 segmet displays

PostPosted: Fri Oct 12, 2012 8:17 am
by ian
Glad you guys worked it out, good luck with your projects.

Re: SPI 4 digit 7 segmet displays

PostPosted: Mon Oct 15, 2012 10:06 am
by CheezeWiz
So I have 30 of these things and I doubt I'll use them all.. or any of them at this point.... if anyone is in the US/CA I could sell a bunch to you... but you have to promise me you will make something awesome and show me photos.

I suppose it was a spontaneous buy :)

Ahh Ha! I knew it you can use a shift register! those things keep popping up everywhere..

However I think I kind of like those deal extreme displays better... and I still don't know what I'm going to use them for.....


--Aaron

Re: SPI 4 digit 7 segmet displays

PostPosted: Sat Nov 10, 2012 2:04 pm
by neslekkim
Did anyone get this running on an Arduino?, I have tried with the Due, but figuring out the spi thingys are not so easy.
I tried to code above, that seems to use software spi, and I get only sporadic numbers on the display from time to time, nothing is repetitive.