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 192x64 HW SPI still use default SPI CS pin #502

Open
zbx-sadman opened this issue Dec 9, 2019 · 1 comment
Open

ST7920 192x64 HW SPI still use default SPI CS pin #502

zbx-sadman opened this issue Dec 9, 2019 · 1 comment

Comments

@zbx-sadman
Copy link

Hello

I use Timer1 PWM on ATMega328P with ST7920 192x64 display (HW SPI mode) and found that any SPI activity cancel PWM generation on D10 (SPI's SS-pin) even it's redirected to other pin.

SW SPI mode works correctly

I think that driver still use default SPI CS pin inside

#include <U8glib.h>

const uint8_t displayCS = 8;

// HW SPI w/ non-default CS - OK
U8GLIB_ST7920_128X64_1X display(13, 11, displayCS);

// HW SPI w/ non-default CS - fail
//U8GLIB_ST7920_128X64_1X display(displayCS);

void setup() {
  Serial.begin(9600);

  display.setFont(u8g_font_profont11);
  display.setRot180();
  
  // Turn on PWM on Timer #1, channels A & B
  analogWrite(9, 192);
  analogWrite(10, 64);
  Serial.println("Both PWM channels works now");
  delay(5000);
  // Send something to LCD
  display.firstPage();
  do {
    display.drawStr( 0, 20, "I'll broke pin 10");
  } while ( display.nextPage() );
  // That's all, folks!
  Serial.println("Timer #1 channel B dropped");
}

void loop() {}

@zbx-sadman
Copy link
Author

zbx-sadman commented Dec 10, 2019

U8g2 is works correctly. i'll migrate...

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

No branches or pull requests

1 participant