Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST7920 parallel mode (8080 / 6800) not working #90

Closed
viti95 opened this issue Nov 20, 2016 · 8 comments
Closed

ST7920 parallel mode (8080 / 6800) not working #90

viti95 opened this issue Nov 20, 2016 · 8 comments
Milestone

Comments

@viti95
Copy link

viti95 commented Nov 20, 2016

I've made a straight port of a benchmark I wrote with U8Glib, and while it works perfectly in HW / SW SPI modes, it doesn't in any of the two parallel modes. I've tested all the possible combinations on the constructor (enable, cs, ds) to see if it was my mistake, but none of them work (I found the description of the parameters in the new constructor really confusing). These are the initializations i'm using:

U8GLIB_ST7920_128X64_4X u8g(52, 51, 10); -> Working
U8GLIB_ST7920_128X64_4X u8g(10); -> Working
U8GLIB_ST7920_128X64_4X u8g(37, 35, 33, 31, 29, 27, 25, 23, 52, 10, 51); -> Working

U8G2_ST7920_128X64_2_SW_SPI u8g2(U8G2_R2, 52, 51, 10); -> Working
U8G2_ST7920_128X64_2_HW_SPI u8g2(U8G2_R2, 10); -> Working
U8G2_ST7920_128X64_2_8080 u8g2(U8G2_R2, 37, 35, 33, 31, 29, 27, 25, 23, 52, 10, 51); -> NOT working
U8G2_ST7920_128X64_2_6800 u8g2(U8G2_R2, 37, 35, 33, 31, 29, 27, 25, 23, 52, 10, 51); -> NOT working

The U8G2 version is 2.6.3, and the device is an Arduino Mega 2560

PS. Please forgive my English

@olikraus olikraus added the bug label Nov 22, 2016
@olikraus olikraus added this to the 2.7 milestone Nov 22, 2016
@olikraus
Copy link
Owner

hmmm... i have to check this....

@olikraus
Copy link
Owner

olikraus commented Nov 25, 2016

it is working, however you have to set the R/W input of the display to 0. Additionally there is no CS in parallel mode of the ST7920, so in the constructor CS has to be set to U8X8_PIN_NONE.

For me, this works fine:

U8G2_ST7920_128X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18 /* A4 */, /*cs=*/ U8X8_PIN_NONE, /*dc/rs=*/ 17 /* A3 */, /*reset=*/ 15 /* A1 */);	// Set R/W to 0, 

@olikraus
Copy link
Owner

@viti95
Copy link
Author

viti95 commented Nov 26, 2016

Tested and working!!!! Thanks for the great work!!!!
img_20161126_163847

@olikraus
Copy link
Owner

Very nice. Thanks for sharing.

@kivikakk
Copy link

kivikakk commented Jan 1, 2018

Thank you so much for this thread! It helped me get my ST7920 working in parallel mode as well, which is so much faster than SPI. 😊

@kivikakk
Copy link

kivikakk commented Jan 1, 2018

Note to anyone else following: don't just change u8x8_byte_4wire_sw_spi to u8x8_byte_8bit_8080mode, you need to change u8g2_Setup_st7920_s_128x64_f to u8g2_Setup_st792_p_128x64_f too! I was reading u8x8_byte.c wondering how just swapping one function out could cause it to operate in parallel mode, and apparently I was right for wondering, there was definitely more to it than that!

@olikraus
Copy link
Owner

olikraus commented Jan 1, 2018

Correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants