watterott / ATmega328PB-Testing

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

Atmega328PB and RFM95W #46

Closed Lanzones closed 5 years ago

Lanzones commented 5 years ago

Hi, I have a lora GPS shield that works perfectly with the UNO with atmega328P. I have then developed a board with 328PB instead. I was able to load the bootloader and the sketch thru ISP. Recycled power and received an error on my terminal with the message below. I have tried the monitoring the SPI from micro to the RF module but it seems that there was no activity on all spi lines. I have recheck my lmic pin maps plenty of times and it has same pin assignment as my 328P development board with the lora gps shield. Just wondering if someone has already use this repo and compiled it with the lmic for lora modules. I might be missing something very simple.


LoRa GPS Example---- Connect to TTN FAILURE C:\Users\User\Documents\Arduino\libraries\arduino-lmic-master\src\lmic\radio.c:689


Please help..

awatterott commented 5 years ago

Do you use this board package for Arduino IDE? If yes, try the examples from the SPI library to check if it is working and if it is a software or hardware issue.

Lanzones commented 5 years ago

Sorry my mistake.. I probe once again the SPI pins to the RFM95W and I have attached the plots.. CS waveform should be acceptable I believe and the MISO only outputted a bit at the 2nd byte.. but still doesnt work though. The CLk by the way is around 5MHZ

I was thinking if the CPOL or LSBfirst/MSBfirst has been changed on the 328PB version of the chip that I dont know about. I have tried tried slowing down the comms to 1MHz but still doesnt work.

below 5V means micro side and 3.3V is the RFM95 lora module. ch3mosi_ch4cs ch3mosi_ch4cs ch3mosi_ch4miso ch3mosi_ch4miso ch3miso_ch4misomicro ch3miso_ch4misomicro ch3mosi_ch4clk ch3mosi_ch4clk

awatterott commented 5 years ago

So SPI is working. You can flash an ATmega328(P) program to the ATmega328PB to verify that the hardware is working, because the chips are compatible in this way. Further infos in the appnote Differences between ATmega328/P and ATmega328PB. I have closed the issue, because it has nothing to do with the boards package.