yhfudev / u8glib-backup

Universal Graphics Library for 8 Bit Embedded Systems
Other
0 stars 0 forks source link

speedup st7920 #177

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In
http://code.google.com/p/u8glib/source/browse/csrc/u8g_com_atmega_st7920_spi.c
introduce new transfer algorithm for
case U8G_COM_MSG_WRITE_SEQ:

static void u8g_com_arduino_st7920_write_byte_seq(uint8_t rs, uint8_t *vals, 
uint8_t len)
{
  uint8_t i;

  if ( rs == 0 )
  {
    /* command */
    u8g_com_arduino_do_shift_out_msb_first(0x0f8);
  }
  else if ( rs == 1 )
  {
    /* data */
    u8g_com_arduino_do_shift_out_msb_first(0x0fa);
  }

  while( len-- )
  {
    u8g_com_arduino_do_shift_out_msb_first(*vals & 0x0f0);
    u8g_com_arduino_do_shift_out_msb_first(*vals << 4);
    vals++;
  }
  u8g_10MicroDelay();
}

Original issue reported on code.google.com by olikr...@gmail.com on 3 Jun 2013 at 5:32

GoogleCodeExporter commented 9 years ago

Original comment by olikr...@gmail.com on 3 Jun 2013 at 5:33

GoogleCodeExporter commented 9 years ago
hw and sw spi optimized

  U8GLIB_ST7920_192X32_1X -Os   SW SPI  FPS: Clip=11.0 Box=5.4  @=7.1 Pix=3.9   Size=11828
  U8GLIB_ST7920_192X32_1X -O3   SW SPI  FPS: Clip=10.9 Box=5.6  @=7.5 Pix=4.0   Size=13800
  U8GLIB_ST7920_192X32_1X -Os   SW SPI  FPS: Clip=19.7 Box=7.1  @=10.4 Pix=4.6  Size=11858  (new seq data output)

Original comment by olikr...@gmail.com on 3 Jun 2013 at 8:17

GoogleCodeExporter commented 9 years ago
latest measure
  U8GLIB_ST7920_192X32_1X -Os   SW SPI  FPS: Clip=11.0 Box=5.4  @=7.1 Pix=3.9   Size=11828
  U8GLIB_ST7920_192X32_1X -O3   SW SPI  FPS: Clip=10.9 Box=5.6  @=7.5 Pix=4.0   Size=13800
  U8GLIB_ST7920_192X32_1X -Os   SW SPI  FPS: Clip=16.8 Box=6.7  @=9.6 Pix=4.5   Size=11858  (new seq data output)
  U8GLIB_ST7920_192X32_1X -Os   HW SPI  FPS: Clip=25.7 Box=7.5  @=11.3 Pix=4.8  (new seq data output)

added a 10us delay after data byte transmission

Original comment by olikr...@gmail.com on 3 Jun 2013 at 8:29

GoogleCodeExporter commented 9 years ago
sw spi and hw spi tested --> ok

Original comment by olikr...@gmail.com on 3 Jun 2013 at 8:33

GoogleCodeExporter commented 9 years ago
additionally introduce st7920_custom com device for special speed ups
--> done

Original comment by olikr...@gmail.com on 4 Jun 2013 at 6:58

GoogleCodeExporter commented 9 years ago
this is implemented

Original comment by olikr...@gmail.com on 4 Jun 2013 at 8:14