u8g2 icon indicating copy to clipboard operation
u8g2 copied to clipboard

Board with atmega328pb, pin d12(miso) is piloted by the U8G2 library

Open tistructor opened this issue 1 year ago • 3 comments

I made a custom board with atmega328pb and tried the graphics test sample file and it works properly. I noticed though that pin 12 (MISO) it is controlled by the U8G2 library because in my card I had used this pin to control a buzzer but it does not work properly indeed only by enabling the pin as output with the oscilloscope I detect impulses of less than 1V without me pilots this pin in any way. I tried not to use the U8G2 library and pin d12 works properly. Consequently the library enables the 12 MISO pin I believe with the SPI function even if the library does not need it.

Schermata a 2022-07-14 16-54-30

tistructor avatar Jul 14 '22 14:07 tistructor

Did you use HW SPI? If so, I assume there is an issue with either Arduino SPI implementation or Atmega328 controller. With SW SPI do you observe the same problem?

olikraus avatar Jul 14 '22 15:07 olikraus

I am using HW spi. I am reading the atmega328pb datasheet and in fact once the MISO pin is enabled if it is not used it becomes an input and cannot be used. I didn't know it was so. I believed that from some registers it was possible to disable the piloting of this pin by the SPI interface In other projects I think I was lucky not to use pin 12.

Now I try SPI software interface.

tistructor avatar Jul 14 '22 15:07 tistructor

SPI software mode works properly and my pin that controls the buzzer too.

I have to redo the Display board Azzzzzzz

Thanks

tistructor avatar Jul 14 '22 15:07 tistructor