Samsung HT-X200 Teardown – LED display control

In the recent YouTube video I uploaded I went into detail to show how to write to the display, which has 3 PT6961 IC’s, from an Arduino

Below is the chart that I put together to map the physical locations to the logical locations.

note: the data bytes are actually used in reverse order on the IC’s so they will need to be flipped when copying data from the buffer to the actual display.

The code is as follows:

/*
 LED Display test
 By Peter Murray
 Writes to PT6961 IC's
*/

#define CMD1 0b00000011 // Display mode setting command
#define CMD2 0b01000000 // Data setting command
#define CMD3 0b11000000 // Address setting command
#define CMD4 0b10001111 // Display control command
#define CLK 2
#define DAT 3
#define S1 6
#define S2 5
#define S3 4

unsigned long dBuffer[7]; // Display buffer - last 3 bits are ignored.

void writeByte(byte toWrite)
{
 int x;
 for (x=0;x<8;x++)
 {
 digitalWrite(CLK,LOW);
 if (bitRead(toWrite,x))
 {
 digitalWrite(DAT,HIGH);
 }
 else
 {
 digitalWrite(DAT,LOW);
 }
 digitalWrite(CLK,HIGH);
 }
}

void writeByteReverse(byte toWrite)
{
 int x;
 for (x=0;x<8;x++)
 {
 digitalWrite(CLK,LOW);
 if (bitRead(toWrite,7-x))
 {
 digitalWrite(DAT,HIGH);
 }
 else
 {
 digitalWrite(DAT,LOW);
 }
 digitalWrite(CLK,HIGH);
 }
}

void displayBuffer()
{
 int x;
 digitalWrite(S1,LOW); digitalWrite(S2,LOW); digitalWrite(S3,LOW);
 writeByte(CMD2);
 digitalWrite(S1,HIGH); digitalWrite(S2,HIGH); digitalWrite(S3,HIGH);

 digitalWrite(S1,LOW);
 writeByte(CMD3);
 for (x=0;x<7;x++)
 {
 writeByteReverse(dBuffer[x]>>24);
 writeByteReverse(dBuffer[x]>>16);
 }
 digitalWrite(S1,HIGH);

 digitalWrite(S2,LOW);
 writeByte(CMD3);
 for (x=0;x<7;x++)
 {
 writeByteReverse(dBuffer[x]>>13);
 writeByteReverse(dBuffer[x]>>5);
 }
 digitalWrite(S2,HIGH);

 digitalWrite(S3,LOW);
 writeByte(CMD3);
 for (x=0;x<7;x++)
 {
 writeByteReverse(dBuffer[x]>>2);
 writeByte(0x00);
 }
 digitalWrite(S3,HIGH);
}

void setup()
{
 pinMode(CLK, OUTPUT);
 pinMode(DAT, OUTPUT);
 pinMode(S1, OUTPUT);
 pinMode(S2, OUTPUT);
 pinMode(S3, OUTPUT);
 digitalWrite(S1,HIGH);
 digitalWrite(S2,HIGH);
 digitalWrite(S3,HIGH);
 dBuffer[0] = 0b10000000000010000000000010000000;
 dBuffer[1] = 0b01000000000101000000000101000000;
 dBuffer[2] = 0b00100000001000100000001000100000;
 dBuffer[3] = 0b00010000010000010000010000010000;
 dBuffer[4] = 0b00001000100000001000100000001000;
 dBuffer[5] = 0b00000101000000000101000000000100;
 dBuffer[6] = 0b00000010000000000010000000000010;
}

void scrollScreen()
{
 bool y;
 int x;

 for (x=0;x<7;x++)
 {
 y = bitRead(dBuffer[x],31);
 dBuffer[x]<<=1;
 if (y)
 {
 dBuffer[x]+=1;
 }
 }
}

void loop()
{
 // put your main code here, to run repeatedly:
 displayBuffer();
 delay(100);
 scrollScreen();
}

Leave a Reply

Your email address will not be published. Required fields are marked *