watterott / ATmega328PB-Testing

Atmel/Microchip ATmega328PB support for Arduino IDE
https://learn.watterott.com
76 stars 61 forks source link

spi not working #18

Closed goldkwang closed 7 years ago

goldkwang commented 7 years ago

arduino uno (Atmega328P) -> spi working Atmega328PB - spi not working

i test nrf8001 bluetooth module (spi)

awatterott commented 7 years ago

The m328PB has two SPI ports (libraries SPI.h and SPI1.h). Have you checked the signals with an oscilloscope or logic analyzer?

goldkwang commented 7 years ago

I checked the signal using oscilloscope. SPI & SPI1 signal is not displayed. ( use watterott ) So I edit the arduino uno source and download hex to Atmega328PB -> good working

My development environment : Atmega328PB, 16MHz, 5V SPI Connect -> nRF8001 Bluetooth Module Atmel Studio7 (7.0.1417) Arduino IDE 1.8.3 AVRJTACICE MKII & AVRISP MKII

awatterott commented 7 years ago

What do you mean with "SPI & SPI1 signal is not displayed"? Do you use the Arduino IDE or Atmel Studio?

goldkwang commented 7 years ago

i mean it's not displayed at oscilloscope. Source Compile -> Arduino IDE Firmware Download -> Atmel Studio

awatterott commented 7 years ago

Have you tried a basic blink program to verify that the building/compiling is working? I have updated the SPI libs so that the SPI and SPI1 code is now the same (except registers).

goldkwang commented 7 years ago

Arduino basic blink Example -> Good Working PortE Blink & PortE Input Button -> Good Working

Current state changed communication (SPI -> UART) UART0, UART1, PortE Input, PortE Output , Analog Input (A0) -> Good Working I did not test the SPI by removing the SPI module from the circuit.

awatterott commented 7 years ago

Have you tried the new BSP with updated SPI libs?

awatterott commented 7 years ago

Closing because of inactivity.