spidev communication problems

Moderators: mdrjr, odroid

spidev communication problems

Unread postby 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.
snowboy
 
Posts: 3
Joined: Tue Sep 23, 2014 8:30 pm
languages_spoken: english

Re: spidev communication problems

Unread postby 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.
User avatar
odroid
Site Admin
 
Posts: 25323
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: spidev communication problems

Unread postby 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
Edison
 
Posts: 1
Joined: Thu Oct 06, 2016 5:22 am
languages_spoken: english
ODROIDs: Odroid C2, Odroid XU4

Re: spidev communication problems

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

This is U3 sub-forum.
Please post your question on a correct sub-forum.
User avatar
odroid
Site Admin
 
Posts: 25323
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 1 guest