spidev communication problems

Post Reply
snowboy
Posts: 3
Joined: Tue Sep 23, 2014 8:30 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

spidev communication problems

Unread post by snowboy » Sat Oct 04, 2014 5:19 am

Trying to get spidev (and MFRC522 rfid chip) working under Android, i'm able to establish a partial connection. Reading from slave seems to be working, but I can only read default register values. Changing/Writing dosent seem to be working. After write and read the values are same (default) values.

spidev_test (0.5Mhz) (Documents/spi/spidev_test.c) gives this result (second run)

Code: Select all

0D 00 00 00 00 00 
00 60 00 00 00 00 
95 FF FF FF FF FF 
FF FF FF FF FF FF 
FF FF FF FF FF FF 
FF DE AD BE EF BA 
AD F0
I believe this should be the result instead. I haven't played that much with spi :)

Code: Select all

                0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
                0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
                0xF0, 0x0D,
It seems that spidev_test misses some command read/writes?
One problem might be that slave is running low voltages @ 2.6v (spec min 2.5v), so that I can get MISO,MOSI,etc down to 1.8v. According to google and blog posts this seems to be working for others (with exynos spi)

Probably need to make proper level shifter, but wondering if I have missed something basic here? I'm not so familiar with SPI and stuff.

Using CM11, kernel 3.0.51 with spi-support compiled in and C driver using spi.h and ioctl. Driver is port from Python that was tested with this chip on other hardware.
/dev contains spidev1.0, spidev2.0 and spidev3.0.
Spidev1.0 seems to be J5 where I have MFRC522 chip connected.

User avatar
odroid
Site Admin
Posts: 32734
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 220 times
Been thanked: 369 times
Contact:

Re: spidev communication problems

Unread post by odroid » Sat Oct 04, 2014 4:38 pm

I think this problem seems to be related to the wrong voltage level.
Add the voltage shifter or translator first.

Or try lower frequency of SPI clock if possible.

Edison
Posts: 4
Joined: Thu Oct 06, 2016 5:22 am
languages_spoken: english
ODROIDs: Odroid C2, Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: spidev communication problems

Unread post by Edison » Mon Mar 27, 2017 11:38 pm

snowboy: Did you solved it? Because I have similar problem. I can read registers but writing has no effetct :( And SPI communication is ok (checked with oscilloscope)
Thanks
Jarek

User avatar
odroid
Site Admin
Posts: 32734
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 220 times
Been thanked: 369 times
Contact:

Re: spidev communication problems

Unread post by odroid » Tue Mar 28, 2017 5:22 am

This is U3 sub-forum.
Please post your question on a correct sub-forum.

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 2 guests