Software SPI on ATmega1284P and ADXL362

Hello all, may I have a question please?

I have Arduino UNO*Pro which is based on ATmega1284P chip. When I try to use standard SPI library to access ADXL362 accelerometer, it does not work very well and bytes received look like they are missing last one, two or three bits. So when I write 0x11000011, I read back 0x1100010, values that I read are all even or dividible by 4, 8 etc..

I thought it could be problem with timing or wires that are about 4 inches long. So I have tried to divide SPI frequency by all dividers up to 128, did not help.

I would like to try slow bitbanging software SPI library, but unfortunately the only two I found, DigitalIO and softspi do not contain proper pin sections for my chip.

Any advice please? Thanks, Jan

My advice is to post your code. As suggested in the forum "sticky".

janbenes:
When I try to use standard SPI library to access ADXL362 accelerometer, it does not work very well and bytes received look like they are missing last one, two or three bits.

You are probably using the wrong SPI mode.

http://gammon.com.au/spi