Oasis TOFD-5465GGH-B 4 Digit LED with PT6961 Controller

 

Introduction

The TOFD-5465GGH-B is a 4 digit 7 segment display with a PT6961 LED driver embedded on the back.  I found these on Ebay for 10 for $10 plus shipping.  Ended up being about $1.30 each.  The PT6961 is an LED driver with a SPI interface which means you can talk to it with any microcontroller (PIC, STAMP, Arduino, etc.)  I used both a PIC 18F458 & Arduino Uno to communicate with it.  Very little information was available on these displays and I owe a thanks to some members of the http://forum.43oh.com forum for pointing me in the right direction.  Below are the details regarding the implementation with an Arduino Uno controller.

 

Pinout

 

 The pinout for the display is shown below. Pin 1 is the pin closes to pin 1 on the PT6961.  This is the left most pin when the display is face down with the pins down.
 
  1. Power (+5 Volts)
  2. Chip Select (Active Low)
  3. Clock
  4. DIN
  5. DOUT
  6. Common
 
 
 
 
The chip select is active low meaning that it must be pulled low to enable the chip for communications.  The clock signal is used to load data into the display and the PT6961 reads data on the rising edge of the clock pulse.  The data in pin shift data into the display LSB first.  Please refer to the data sheet on the PT6961 for more information.
 

Segment Mapping

 

 The PT6961 controller uses display RAM to store the data that is transferred from the external device (Arduino).  This dispay RAM is mapped to the LED segments.  The LED display uses the RAM at addresses 0xC0 (segment 1), 0xC2 (segment 2), 0xC4 (segment 3), and 0xC6 (segment 4).  Each bit at the address represents a segment on the display.  The segment map is shown below.  The decimal points do not appear to be connected to the LED display.  The colon segments are controlled from the 7th bit of 0xC0 and 0xC2.

 

Program

 

 Below is a sample program using the Arduino Uno.  I wrote a PT6961 driver for the Arduino which is available for download below. 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include
// Pin 2 = CS
// Pin 3 = CLK
// Pin 4 = DIN
PT6961 LED(4, 3, 2);
void setup()
{
     LED.initDisplay();
     Serial.begin(9600);
}
 
void loop()
{
     //count through 0-9,a-f
     for(int i=0; i<16; i++)
     {
          LED.sendDigits(0,0,0,i,0);
          Serial.println(i);
          delay(500);
     }
}

 

PT6961 Library

 

This library has not been well tested, so please post any problems or comments here.

PT6961(int DIN, int CLK, int CS);

PT6961 is the constructor for the library.  This is called at the first of the program and the pins used for communications are assigned.

void initDisplay();

This function is called in the setup routine of the Arduino program to initialize the display driver.

void initRAM();

This function is used to clear the display RAM in the PT6961.

void sendCmd(char cmd);

This function is used to send commands to the PT6961.  A listing of the commands enumeration is shown below

  • _AUTO_INCREMENT – Auto increment display RAM
  • _FIXED_ADDRESS – Fixed display RAM address
  • _DISPLAY_OFF – Turn display off
  • _DISPLAY_1_16 – Turn display on 1/16 cycle
  • _DISPLAY_2_16 – Turn display on 2/16 cycle
  • _DISPLAY_4_16 – Turn display on 4/16 cycle
  • _DISPLAY_10_16 – Turn display on 10/16 cycle
  • _DISPLAY_11_16 – Turn display on 11/16 cycle
  • _DISPLAY_12_16 – Turn display on 12/16 cycle
  • _DISPLAY_13_16 – Turn display on 13/16 cycle
  • _DISPLAY_14_16 – Turn display on 14/16 cycle
void sendNum(int num, char colon);

 This function is used to send a number and enable the colon. Parameters are num (0-F) & colon (0=off; 1=on)

void sendDigits(char digit1, char digit2, char digit3, char digit4, char colon);

This function is used to send a number as individual digits. Parameters are digit1 (0-F), digit2 (0-F), digit3 (0-F), digit4 (0-F), & colon (0=off; 1=on)

 

Downloads

PT6961 Arduino Driver

PT6961 Driver

PT6961 Data Sheet

PT6961 Datasheet

37 Comments

  • mark says:

    You are absolutely right about “Very little information was available on these displays” I’ve been looking forever but its awesome to see your pin out with a picture but i was wondering if you knew how to code it for my basic stamp 2 in Pbasic , Ive been trying to get this thing to work for weeks and still havent got it to work
    thanks
    Mark
    Email – Mark0505@live.com

  • gblanton says:

    @mark

    Mark I do not have a basic stamp 2 module, but I took a look at the manual and the shiftout command should do nicely. Just remember to use LSBFIRST mode. If you download the ST6961 driver above and look at the ST6961.ccp file it will give you all the basic code you would need. It is written in C but it should be easy to convert to Pbasic. If you have problems send me the code and I may be able to help. I will also upload the ST6961 datasheet as soon as I get a chance.

  • mark says:

    Gblanton
    Okay thanks I will try figuring it out but I know nothing with C just barely know enough on basic but thanks again

  • mark says:

    Hi Gblanton
    I tried and am still trying to figure out the right code , I have the datasheet but dont really understand it so clearly my code below makes the display light up but in a very different language but Im trying to figure it out. Any help would be greatly appreciated thanks

    ‘ {$STAMP BS2}
    ‘ {$PBASIC 2.5}

    EN PIN 0
    CLK PIN 1
    DOUT PIN 2
    y VAR Word

    cfg VAR Byte

    DIRA = 15 ‘DIRA is pins 0 to 3
    CFGN CON %11001101
    CFG = %11011001
    Y = %00001101

    START:
    GOSUB config
    en = 0
    SHIFTOUT DOUT, CLK,LSBFIRST, [y\4,8]
    en = 1
    PAUSE 10
    GOTO START

    CONFIG:
    EN = 0 ‘ Enable data input
    SHIFTOUT DOUT, CLK, LSBFIRST, [cfg] ‘ Write to display config register
    EN = 1
    PAUSE 10
    RETURN

  • gblanton says:

    I do not have anything to test the code in, but it would probably look like this:

    ‘This is the character map for the display

    DISP VAR byte(16)

    DISP[0] = $Bf
    DISP[1] = $06
    DISP[2] = $5b
    DISP[3] = $4f
    DISP[4] = $66
    DISP[5] = $6d
    DISP[6] = $7d
    DISP[7] = $07
    DISP[8] = $7f
    DISP[9] = $6f
    DISP[10] = $77
    DISP[11] = $7c
    DISP[12] = $58
    DISP[13] = $5e
    DISP[14] = $79
    DISP[15] = $71

    x VAR Nib

    ‘set display to 6×12 segments
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, $02
    EN = 1

    ‘set to writing mode, auto increment address after data write
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, $40
    EN = 1

    ‘clear 8 bytes of the display RAM – This will get rid of weird looking symbols
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, $C0 ‘This is the RAM address
    FOR x= 1 TO 8
    SHIFTOUT DOUT, CLK, LSBFIRST, $00 ‘This writes 0 to RAM
    NEXT
    EN = 1

    ‘display on, max brightness
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, $8F
    EN = 1

    ‘count through 0-9,a-f
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, $C0 ‘This is the RAM address
    FOR x= 0 TO 15
    SHIFTOUT DOUT, CLK, LSBFIRST, DISP[x] ‘Number
    NEXT
    EN = 1

  • mark says:

    Okay thanks I will test it and see what i can find out, how you know C and basic is beyond me but i will let you know thanks again

  • mark says:

    Okay I have so far got this code to work and still learning how to get the other 3 displays on if I run this code only the far left display will run 0-f and the other 3 digits are off. Thats sweet its working atleast thanks to Gblanton

    ‘ {$STAMP BS2}
    ‘ {$PBASIC 2.5}

    EN PIN 0 ‘ enable
    CLK PIN 1 ‘ clock
    DOUT PIN 2 ‘ data out

    digit VAR Byte
    b VAR Byte
    phrase VAR Byte
    idx VAR Word
    char VAR Byte
    x VAR Nib

    disp0 DATA $3f
    DISP1 DATA $06
    DISP2 DATA $5b
    DISP3 DATA $4f
    DISP4 DATA $66 ‘ DISP0-15 DATA $66 switched from DISP[4] = $66
    DISP5 DATA $6d
    DISP6 DATA $7d
    DISP7 DATA $07
    DISP8 DATA $7f
    DISP9 DATA $6f
    DISP10 DATA $77
    DISP11 DATA $7c
    DISP12 DATA $58
    DISP13 DATA $5e
    DISP14 DATA $79
    DISP15 DATA $71

    DIRA = 15

    START:
    idx = 0
    LOOKUP (phrase – 0),
    [disp0,disp1, disp2, disp3, disp4,disp5, disp6,disp7, disp8,disp9, disp10,disp11, disp12,disp13, disp14,disp15], idx
    PAUSE 1
    GOSUB SET
    GOSUB SETWRITE
    GOSUB CLEAR
    GOSUB DMAX
    GOSUB COUNT15
    GOTO start

    ‘set display TO 6×12 segments
    SET:
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, [$02]
    EN = 1
    RETURN
    ‘set TO writing mode, auto increment address after DATA WRITE
    SETWRITE:
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, [$40]
    EN = 1
    RETURN

    ‘clear 8 bytes of the display RAM – This will get rid of weird looking symbols
    CLEAR:
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, [$C0] ‘This is the RAM address
    FOR x = 1 TO 8
    SHIFTOUT DOUT, CLK, LSBFIRST, [$00] ‘This writes 0 TO RAM
    NEXT
    EN = 1
    RETURN

    ‘display ON, MAX brightness
    DMAX:
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, [$8F]
    EN = 1
    PAUSE 10
    RETURN

    ‘COUNT through 0-9-a-f
    COUNT15:
    FOR b = 0 TO 15
    READ idx ,char
    EN = 0
    SHIFTOUT DOUT, CLK, LSBFIRST, [$C0] ‘This is the RAM address

    SHIFTOUT DOUT, CLK, LSBFIRST, [char] ‘Number [DISP,x\4]
    EN = 1
    DEBUG ? idx , CR
    idx = idx + 1
    PAUSE 10

    PAUSE 600
    NEXT
    RETURN

  • gblanton says:

    The code under the comment “COUNT through 0-9-a-f” controls both the digit to write as well as the value to write….

    SHIFTOUT DOUT, CLK, LSBFIRST, [$C0] is the far left digit
    SHIFTOUT DOUT, CLK, LSBFIRST, [$C2] is the next
    SHIFTOUT DOUT, CLK, LSBFIRST, [$C4] and the next
    SHIFTOUT DOUT, CLK, LSBFIRST, [$C6] is the far right digit

    You can test this by changing SHIFTOUT DOUT, CLK, LSBFIRST, [$C0] to SHIFTOUT DOUT, CLK, LSBFIRST, [$C2].

  • mark says:

    Okay now its making sense you know I have to tell you I’ve had these displays for 3 weeks and been working on them for like 3 weeks and finally you save the day

    SHIFTOUT DOUT, CLK, LSBFIRST, [$C0,char,$C2,char,$C4,char,$C6,char] works awesome
    it shows the same number because im just using char for each but the reason I wanted them to work is because I have 10 of them and many use’s for them but what i dont understand is your code with a little tweeking works awesome and you dont even have a BS2 thats a amazing

  • mark says:

    Okay maybe you can help me out again or not but worth asking I am going to use one of these displays to read a LM34 with a acd0831 temp sensor but I know I can code it in dec and if I put dec to this display its like it need Acsii code so instead of doing a bunch of numbers switching them threw DATA do you know of a easier way like to code like

    d1 = temp first digit will be 0 because I am not using decimals
    d2= temp second digit will be 1 or 0 because its not going higher then 150 F
    d3 = temp third digit and will be 0-9
    d4 = temp fouth digit and will be 0-9
    SHIFTOUT DOUT, CLK, LSBFIRST, [$C0,d1,$C2,d2,$C4,d3,$C6,d4]

    I know how to get temp to read 4 digits in DEC (decimal) but when i put it in shiftout its like it needs to be ACSII and was wondering if it was a simplier way if i make sense

  • gblanton says:

    ASCII is not what you are looking for. You need to convert your decimal number to a BCD number. BCD format basically stores a digit 0-9 in a nibble. So the decimal 123 will fill a double word like so 0000 0001 0010 0011. Each nibble is then used as a index to your look up table. Pbasic may have a BCD conversion function or you can do the math:

    digit1 = num / 1000
    digit2 = (num % 1000) / 100
    digit3 = (num % 100) / 10
    digit4 = (num % 10)

    % is the modulus function in C. I am sure that Pbasic has this.

  • mark says:

    OKay thanks I will study it in the Basic stamp manual and will try to figure it out which shouldn’t take to long since I made a digital temp with the mc144489 chip, 4 displays and with your huge help on the todf-5465ggh its all down hill from now thanks again

  • mark says:

    Okay I got everything working just perfect (well for my standards) what i like is I was able to run 3 displays only using 5 pins of my basic stamp 2 controller , I wanted to run 6 of them in a row but didnt want to solder any of them

    here is a quick boring video of some code I did
    https://www.youtube.com/watch?v=65jgA3V5drU

  • Mark says:

    Hi gblanton I just grabbed a picaxe kit using a picaxe 20m2 chip and i was trying to get the tofd 5465 to work with it since its in basic and studied the chip and since its not a 20X2 chip it says shiftout command is not supported but they do have a manual to use it in a serout command but I can not get the thing to work so basically i was wondering if you had any idea how to make the code from shiftout to serout
    just wondering
    thanks

  • gblanton says:

    Hi Mark. The “serout” command can not replace the “shiftout” command. “shiftout” is considered synchronous communication while “serout” is asynchronous communication. While “shiftout” uses a CLK pin to indicate that the next bit of data is on the line “serout” is time based and requires that the devices communicating to know the correct time base (baud rate for example). I am not sure why this chip would not support the “shiftout” command. However you could write a routine to operate the same as shiftout. There are probably hundreds of examples how to do this on the net. However if you run into problems implementing this let me know and I can put something together for you. I may take a while since I have been swamped lately. I looked at your video on youtube. Nice demo. Is this something you are implemented somewhere?

  • mark says:

    well thanks I will try searching but yes on the video its for a heater that heats up water in a tube to unthaw frozen pipes im a plumber and we get alot of those calls but I made a first one with out any chips and it was to heavy so i made another one that uses the BS2 with a MC14489 chip to run some displays i bought but since u showwed me how to code the tofd 5465 I will use them that way i dont have to solder every display since the chip is on it. but that video is for version 3 my third machine which can be ajustable set tempature since my version 2 is just programmed to a set tempature and it runs some elements heating the water and belive it or not it still works great.

  • mark says:

    Okay I searched and still am searching and reading but I still cannot get the code to work

    this line for BS2 – SHIFTOUT DOUT, CLK, LSBFIRST, [$C0,char,$C2,char,$C4,char,$C6,char]

    is replaced by a gosub shift out for picaxe which looks like this

    shiftout_LSBFirst:

    for counter = 1 to bits
    mask = var_out & LSBValue
    low sdata
    if mask = 0 then skipLSB
    high sdata

    skipLSB:

    pulsout sclk,1
    var_out = var_out / 2 ‘shift variable right for MSB
    next counter
    return

    so since var_out is the data sent to the tofd-5465 I tried many programs like

    var_out = $8F
    low chipselect
    gosub shiftout_LSBFirst
    high chipselect
    var_out = $C0
    low chipselect
    gosub shiftout_LSBFirst
    high chipselect
    var_out = $00
    low chipselect
    gosub shiftout_LSBFirst
    high chipselect

    and etc for digit displays with numbers and looked at many codes and can not get the thing to come alive so i thought well maybe its a bad display so i changed it 3 times and reassured the connections are right I wish the basic commands for the picaxe would break it down with more information for plumbers

  • mark says:

    Okay I searched and still am searching and reading but I still cannot get the code to work

    this line for BS2 – SHIFTOUT DOUT, CLK, LSBFIRST, [$C0,char,$C2,char,$C4,char,$C6,char]

    is replaced by a gosub shift out for picaxe which looks like this

    shiftout_LSBFirst:

    for counter = 1 to bits
    mask = var_out & LSBValue
    low sdata
    if mask = 0 then skipLSB
    high sdata

    skipLSB:

    pulsout sclk,1
    var_out = var_out / 2 ‘shift variable right for LSB
    next counter
    return

    so since var_out is the data sent to the tofd-5465 I tried many programs like

    var_out = $8F
    low chipselect
    gosub shiftout_LSBFirst
    high chipselect
    var_out = $C0
    low chipselect
    gosub shiftout_LSBFirst
    high chipselect
    var_out = $00
    low chipselect
    gosub shiftout_LSBFirst
    high chipselect

    and etc for digit displays with numbers and looked at many codes and can not get the thing to come alive so i thought well maybe its a bad display so i changed it 3 times and reassured the connections are right I wish the basic commands for the picaxe would break it down with more information for plumbers

  • mark says:

    I have some of it figured out for the tofd-5465 I can get one digit to turn on
    its like no body using the picaxe chip works with digital displays they all use lcds with mostly one wire communication.
    here is my code for the picaxe to read one display

    symbol sclk = c.2 ‘‘ clock for tofd-5465
    symbol sdata = c.1 ‘‘ data for tofd-5465
    symbol cs = b.7 ‘‘ enable for tofd-5465
    symbol counter = b7 ‘‘ variable used during loop
    symbol mask = w4 ‘‘ bit masking variable
    symbol var_out = w6 ‘‘ data variable used during shiftout
    symbol bits = 8 ‘‘ number of bits
    symbol MSBvalue = 128 ‘‘ LSBvalue ‘(=128 for 8 bits, 512 for 10 bits, 2048 for 12 bits)ts)

    high cs
    low sdata
    low sclk

    var_out = 255

    Main:

    low cs
    gosub shiftout1
    high cs
    gosub clearr

    START:
    low b.4 ‘ have a led to this pin to tell the loop is running
    gosub display1
    high b.4
    pause 1000
    goto start

    CLEARR:
    low cs
    var_out = $8a ‘ brightness
    gosub shiftout1
    var_out = $C0
    gosub shiftout1
    var_out = $00
    gosub shiftout1
    high cs
    return

    display1:
    low cs
    var_out = $C0 ‘ digit 1
    gosub shiftout1
    var_out = $06 ‘ displays num 1 on display
    gosub shiftout1
    high cs
    low cs
    var_out = $C2 ‘digit 2
    gosub shiftout1
    var_out = $5b ‘displays num 2
    gosub shiftout1
    high cs
    low cs
    var_out = $C4 ‘ digit 3
    gosub shiftout1
    var_out = $4f ‘displays num 3
    gosub shiftout1
    high cs
    low cs
    var_out = $C6 ‘ digit 4
    gosub shiftout1
    ‘pause 1000
    var_out = $66 ‘ displays num 4
    gosub shiftout1
    high cs
    return

    SHIFTOUT1:
    for counter = 1 to bits ‘‘ number of bits
    mask = var_out & 1 ‘‘ mask LSB
    low sdata ‘‘ data low
    if mask = 0 then skipLSB
    high sdata ‘‘ data high
    skipLSB: pulsout sclk,1 ‘ pulse clock for 10us
    var_out = var_out / 2 ‘ shift variable right for LSB
    next counter
    return

    this program will run and it only displays the dec 1 and dec 2 nothing else so back to the drawing board I go

  • mark says:

    Okay I finally figured out my problem and now I have the displays working perrfectly and the problem wasn’t my code it was my ground wire was hooked in the wrong bread board pin. After 13 hours trying to code the display using the picaxe 20m2 chip trying to get it to work it comes down to a ground wire and whats funny is the tofd-5465 was still showing one digit and then freaked out. Still very dumb mistake on my part but im glad i have it working.
    here is my code for picaxe
    symbol sclk = b.6 ‘‘ clock for tofd-5465
    symbol sdata = b.5 ‘‘ data for tofd-5465
    symbol cs = b.7 ‘‘ enable for tofd-5465
    symbol counter = b7 ‘‘ variable used during loop
    symbol mask = w1 ‘‘b3-b2 bit masking variable
    symbol var_out = w2 ‘b4-b5‘ data variable used during shiftout
    symbol bits = 8 ‘‘ number of bits
    symbol MSBvalue = 128 ‘‘ LSBvalue ‘(=128- 8 bits512-10 bits, 2048-12 bits)ts)
    high cs
    low sdata
    low sclk
    output sclk
    output sdata
    output cs

    symbol bah = b10
    symbol baa = b12
    bah = 0
    baa = 0

    output b.4

    START:

    high b.4
    gosub clearr

    gosub d1

    gosub d2

    gosub d3

    gosub d4
    low b.4
    pause 1000

    goto start

    CLEARR:
    low cs
    var_out = $8c
    gosub shiftout1
    var_out = $c0
    gosub shiftout1
    var_out = $00
    gosub shiftout1
    high cs
    return

    D1:
    low cs
    var_out = $C0 ‘digit 1
    gosub shiftout1
    var_out = 6 ‘displays num 1
    gosub shiftout1
    high cs
    return

    D2:
    low cs
    var_out = $C2 ‘digit 2
    gosub shiftout1
    var_out = 91 ‘displays num 2
    gosub shiftout1
    high cs
    return

    D3:
    low cs
    var_out = $C4 ‘digit 3
    gosub shiftout1
    var_out = 79 ‘displays num 3
    gosub shiftout1
    high cs
    return

    D4:
    low cs
    var_out = $C6 ‘digit 4
    gosub shiftout1
    var_out = 102 ‘displays num 4
    gosub shiftout1
    high cs
    return

    shiftout1:
    for counter = 1 to bits ‘‘ number of bits
    mask = var_out & 1 ‘‘ mask LSB
    low sdata ‘‘ data low
    if mask = 0 then skipLSB
    high sdata ‘‘ data high
    skipLSB: pulsout sclk,1 ‘‘ pulse clock for 10us
    var_out = var_out/2 ‘‘ shift variable right for LSB
    next counter
    return

    works awesome now with a few tweeks im going to make digit display the whole world jk

  • gblanton says:

    Great! Glad to here it. Looking forward to seeing your final product.

  • Raja Balu says:

    The download links are not operative. Is it possible for you fix the links. Thanks.

  • Raja Balu says:

    @gblanton
    Thanks for making the downloads available. Much appreciated.

  • […] write some wrapper functions to make our job here easier. Accidentally I stumbled upon the work by gblanton. Gblanton has already done the heavy lifting for us in terms of writing a useful class library for […]

  • Raja Balu says:

    Your class library helped me to build a Function Generator with the LED display for frequency selection. Many thanks. I have blogged about your site here http://poonisteps.wordpress.com/2013/06/03/building-your-own-function-generator-display/

  • gblanton says:

    @Raja Balu

    Thanks. I am glad it worked for you.

  • John Lepone says:

    // HOPE THIS HELPS YOU GUYS //

    void display7SegmentLED(int DIN,int CS,int CLK, char strDisplay[], int intStart,int intDelay)
    {
    int int1;
    int int2;
    int int3;
    int int4;

    int1 = getCharInt(strDisplay[intStart]);
    int2 = getCharInt(strDisplay[intStart+1]);
    int3 = getCharInt(strDisplay[intStart+2]);
    int4 = getCharInt(strDisplay[intStart+3]);

    digitalWrite(CS,LOW);
    shiftOut(DIN, CLK, LSBFIRST, 0xC0);

    //FirstDigit
    shiftOut(DIN, CLK, LSBFIRST, int1);

    //Dunno
    shiftOut(DIN, CLK, LSBFIRST, 0);

    //second Digit
    shiftOut(DIN, CLK, LSBFIRST, int2);

    //Colon
    shiftOut(DIN, CLK, LSBFIRST, 0);
    //Third Digit
    shiftOut(DIN, CLK, LSBFIRST, int3);
    //Dunno
    shiftOut(DIN, CLK, LSBFIRST, 0);
    //Fourth Digit
    shiftOut(DIN, CLK, LSBFIRST, int4);
    //Dunno
    shiftOut(DIN, CLK, LSBFIRST, 0);
    digitalWrite(CS,HIGH);
    }

    int getCharInt(char chrLetter){
    switch(chrLetter){

    case ‘A’:
    return 119;
    break;
    case ‘B’:
    return 124;
    break;
    case ‘C’:
    return 57;
    break;
    case ‘D’:
    return 94;
    break;
    case ‘E’:
    return 121;
    break;
    case ‘F’:
    return 113;
    break;
    case ‘G’:
    return 111;
    break;
    case ‘H’:
    return 118;
    break;
    case ‘I’:
    return 48;
    break;
    case ‘J’:
    return 30;
    break;
    case ‘K’:
    return 114;
    break;
    case ‘L’:
    return 56;
    break;
    case ‘M’:
    return 20;
    break;
    case ‘N’:
    return 84;
    break;
    case ‘O’:
    return 92;
    break;
    case ‘P’:
    return 115;
    break;
    case ‘Q’:
    return 103;
    break;
    case ‘R’:
    return 80;
    break;
    case ‘S’:
    return 109;
    break;
    case ‘T’:
    return 49;
    break;
    case ‘U’:
    return 62;
    break;
    case ‘V’:
    return 100;
    break;
    case ‘W’:
    return 54;
    break;
    case ‘X’:
    return 68;
    break;
    case ‘Y’:
    return 102;
    break;
    case ‘Z’:
    return 91;
    break;
    case ‘1’:
    return 6;
    break;
    case ‘2’:
    return 91;
    break;
    case ‘3’:
    return 79;
    break;
    case ‘4’:
    return 102;
    break;
    case ‘5’:
    return 109;
    break;
    case ‘6’:
    return 125;
    break;
    case ‘7’:
    return 39;
    break;
    case ‘8’:
    return 121;
    break;
    case ‘9’:
    return 111;
    break;
    case ‘0’:
    return 63;
    break;
    case ‘-‘:
    return 64;
    break;
    case ‘=’:
    return 9;
    break;
    default :
    return 0;
    break;
    }
    }

  • John Lepone says:

    I used this thread as a jumping off point. I currently have 2 displays connected scrolling a marquee left and right. The dots of the colon can be toggled individually, but I cannot figure out how to get the decimal point to display.

  • gblanton says:

    @John Lepone
    From the best I can tell and from of the testing of others, the decimal points are not connected.

  • Herb Mueller says:

    I am using a R3 Arduino UNO with a lot of problems getting the sample sketch to compile. I am a new Arduino UNO user switching from the Motorola and Intel micro controllers. The compiler seems to dislike the use of LED and ST6961 in some commands and PT6961 in others and the use of .CCP and .h files. Any push in the right direction would be appreciated.

  • gblanton says:

    @Herb Mueller
    Herb, sorry for the confusion. All references to ST6961 should have been PT6961. I updated the driver but not the webpage. I also fixed the example code. WordPress truncated some of the text during an update. The PT6961 folder containing the .CCP and .h files need to be put in the .\Arduino\libraries folder. The include statement “#include ” in the example code (sketch) looks in the \Arduino\libraries subfolders for the PT6961 driver files. These files are not opened from the sketch editor directly. To get it working follow these steps:

    1) Copy “PT6961” folder containing .CP and .h files into the .\Arduino\libraries folder.
    2) Create new sketch.
    3) Paste example code into sketch.
    4) Compile

  • Herb Mueller says:

    Thanks for the explanation, the new code addressed all the questions I had with the original code. I followed all the instructions and the sketch compiled the first time, uploaded perfectly, and is executing as I type. Thanks again for your attention to detail, and “Hooray” I can use all the displays I bought.

    Herb Mueller
    Sherman, TX

  • Sean Marraffa says:

    I was hoping someone could help me. I can’t seem to get my display to work properly. I tried multiple displays with the sample code and nothing happened finally I broke the code down and used this …

    #include

    int _CS = 2;
    int _CLK = 3;
    int _DIN = 4;

    PT6961 LED(4, 3, 2);

    void setup()
    {
    LED.initDisplay();
    }

    void loop()
    {
    const char DISP[17] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x58, 0x5e, 0x79, 0x71, 0x61};

    int digit1 = 1;
    int digit2 = 2;
    int digit3 = 3;
    int digit4 = 4;

    digitalWrite(_CS,LOW);
    shiftOut(_DIN, _CLK, LSBFIRST, 0xC0);
    shiftOut(_DIN, _CLK, LSBFIRST, DISP[digit1] | 0x80);
    shiftOut(_DIN, _CLK, LSBFIRST, 0xC2);
    shiftOut(_DIN, _CLK, LSBFIRST, DISP[digit2] | 0x80);
    shiftOut(_DIN, _CLK, LSBFIRST, 0xC4);
    shiftOut(_DIN, _CLK, LSBFIRST, DISP[digit3]);
    shiftOut(_DIN, _CLK, LSBFIRST, 0xC6);
    shiftOut(_DIN, _CLK, LSBFIRST, DISP[digit4]);
    digitalWrite(_CS,HIGH);
    }

    My problem is that I don’t get all the digits to light up. The first digit is a 1 and the top of the colon is ON but everything else is OFF.

    Can anyone help?

  • gblanton says:

    @Sean Marraffa

    Your code as shown does not initialize the display…

    void PT6961::initDisplay()
    {
    sendCmd(_DISPLAY_6X12);
    sendCmd(_AUTO_INCREMENT);
    initRAM();
    sendCmd(_DISPLAY_14_16);
    }

    This is why only the first character works. Next the display drivers registers do not initialize to zero. This is why you have random LEDs lit up (well more than likely),

    void PT6961::initRAM()
    {
    //first clear 8 bytes of the display RAM
    digitalWrite(_CS,LOW);
    shiftOut(_DIN, _CLK, LSBFIRST, 0xC0);
    for(int i=0; i<8; i++){
    shiftOut(_DIN, _CLK, LSBFIRST, 0x00);
    }
    digitalWrite(_CS,HIGH);
    }

    I re-tested the code and it seemed to work. Which Arduino are you using? What voltage is the Arduino 3.3v or 5.0v? Did you copy the driver files to the libraries directory? Hope this helps.

  • Bill van Leeuwen says:

    I’ve successfully used these displays with an Arduino UNO to build a 6-Lane Pinewood Derby track timer. The serial interface kept the number of IO pins needed to drive the displays to a minimum. I kept the coding simple. The only library I used in my sketch is SPI.h. The rest of the code needed to initialize and drive the displays was put in the Setup or Main loop. If interested, shoot me an email at Billv923@outlook.com and I’ll send you a sketch that demonstrates the approach I used to drive the display.

    Cheers.
    Billv923@outlook.com

  • Mark says:

    Hi gblanton I am surprised to see this forum still standing
    and some years have gone by but just wanted to say thanks again for helping out a confused guy like me…I still use the tofd-5465 for many hobby items but mostly LCDs now since they can provide more display info but with out your help I wouldn’t have gotten any where.
    I don’t see any more of these on ebay for sale but I bought enough to last me for a while
    your friend mark

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>