go away spammer

Author Topic: SPI on Axon?  (Read 4368 times)

0 Members and 1 Guest are viewing this topic.

Offline mihiesTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 1
SPI on Axon?
« on: November 19, 2008, 01:00:51 PM »
Does Axon actually support SPI protocol? AFAIK it is very similar to I2C and in the Axon feature list it is stated "SPI, I2C".

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: SPI on Axon?
« Reply #1 on: November 20, 2008, 03:46:02 AM »
yes, check the MCU's specs.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline mihiesTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 1
Re: SPI on Axon?
« Reply #2 on: November 20, 2008, 04:23:15 AM »
yes, check the MCU's specs.

Yes, I did. However, I don't see any SPI reference on the Axon board nor software library support.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: SPI on Axon?
« Reply #3 on: November 20, 2008, 08:01:14 AM »
I haven't written or verified any user friendly SPI code, but you can find some code in AVRlib:
http://hubbard.engr.scu.edu/avr/avrlib/docs/html/index.html

Click on File List and then scroll down to see the spi files. The files are also included in the latest beta - but I haven't tested them yet. Its in my really long list of features to add to the Axon.

Offline mihiesTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 1
Re: SPI on Axon?
« Reply #4 on: November 20, 2008, 09:34:47 AM »
I haven't written or verified any user friendly SPI code, but you can find some code in AVRlib:
http://hubbard.engr.scu.edu/avr/avrlib/docs/html/index.html

Click on File List and then scroll down to see the spi files. The files are also included in the latest beta - but I haven't tested them yet. Its in my really long list of features to add to the Axon.

I see. What about hardware - does one connect SPI bus device onto I2C bus directly?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: SPI on Axon?
« Reply #5 on: November 20, 2008, 11:01:57 AM »
I did a quick google search for an SPI tutorial, and the first half of this page explains the bare basics:
http://www.arduino.cc/en/Tutorial/SPIEEPROM

I'm sure someone here can point us to something better! (hint hint)
« Last Edit: November 21, 2008, 12:10:12 AM by Admin »

Offline mihiesTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Helpful? 1
Re: SPI on Axon?
« Reply #6 on: November 20, 2008, 01:05:03 PM »
Hi,

Sorry for being persistent but the answer still eludes me. Are there all 4 lines required for SPI out there? I did look at schematic but I can't find SS. I also saw that you've mentioned at the beginning of production that you didn't wire the SS pin. So, is it there now?

Thanks,

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: SPI on Axon?
« Reply #7 on: November 20, 2008, 04:36:22 PM »
the SS pin on a SPI device is the "Slave Select" pin.
you can use any IO pin on the Axon to connect to your SPI device's SS pin.
simply enable that IO pin to enable your SPI device's SPI interface.

this way multiple SPI device's can be connected to the same SPI bus.
each needs a different IO pin on the Axon.

as for which pins to use on the Axon for MOSI, MISO and SCLK, you'll need to check the ATmega640 data sheet then compare it to the Axon data sheet to work out which pins you want on the Axon.

using the SPI interface on the Axon will  be exactly the same as any other AVR based board.


dunk.

Offline sprince09

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: SPI on Axon?
« Reply #8 on: March 02, 2009, 08:29:02 AM »
Any update on SPI capabilities for the Axon? I've been looking through / testing the "spi.c" and "spi.h" included in the latest source code update, but my programs always hang when I run spiInit(). I noticed on the Axon datasheet that the SPI pins are the same as those used by the hardware programmer (in my case AVRISP2)... would using the programmer cause problems with the SPI interface?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: SPI on Axon?
« Reply #9 on: March 15, 2009, 12:40:30 AM »
Hey spince09, appears you answered this thread here:
http://www.societyofrobots.com/robotforum/index.php?topic=7231.0

(sorry, but I never got around to fixing up SPI)

 


Get Your Ad Here