nopnop2002/Arduino-LoRa-Ra01S

Migration to Attiny

Closed this issue · 5 comments

Hi,
I can run your code on ESP32 successfully. But I want to use this library with Attiny84 to build low cost LORA sensor. Is it hard to do? I have little knowledge on this low level programming.
As far as I know, attiny84 required tinySPI or softSPI.

I try to compile your code on Attiny84. its size is too big

Sketch uses 7066 bytes (86%) of program storage space. Maximum is 8192 bytes.
Global variables use 692 bytes (135%) of dynamic memory, leaving -180 bytes for local variables. Maximum is 512 bytes.

Thanks;

ATTINY has too little RAM to migrate.

Ok, it looks promising. After I removed all Serial.print from the your library, it's compiled successfully. Now, I have to figure out how to map the SPI pins.

Sketch uses 4610 bytes (56%) of program storage space. Maximum is 8192 bytes.
Global variables use 48 bytes (9%) of dynamic memory, leaving 464 bytes for local variables. Maximum is 512 bytes.

Good!!

These may be available.
https://github.com/JChristensen/tinySPI
https://github.com/nickgammon/bitBangedSPI


If it works correctly with ATTiny, please publish it on github.
ATTiny+LoRa is very convenient.

Actually, AttinyCore already include its own virtual SPI handling so I don't need to use tinySPI anymore, I simply use SPI library of Arduino. However, I can't get it to work on attiny84, after several tries my Attiny84 are gone, I am waiting for new ones.
In the mean time, I try to make it work on Atmega328 first because it's easy to debug than attiny84 but I faced some issue, which I raise on another issue.

Hi, I decided to use Atmega16 instead because Attiny84 is already double the price of Atmega16a.
And I managed to make it works with atmega16a.

Thanks;