Open GoogleCodeExporter opened 8 years ago
Not sure what I can do here.
The controller may be different: SH1106 instead of the SSD1306. Also power
supply and the logic levels are important. Maybe it is working with a 5V
Arduino.
Also note that these OLEDs often do not have proper level shifters, but are
designed for 5V ports.
Original comment by olikr...@gmail.com
on 9 May 2015 at 5:45
I'm now facing also problems with the white Displays.
Is it possible that there is a timing problem?
Might I have to add additional delays in my com procedure?
uint8_t u8g_com_hw_spi_fn1(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
*arg_ptr)
{
switch(msg)
{
case U8G_COM_MSG_STOP: //STOP THE DEVICE
break;
case U8G_COM_MSG_INIT:
pinMode(3, OUTPUT); //DC
pinMode(10, OUTPUT); //CS
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV2);
pinMode(2, OUTPUT); //RES
digitalWrite(2, HIGH);
delay(1);
digitalWrite(2, LOW);
delay(10);
digitalWrite(2, HIGH);
break;
case U8G_COM_MSG_ADDRESS: //SWITCH FROM DATA TO COMMAND MODE (arg_val == 0 for command mode)
if (arg_val) digitalWrite(3, HIGH);
else digitalWrite(3, LOW);
break;
case U8G_COM_MSG_CHIP_SELECT:
if (!arg_val) digitalWrite(10, HIGH);
else digitalWrite(10, LOW);
break;
case U8G_COM_MSG_RESET: //TOGGLE THE RESET PIN ON THE DISPLAY BY THE VALUE IN arg_val
digitalWrite(2, arg_val);
break;
case U8G_COM_MSG_WRITE_BYTE: //WRITE BYTE TO DEVICE
SPI.transfer(arg_val);
break;
case U8G_COM_MSG_WRITE_SEQ:
case U8G_COM_MSG_WRITE_SEQ_P: //WRITE A SEQUENCE OF BYTES TO THE DEVICE
{
register uint8_t *ptr = static_cast<uint8_t *>(arg_ptr);
while(arg_val > 0){
SPI.transfer(*ptr++);
arg_val--;
}
}
break;
}
return 1;
}
Original comment by michad...@googlemail.com
on 10 May 2015 at 10:42
Original issue reported on code.google.com by
michad...@googlemail.com
on 8 May 2015 at 8:02Attachments: