[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4694: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4695: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4696: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
8devices Community - View topic - Carambola + slow SPI
www.8devices.com
View unanswered posts | View active topics It is currently 29 Apr 2024, 07:45



Reply to topic  [ 7 posts ] 
 Carambola + slow SPI 
Author Message

Joined: 05 Apr 2012, 10:23
Posts: 25
Location: Lithuania
Hi,

I would like to read data from slave SPI device, which is based on slow microcontroller, with maximum 250 kHz clock. I've managed to configure SPI interface at ~5 MHz clock or so, but spidev driver refuses to configure at low speed. As far as I've dig into driver, it checks for limit F_CPU / 128, which would be 320 MHz / 128 = 2.5 MHz. Is it possible to configure some kind of hardware pre-scaler for that, or maybe I should use some kind of bit banging SPI driver for such application?

j


06 Apr 2012, 05:50
Profile WWW

Joined: 08 Dec 2011, 09:35
Posts: 138
I have not tried it yet, but if you tell more details (working code / register dump if you are using mmio to test it manual way) it would be clearer.


07 Apr 2012, 08:53
Profile

Joined: 05 Apr 2012, 10:23
Posts: 25
Location: Lithuania
Actually I'm using spidev_test utility from kernel source. My question would be if it's possible to configure SPI device below 2.5 MHz clock.

I've found similar device datasheet:
http://www.tracermcc.ru/foto/bender/RT3 ... 8_0902.pdf

SPICFG register, SPICLK bits, recifies SPI clock divide control, which minimum value is: rate / 128. So given the fact that system clock is 320 MHz, it isn't possible to achieve less than 2.5 MHz ?


10 Apr 2012, 05:44
Profile WWW

Joined: 07 Dec 2011, 16:01
Posts: 525
Location: Lithuania
try to use software SPI for slow modes


10 Apr 2012, 11:02
Profile

Joined: 04 May 2012, 08:55
Posts: 61
System clock is 1/3 of the CPU CLK

320Mhz / 3 /128 = 833 kHz is the lowest speed on the hardware SPI


04 May 2012, 09:01
Profile

Joined: 05 Apr 2012, 10:23
Posts: 25
Location: Lithuania


04 May 2012, 10:32
Profile WWW

Joined: 04 May 2012, 08:55
Posts: 61
thx jedas for this useful hint :-)


04 May 2012, 13:14
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.