Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SPI at at91fr40162
PostPosted: Thu Feb 03, 2005 5:37 pm 
Offline

Joined: Wed Jul 21, 2004 6:55 pm
Posts: 8
Location: Brasil
Is ir possiple to use a SPI device with AT91FR40162? How can I interface them?

Thanks
Cremasco


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 04, 2005 10:07 pm 
Offline

Joined: Mon Nov 08, 2004 4:39 pm
Posts: 120
Location: Raleigh, NC
Cremasco,

http://www.atmel.com/dyn/products/param ... ection=ASC

That part does not have a hardware SPI.

To implement SPI you would need to use software SPI with some GPIO. There are a number of sources for examples, though most are for the 8 bit world. Might consider looking at avrfreaks.org for their software SPI examples.


Top
 Profile  
 
 Post subject: SPI at 5Mhz
PostPosted: Sun Feb 27, 2005 12:52 pm 
Offline

Joined: Tue Mar 16, 2004 2:03 pm
Posts: 29
Location: Belgium
Hi, I had the same problem....I wrote a software SPI driver which uses no timers. It runs at 5Mhz (thats the fastest I could produse) on my AT91FR40162 at 66MHz, compiled with GreenHills Multi.
If you're interested, I can post my code.
Greetings,
Jeroen


Top
 Profile  
 
 Post subject: interested
PostPosted: Mon Feb 28, 2005 9:05 pm 
Offline

Joined: Wed Jul 21, 2004 6:55 pm
Posts: 8
Location: Brasil
i am interested.
can you send me an e-mail with your code?
vitorbra@yahoo.com

Thanks
Cremasco.


Top
 Profile  
 
 Post subject: SPI code
PostPosted: Mon Feb 28, 2005 10:00 pm 
Offline

Joined: Tue Mar 16, 2004 2:03 pm
Posts: 29
Location: Belgium
Hi,

Please find attached my code.....

The code can handle all 4 spi modes. Currently there is a write and write/read function. The read only function is not implemented (yet).
The data width is currently maximum 32bits (a unsigned32), I thing enough for most devices...

the code worked already on different spi devices...

I used following pins:
Clock : PIO__P16
Data In: PIO__P17
Data out: PIO__P18

For the chip select we used some hardware to handle this which was connected to the data/address bus, so this is the only thing you must change.
Change this in the define : #define SET_CS(_number)

I use GreenHills Multi, compiled with this I get 5MHz!!! which is fast for software SPI...I compiled with the space optimize (not the speed), looking at the generated assembler, this was the best result. The c-code is optimized with defines!

If you should have any questions, don't hesitate to contact me.

PS : whats the weather there? I once went to Sao Paolo for the Ford/Renault...

Greetings,

Jeroen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


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: