While trying to get the mirf libs working for the attiny84, I notice the differences between attiny85 and attiny84..
All the attiny85 PB0-PB4 maps directly to Arduino digital pins and pinMode(), digitalWrite() will work whereas for the attiny84, the
PA4-PA7 maps counter clockwise to the Arduino Digital pins and the SPI was not working (obviously...)
From the Arduino-tiny core, pins_arduino.c have the following pin mappings..
MISO , PA5 , maps to D5
MOSI, PA6, maps to D4
SCK, PA4, maps to D6
SS, PA7, maps to D3
How do I fix this in the header files to get the correct mapping for Arduino ??
Currently, with the above code, the SCK, CSN & CE is working but the MOSI / MISO always shows 0xff and returns 0x00 when I decode it with a logic analyzer...
As for as my application/library goes, I just need to point to the function of the pins ( MISO/MOSI/SCK/SS ) instead of the physical pins, is this statement accurate ? ( The mapping was done between the tiny-core codes to the h/w itself )
If the USI-SPI codes works for the tiny85 but not for the tiny84, the most probable reason would be the pins was mapped incorrectly in the library/application during the SPI transfer in the library..
As for as my application/library goes, I just need to point to the function of the pins ( MISO/MOSI/SCK/SS ) instead of the physical pins, is this statement accurate ? ( The mapping was done between the tiny-core codes to the h/w itself )
If the USI-SPI codes works for the tiny85 but not for the tiny84, the most probable reason would be the pins was mapped incorrectly in the library/application during the SPI transfer in the library..
If the library does things like "pinMode(SS,OUTPUT)" then you have to find a working value for "SS".
I managed to solve the issue, somehow the PA4-PA7 did not match correctly to the Arduino Digital pins.. and I have no idea where were those PA4-PA7 defined for the attiny84
I had to hard code them to make the USI-SPI working for the attiny84...
I was under the impression that for my programs / libraries or headers, once I defined the correct pin name as below, it would be automatically mapped to the correct pins when Arduino compiles for the attiny84 cores ...
or shd i just ignore the h/w pin names and directly use the Arduino digital pin instead...