High speed OLED using the Xprotolab

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Project Background:
A few years ago, I made a POV type 3D display using a 5x5 array of 5mm LED's. The 5x5 LED array PCB mechanically oscillates to create the display. It can be thought of as very similar to a mechanical LED cube.
Here is the project:
http://webspace.webring.com/people/xm/matt6ft9/3d_led_index.html

Next Generation:
The obvious next step to the project seemed to be using an OLED display instead of the 5x5 LED matrix. The OLED has to update quickly. The xprotolab (I know Gabriel is frequent poster on this forum) seems like a good fit: quick ATXMEGA32U4, 128x64 OLED, and on a small board. I have hardware version 1.4 of xprotolab, which is good because it loads the data in parallel to the OLED. (the latest version of the hardware is 1.8 ) The OLED on this board uses the SSD1306 controller.

Using the Gabotronics modified source code, I added in this small section of code to update the OLED when the photo interrupter is triggered:

	PORTC.DIR=((0<<4)|(1<<3)|(1<<2)|(1<<1));	//set pin 4 as an input
	PORTC.PIN4CTRL  = 0x13; // Pull up on pin PC4
	for(;;)
	{
		if( !testbit(PORTA.IN,4) ||  testbit(PORTC.IN,0))	//is the button pressed or has the photo interrupter been triggered?
		{
			u08CycleScreen=1;	//It is time to start displaying the 5 images
	        lcd_goto(0,0);	//is this needed?
		}
		if(u08ClearScreen==0)	//is it time to display an image?
		{

			if(u08CycleScreen==2)
			{
				GLCD_DisplayPicture(square_a);
			}
			if(u08CycleScreen==3)
			{
				GLCD_DisplayPicture(square_b);
			}
			if(u08CycleScreen==4)
			{
				GLCD_DisplayPicture(square_c);
			}
			if(u08CycleScreen==5)
			{
				GLCD_DisplayPicture(square_d);
			}
			if(u08CycleScreen==6)
			{
				GLCD_DisplayPicture(square_e);
			}
			if(u08CycleScreen<7)
			{
				u08CycleScreen++;	//Advance to the next image when we are in here next
				u08ClearScreen=1;	//flag to clear the display, after a short delay
    			show_display();	//show the image on the OLED
				_delay_ms(2);	//a short delay so the user can see the image
			}
		}
		else	//it must be time to clear the display
		{
			PORTC.OUT |= (1<<1);	//test, take the test pin high
	        clr_display();		//clear the O-LED display buffer
			show_display();		//send the display buffer to the O-LED
			PORTC.OUT &= ~(1<<1);	//test, take the test pin low
			_delay_ms(10);		//give the OLED some black time
			u08ClearScreen=0;	//next time through, we need to display an image on the OLED
		}
}

I can set the inline delays to 1/2 of a second to very the code is displaying the small images correctly. (it is) When the board is mechanically oscillating at 10Hz, I'm trying to have 5 images (small squares) display. But, I'm getting very inconsistent visual results on the OLED. If there are any pointers/things to try, I would appreciate the feedback.
Matt

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd definitely use a timer interrupt to transmit the images at a constant interval, rather than relying on inline delays and code lag to do the timing.

You're absolutely right. This member is stupid. Please help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One disadvantage of using this particular OLED: Although it is very fast, it does not provide you with a frame rate sync signal, so you might have tearing issues when doing persistence of vision. This is unfortunate because the SSD1306 does have this signal, but it is not routed out on the OLED's connector.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice Post. I really love to see your OLED. Can you please share some picture of OLED based display. Is image quality is fine? and Is it work in sunlight?