HTel wrote:4 colors, that is 2 bit... and it works... I thought gamebuino is only 1 bit. Wow I'm a new to this!
Drakker wrote:And this is not going to happen until I get my Gamebuinos... so late July at the earliest. Most likely in August.
Myndale wrote:
erico wrote:He probably took a detour down to brasil to deliver my package first Harko...I will tell him to hurry back to spain!
Myndale wrote:I just tested this and I'm able to do full-screen displays at around 300FPS. What I am noticing is that even at these extremely high frame rates I'm getting a small amount of flicker at certain rates and virtually none at others. 3ms is significantly above the persistence of the liquid crystal, so what appears to be happening is that the display updates are aliasing with the 5110 refresh circuitry. Clamping the refresh rate to a more sane value should fix it but I'll have to check the LCD's datasheet to determine what the ideal rate should be.
Sadly, my tests seem to indicate that flicker-free 4-color grey-scale isn't going to be possible...the 5110 update circuitry just isn't fast enough to support it
So in summary: full-screen 3-color grey-scale will be possible, and with sufficiently optimized code you'll have plenty of cycles to space.
Here's my test code for anyone that wants to confirm my findings:
- Code: Select all
#define PIN_SCE A1
#define PIN_RESET A0
#define PIN_DC A2
#define PIN_SDIN 11
#define PIN_SCLK 13
#define PORT_SCLK PORTB
#define SCLK_BIT 5
#define PORT_SDIN PORTB
#define SDIN_BIT 3
#define LCD_C LOW
#define LCD_D HIGH
#define LCD_X 84
#define LCD_Y 48
void LcdInitialise(void)
{
pinMode(PIN_SCE, OUTPUT);
pinMode(PIN_RESET, OUTPUT);
pinMode(PIN_DC, OUTPUT);
pinMode(PIN_SDIN, OUTPUT);
pinMode(PIN_SCLK, OUTPUT);
digitalWrite(PIN_RESET, LOW);
digitalWrite(PIN_RESET, HIGH);
LcdWrite(LCD_C, 0x21 ); // LCD Extended Commands.
LcdWrite(LCD_C, 0xB9 ); // Set LCD Vop (Contrast).
LcdWrite(LCD_C, 0x04 ); // Set Temp coefficent. //0x04
LcdWrite(LCD_C, 0x14 ); // LCD bias mode 1:48. //0x13
LcdWrite(LCD_C, 0x0C ); // LCD in normal mode.
LcdWrite(LCD_C, 0x20 );
LcdWrite(LCD_C, 0x0C );
}
void LcdClear(void)
{
for (int index = 0; index < LCD_X * LCD_Y / 8; index++)
{
LcdWrite(LCD_D, 0x00);
}
}
void LcdWrite(byte dc, byte data)
{
digitalWrite(PIN_DC, dc);
digitalWrite(PIN_SCE, LOW);
shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);
digitalWrite(PIN_SCE, HIGH);
}
void gotoXY(int x, int y)
{
LcdWrite( 0, 0x80 | x); // Column.
LcdWrite( 0, 0x40 | y); // Row.
}
void setup(void)
{
LcdInitialise();
LcdClear();
Serial.begin(9600);
pinMode(PIN_SDIN, OUTPUT);
pinMode(PIN_SCLK, OUTPUT);
}
#define bitOut(val, bit) \
if (val & (1 << bit)) \
PORT_SDIN |= _BV(SDIN_BIT); \
else \
PORT_SDIN &= ~_BV(SDIN_BIT); \
PORT_SCLK |= _BV(SCLK_BIT); \
PORT_SCLK &= ~_BV(SCLK_BIT);
void byteOut(uint8_t val)
{
bitOut(val, 0);
bitOut(val, 1);
bitOut(val, 2);
bitOut(val, 3);
bitOut(val, 4);
bitOut(val, 5);
bitOut(val, 6);
bitOut(val, 7);
}
void loop(void)
{
for (int i=0; i<135; i++)
{
gotoXY(0,0);
for (int i=0; i<42; i++)
{
digitalWrite(PIN_DC, LCD_D);
digitalWrite(PIN_SCE, LOW);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
digitalWrite(PIN_SCE, HIGH);
}
// 1
gotoXY(0,0);
for (int i=0; i<42; i++)
{
digitalWrite(PIN_DC, LCD_D);
digitalWrite(PIN_SCE, LOW);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
byteOut(0xaa);
byteOut(0x55);
digitalWrite(PIN_SCE, HIGH);
}
}
Serial.println("This string causes the TX pin to flash so I can see how long that took.");
}
Return to Software Development
Users browsing this forum: No registered users and 123 guests