You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AnHardt 56c42b572c 3 ms speedup for ST7920 and delay for BOARD_3DRAG
and saving ~1k memory
by limiting the `#pragma GCC optimize (3)` optimisation to `ultralcd_st7920_u8glib_rrd.h`. These optimisation was and is not done for all the other displays, is the reason for the big additionally use of memory, because the complete 'ultralcd.cpp' and 'dogm_lcd_implementation.h' was optimised (sadly i did not observe a change in speed).

Unrolling the loop in `ST7920_SWSPI_SND_8BIT()`, what i expected the optimiser to do, by hand, saved some speed by eliminating the loop variable (i) compares and increases. Every CPU cycle in this loop costs at least 0.5ms per display update because it's executed more than 1k times/s.

The delays are now pre-filled with the calculated values for 4.5V driven ST7920.
A way to simply add __your__ timing into the configuration was made.

At 4.5V
1.) The CLK signal needs to be at least 200ns high and 200ns low.
2.) The DAT pin needs to be set at least 40ns before CLK goes high and must stay at this value until 40ns after CLK went high.

A nop takes one processor cycle.
For 16MHz one nop lasts 62.5ns.
For 20MHz one not lasts 50ns.

To fulfill condition 1.) we need 200/62.5 = 3.2 => 4 cycles (200/50 = 4 => 4). For the low phase, setting the pin takes much longer. For the high phase we (theoretically) have to throw in 2 nops, because changing the CLK takes only 2 cycles.

Condition 2.) is always fulfilled because the processor needs two cycles (100 - 125ns) for switching the CLK pin.


Needs tests and feedback.
Especially i cant test 20MHz, 3DRAG and displays supplied wit less than 5V.
Are the delays right? Please experiment with longer or shorter delays. And give feedback.

Already tested are 5 displays with 4.9V - 5.1V at 16MHz where no delays are needed.
9 years ago
..
example_configurations SERVO_DEACTIVATION_DELAY => SERVO_DELAY 9 years ago
fonts Rename README file for fonts 9 years ago
Conditionals.h Define Z_SAFE_HOMING point when Z_PROBE_SLED is activated alone 9 years ago
Configuration.h SERVO_DEACTIVATION_DELAY => SERVO_DELAY 9 years ago
Configuration_adv.h Fix comments on EXPERIMENTAL_I2CBUS 9 years ago
M100_Free_Mem_Chk.cpp Remove redundant declarations from M100 code 9 years ago
Makefile Merge pull request #3224 from yarda/fix-melzi2-arduino-1.6.x 9 years ago
Marlin.h Tweak some feedrate vars 9 years ago
Marlin.ino Update U8glib URL 9 years ago
MarlinSerial.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
MarlinSerial.h Enclose all #error strings with apostrophes 9 years ago
Marlin_main.cpp Merge pull request #4147 from thinkyhead/rc_fix_M48_raise 9 years ago
SanityCheck.h SERVO_DEACTIVATION_DELAY => SERVO_DELAY 9 years ago
Sd2Card.cpp Enclose all #error strings with apostrophes 9 years ago
Sd2Card.h Converted all files on src to Unix file format 9 years ago
Sd2PinMap.h Enclose all #error strings with apostrophes 9 years ago
SdBaseFile.cpp 8.3-filenames second try 9 years ago
SdBaseFile.h Further cleanup of comments, partial Doxygen-style 9 years ago
SdFatConfig.h Further cleanup of comments, partial Doxygen-style 9 years ago
SdFatStructs.h Further cleanup of comments, partial Doxygen-style 9 years ago
SdFatUtil.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
SdFatUtil.h Converted all files on src to Unix file format 9 years ago
SdFile.cpp Converted all files on src to Unix file format 9 years ago
SdFile.h Further cleanup of comments, partial Doxygen-style 9 years ago
SdInfo.h Converted all files on src to Unix file format 9 years ago
SdVolume.cpp Converted all files on src to Unix file format 9 years ago
SdVolume.h Further cleanup of comments, partial Doxygen-style 9 years ago
Version.h Updated all example configuration files 9 years ago
blinkm.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
blinkm.h Further cleanup of comments, partial Doxygen-style 9 years ago
boards.h Cartesio UI Support 9 years ago
buzzer.h Heal the watchgog 9 years ago
cardreader.cpp Add an SD Card stop function, use in ultralcd 9 years ago
cardreader.h Add an SD Card stop function, use in ultralcd 9 years ago
circularqueue.h Non-blocking buzzer 9 years ago
configuration_store.cpp Tweak some feedrate vars 9 years ago
configuration_store.h Further cleanup of comments, partial Doxygen-style 9 years ago
dac_mcp4728.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
dac_mcp4728.h Further cleanup of comments, partial Doxygen-style 9 years ago
digipot_mcp4451.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_bitmaps.h SINGLENOZZLE: EXTRUDERS versus HOTENDS 9 years ago
dogm_custom_bitmaps.h Custom Splash Screen 9 years ago
dogm_font_data_6x9_marlin.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_font_data_HD44780_C.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_font_data_HD44780_J.h Update Kana font 9 years ago
dogm_font_data_HD44780_W.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_font_data_ISO10646_1.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_font_data_ISO10646_5_Cyrillic.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_font_data_ISO10646_CN.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_font_data_ISO10646_Kana.h Update Kana font 9 years ago
dogm_font_data_Marlin_symbols.h Further cleanup of comments, partial Doxygen-style 9 years ago
dogm_lcd_implementation.h Fixes somes compiler warnings 9 years ago
endstops.cpp This fix is not DELTA compatible 9 years ago
endstops.h Drop FORCE_INLINE from endstops.h 9 years ago
fastio.h Enclose all #error strings with apostrophes 9 years ago
language.h Output a message for SD read errors 9 years ago
language_an.h Cosmetic changes for language files 9 years ago
language_bg.h Cosmetic changes for language files 9 years ago
language_ca.h Cosmetic changes for language files 9 years ago
language_cn.h Cosmetic changes for language files 9 years ago
language_cz.h Cosmetic changes for language files 9 years ago
language_da.h Cosmetic changes for language files 9 years ago
language_de.h Cosmetic changes for language files 9 years ago
language_en.h XYZ unhomed 9 years ago
language_es.h Cosmetic changes for language files 9 years ago
language_eu.h Cosmetic changes for language files 9 years ago
language_fi.h Cosmetic changes for language files 9 years ago
language_fr.h Cosmetic changes for language files 9 years ago
language_gl.h Cosmetic changes for language files 9 years ago
language_hr.h Tweak Croatian language file heading 9 years ago
language_it.h Cosmetic changes for language files 9 years ago
language_kana.h Cosmetic changes for language files 9 years ago
language_kana_utf8.h Cosmetic changes for language files 9 years ago
language_nl.h Cosmetic changes for language files 9 years ago
language_pl.h Update language_pl.h 9 years ago
language_pt-br.h Cosmetic changes for language files 9 years ago
language_pt-br_utf8.h Cosmetic changes for language files 9 years ago
language_pt.h Cosmetic changes for language files 9 years ago
language_pt_utf8.h Cosmetic changes for language files 9 years ago
language_ru.h Cosmetic changes for language files 9 years ago
language_test.h Fix minor spelling in comments 9 years ago
macros.h Automatically set X2 stepper pins 9 years ago
mesh_bed_leveling.cpp Use memset in mbl.reset to save 58 bytes 9 years ago
mesh_bed_leveling.h MBL: cel => cell 9 years ago
pins.h Cartesio UI Support 9 years ago
pins_3DRAG.h Updated multiple pins files 9 years ago
pins_5DPRINT.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_99.h Cleanup pins files, fixup analogtodigitalpin, etc. 9 years ago
pins_A4JP.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_AZTEEG_X1.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_AZTEEG_X3.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_AZTEEG_X3_PRO.h Use #undef in AZTEEG_X3_PRO for RAMPS overrides 9 years ago
pins_BAM_DICE_DUE.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_BQ_ZUM_MEGA_3D.h Fix BQ_LCD_SMART_CONTROLLER pin compiler warnings 9 years ago
pins_BRAINWAVE.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_BRAINWAVE_PRO.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_CHEAPTRONIC.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_CNCONTROLS_12.h FILRUNOUT => FIL_RUNOUT 9 years ago
pins_ELEFU_3.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_FELIX2.h Drop DISABLE_M(IN|AX)_ENDSTOPS, replace with individual endstop flags 9 years ago
pins_GEN3_MONOLITHIC.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_GEN3_PLUS.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_GEN6.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_GEN6_DELUXE.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_GEN7_12.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_GEN7_13.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_GEN7_14.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_GEN7_CUSTOM.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_K8200.h Updated multiple pins files 9 years ago
pins_LEAPFROG.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_MEGACONTROLLER.h SINGLENOZZLE: EXTRUDERS versus HOTENDS 9 years ago
pins_MEGATRONICS.h Non-blocking buzzer 9 years ago
pins_MEGATRONICS_2.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_MEGATRONICS_3.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_MELZI.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_MELZI_MAKR3D.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_MINIRAMBO.h Non-blocking buzzer 9 years ago
pins_MINITRONICS.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_MKS_13.h Support for MKS v1.3/1.4 and Sainsmart RAMPS 1.4 variants 9 years ago
pins_MKS_BASE.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_OMCA.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_OMCA_A.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_PRINTRBOARD.h Non-blocking buzzer 9 years ago
pins_PRINTRBOARD_REVF.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_RAMBO.h Non-blocking buzzer 9 years ago
pins_RAMPS_13.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_RAMPS_13_EFB.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_RAMPS_14.h FILRUNOUT => FIL_RUNOUT 9 years ago
pins_RAMPS_14_EFB.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_RAMPS_OLD.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_RIGIDBOARD.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_RUMBA.h SINGLENOZZLE: EXTRUDERS versus HOTENDS 9 years ago
pins_SAINSMART_2IN1.h Support for MKS v1.3/1.4 and Sainsmart RAMPS 1.4 variants 9 years ago
pins_SANGUINOLOLU_11.h Non-blocking buzzer 9 years ago
pins_SANGUINOLOLU_12.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_SAV_MKI.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_SETHI.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_STB_11.h Further cleanup of comments, partial Doxygen-style 9 years ago
pins_TEENSY2.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_TEENSYLU.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_ULTIMAIN_2.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_ULTIMAKER.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
pins_ULTIMAKER_OLD.h Merge pull request #3702 from thinkyhead/rc_sensitive_fan_pins 9 years ago
planner.cpp Fixes somes compiler warnings 9 years ago
planner.h Fix feedrate in gcode_T (max_feedrate is mm/s) 9 years ago
planner_bezier.cpp Update comments, rename next_ping_ms, followup to #3797 9 years ago
planner_bezier.h Add BEZIER_CURVE_SUPPORT (G5 XYZEFIJPQ) 9 years ago
printcounter.cpp Closes #3826: SD printing will now pause and stop the print counter 9 years ago
printcounter.h Followup for #3813 9 years ago
qr_solve.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
qr_solve.h Further cleanup of comments, partial Doxygen-style 9 years ago
servo.cpp SERVO_DEACTIVATION_DELAY => SERVO_DELAY 9 years ago
servo.h SERVO_DEACTIVATION_DELAY => SERVO_DELAY 9 years ago
speaker.h Non-blocking buzzer 9 years ago
speed_lookuptable.h Further cleanup of comments, partial Doxygen-style 9 years ago
stepper.cpp Merge pull request #4125 from jbrazio/bugfix/planner-warning 9 years ago
stepper.h make motor_current_setting static and constexpr 9 years ago
stepper_dac.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
stepper_dac.h Further cleanup of comments, partial Doxygen-style 9 years ago
stepper_indirection.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
stepper_indirection.h Automatically set X2 stepper pins 9 years ago
stopwatch.cpp Fixes #3809 and adds several improvements to the Stopwatch and 9 years ago
stopwatch.h Fixes #3809 and adds several improvements to the Stopwatch and 9 years ago
temperature.cpp Fixes somes compiler warnings 9 years ago
temperature.h Fix compile error with watch_bed_next_ms 9 years ago
thermistortables.h Cosmetic changes and small fix for thermistortables.h 9 years ago
twibus.cpp Shrink debug code in TWIBus and disable by default 9 years ago
twibus.h Shrink debug code in TWIBus and disable by default 9 years ago
ultralcd.cpp MBL: Add support for max z endstop 9 years ago
ultralcd.h Show bootscreen later 9 years ago
ultralcd_implementation_hitachi_HD44780.h Introduce save_delay() 9 years ago
ultralcd_st7920_u8glib_rrd.h 3 ms speedup for ST7920 and delay for BOARD_3DRAG 9 years ago
utf_mapper.h Tweaks to some verbiage 9 years ago
vector_3.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
vector_3.h Further cleanup of comments, partial Doxygen-style 9 years ago
watchdog.cpp Further cleanup of comments, partial Doxygen-style 9 years ago
watchdog.h Further cleanup of comments, partial Doxygen-style 9 years ago