Author Topic: Scambled Eggs  (Read 3402 times)

SLTom992

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Scambled Eggs
« on: July 25, 2014, 04:22:03 PM »
I have the 12832 function library for the NewHaven NHD-2,23-12832. I made some modifications on the drivers since I have mine set up for 8080 and not 6800.

When I turn the display on I get a screen full of hash. None of the functions seem to do anything except Display_On_Off(); and possibly init though that may not work and the defaults allow it to work.

It appears as if it isn't getting any data writes. So here is driver for both Command and Data with the only difference the polarity of the D/C line: (PIC18)

Code: [Select]
   

( In the main init routines)

    TRISA = 0b00000011;
 
    ANSELA = 0x03;
 
    ADCON0 = 0b00000101;                // ADC 1 Enabled
    ADCON1 = 0b00000000;                // V ref = power and ground
    ADCON2 = 0b00111110;                //

    PORTA = 0b00000011;
    PORTC = 0b00100000;
    PORTD = 0b00000000;

// In Display.c

#define GPIOB PORTD
#define GPIOC PORTD
#define Send_Data (PORTA | 0b00010000)
#define Send_Command (PORTA & ~(0b00010000))
#define Chip_Deselect (PORTA | 0b000100000)
#define Chip_Select (PORTA & ~(0b000100000))
#define No_Read (PORTA | 0b00001000)
#define Read (PORTA & ~(0b00001000))
#define Write (PORTA & ~(0b00000100))
#define No_Write (PORTA | 0b00000100)
#define Dis_Reset (PORTC & ~(0b10000000))
#define Clear_Reset (PORTC | 0b10000000)

void oled_Command(unsigned char Data)   // 8080 mode
{
    LATC = Dis_Reset;
    LATC = Clear_Reset;
    LATA = No_Read;
    LATA = Send_Data;
    PORTD = Data;
    LATA = Chip_Select;
    LATA = Write;
    OLED_uDelay(0x04);               // Wait 100 usec
    LATA = No_Write;
    LATA = Chip_Deselect;
}


I have a two input scope and WR and CS work properly so I assume the other outputs are as well.

And anyone suggest why none of the functions such as Fill_Block, Fill RAM, Checkerboard, Show_Font57_12832(1, 17, 10, 10); and the like aren't working?

SLTom992

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Scambled Eggs
« Reply #1 on: July 27, 2014, 10:58:09 AM »
There is something else that is bothering me - in the pictures that show this display it shows the "top" of the display as being in the upper left with the connector down. We designed our board with that in mind.

I have managed to get the display to operate showing one line only and it is upside down from the pictures.

In the manual it DOES show the zero column and zero row as being in the lower right with the connector at the bottom as it more or less operated. But you have to search for it. This is on Page 3 of the specification sheet and is very easy to miss. So if this is so, why are the available fonts upside down compared to what is being shown in the photographs of the display on the advertisements? Did I get a factory second?

None of the functions seem to operate as is implied by their names and the descriptions of the input values.

If you are selling a display wouldn't it be appropriate to have some library functions that operate with a minimal amount of work to demonstrate the operation of the device? Quite frankly I'm rather surprised at the treatment of a display that could be quite helpful on small handheld instruments of all sorts where a large display would be unnecessary and expensive and time consuming to program.

I have tried to add a picture of the display with the single line and the noise on the rest of the display. But the file size is too large even in a GIF.

The characters show that the DATA lines are working OK and that the commands are therefore available. The question is why only the single line? Why won't the display clear? Why does "fill" only work on that single line?

If I use the "Frame" function the frame shows the LOWER edge of the frame with the sides disappearing up.
« Last Edit: July 28, 2014, 12:01:00 PM by SLTom992 »

SLTom992

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: Scambled Eggs
« Reply #2 on: July 28, 2014, 03:46:49 PM »
After verifying all of the lines and the control waveforms I got a second display and got precisely the same results.

After knocking my head against the table three or four times I looked at the base drivers again and realized that whoever had written that original code which I had modified had made a major mistake and stupidly I had followed their lead.

The drivers ALL lead with resetting the SSD1305 and so NO command had any effect beyond the default initialization except the very last command accomplished. Once the resets were removed not only were all four lines of the display working but the display was turned right-side up as in the advertisements because in the init function is the remap functions that accomplish that but wouldn't work in my testing because of the resets on each command.

Since I included the code and since these resets are in the original drivers it should have bit the Newhaven people in the butt immediately. So perhaps they simply aren't monitoring these groups.

In any case it appears that their functions are mostly correct. I still have to work on their alphanumeric display since they have a full space between each character instead of allowing the characters to be adjacent.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: Scambled Eggs
« Reply #3 on: July 31, 2014, 08:33:41 AM »
The functions in that example code do in fact work.  I have code below I have just used with this display + Arduino Mega that use these functions:

Code: [Select]
void loop()
{
  Checkerboard_12832();
  delay(500);
  Fill_RAM_12832(0x00);
  Show_Font57_12832(1, 52, 1, 16);
  Show_Font57_12832(1, 37, 1, 28);
  Show_Font57_12832(1, 51, 1, 40);
  Show_Font57_12832(1, 52, 1, 52);
  Show_Font57_12832(1, 41, 1, 64);
  Show_Font57_12832(1, 46, 1, 76);
  Show_Font57_12832(1, 39, 1, 88);
  delay(5000);
}

Code: [Select]
void Checkerboard_12832()
{
unsigned char i,j;

for(i=0;i<8;i++)
{
Set_Start_Page_12832(i);
Set_Start_Column_12832(0x00);

for(j=0;j<66;j++)
{
data_out(0x55);
data_out(0xaa);
}
}
}

Code: [Select]
void Fill_RAM_12832(unsigned char Data)
{
unsigned char i,j;

for(i=0;i<8;i++)
{
Set_Start_Page_12832(i);
Set_Start_Column_12832(0x00);

for(j=0;j<132;j++)
{
data_out(Data);
}
}
}

Code: [Select]
void Show_Font57_12832(unsigned char a, unsigned char b, unsigned char c, unsigned char d)
{
unsigned char *Src_Pointer=0;
unsigned char i;

switch(a)
{
case 1:
Src_Pointer=&Ascii_1[b][0];
break;
case 2:
//Src_Pointer=&Ascii_2[(b-1)][0];
break;
}
Set_Start_Page_12832(c);
Set_Start_Column_12832(d);

for(i=0;i<5;i++)
{
data_out(*Src_Pointer);
Src_Pointer++;
}
data_out(0x00);
}