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

Is it possible to use spi2 hw on atmega328pb? #496

Open
tistructor opened this issue Aug 23, 2019 · 5 comments
Open

Is it possible to use spi2 hw on atmega328pb? #496

tistructor opened this issue Aug 23, 2019 · 5 comments

Comments

@tistructor
Copy link

I'm using an atmega328pb with arduino and I would like to use the spi2 to control an oled ssd1309 display, is it possible? or should I use the display in sw?
thank you

@olikraus
Copy link
Owner

There is only one SPI available on your uC. You can use SW SPI or you can share the one HW SPI with other devices.

@tistructor
Copy link
Author

atmega328pb has 2 spi, 2 i2c, 2 uart

@tistructor
Copy link
Author

for the device I am building I cannot use the normal spi0 pins (10,11,12,13) we must use spi1 (19, 22, 23, 24) for problems of use of the pwm.
I took a look at your library and I think you log in directly if you have registers not using the standard arduino spi library.
I think it is enough to replace the names with the spi registers.
If all the spi configuration is in the "u8g_com_atmega_hw_spi.c", "u8g_com_arduino_hw_spi.c" files it shouldn't be too difficult, I could try.
Or I have to change my hardware and add chips.

@olikraus
Copy link
Owner

Oh, this my old lib, yes, you could update the code...

@tistructor
Copy link
Author

thank you,
I evaluate what is best to do.

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

2 participants