Serial Peripheral Interface SPI library for atmel

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi dears.

i want to use spi in my project . 

anyone have spi library for atmel studio and its use help?

anyone have a simple project codes about using spi ?i wanna understand its work.

thank you

Aasshh

Last Edited: Wed. Aug 7, 2019 - 07:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, you need to be more specific about which processor you're using. Most of us consider the hardware in the chip to be the "library" and the datasheet for the chip, the instructions on using the library.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I USE ATMEGA32  TO  understand spi how works.

maybe becouse i am not expert in spi and i start today to khnow about spi ,i asked this question.

so i need some EXAMPLE  for spi in atmel studio to khnow its operation. 

can you introduce me some source or give me some simple example about spi in atmel?/

Aasshh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

From the datasheet:

Note: SPI sends and receives at the same time, so one function does both!

Jim

 

Just noticed this DS listing does not RX data, here is an SPI function I have used:

 /* general SPI transfer function */
  uint8_t SPI_Transfer(uint8_t data)
    {
        SPDR = data;
        while (!(SPSR & (1<<SPIF)));
        return SPDR;
    }

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Wed. Aug 7, 2019 - 07:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nothing to do with studio so I'll move it to general programming.

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I will write that book about tying up shoelaces, I'm sure it will be a best seller somewhere.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js -

 

Be sure that you write your book at a 5-6 year old level! Then, you can write about SPI in the second half of the book.

 

Yes, I know that my own posting, asking about an SPI library ( https://www.avrfreaks.net/forum/... ) has close to 2500 hits. I plead No Contest; that was 2014 and I was still pretty wet behind the ears. Still not totally dry!

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Wed. Aug 7, 2019 - 10:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does SPI really justify a "library" anyway? It's usually about 3 lines of configuration and one send/receive function.

The only "tricky bit" in the whole of SPI is understanding and setting CPOL and CPHA but even that you can find b experiment as there only are 4 combinations to choose from.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

js -

 

Be sure that you write your book at a 5-6 year old level! Then, you can write about SPI in the second half of the book.

 

Yes, I know that my own posting, asking about an SPI library ( https://www.avrfreaks.net/forum/... ) has close to 2500 hits. I plead No Contest; that was 2014 and I was still pretty wet behind the ears. Still not totally dry!

 

Jim

 

well that explains why he started shouting in that thread too that we had to give him the library.....

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
I think I will write that book about tying up shoelaces, I'm sure it will be a best seller somewhere.

My wife just bought a book like that for our grandsons, LMAO watching her try out the 7 ways they display in the book.

She's very analytical, spacial concepts are difficult for her to grasp.

So if you can write one for those of us who are left brained that would be a winner!

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote: I think I will write that book about tying up shoelaces, I'm sure it will be a best seller somewhere.

Here's a site for some good material.

 

 

https://www.fieggen.com/shoelace/tying.htm

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Darn, so the book idea is not good? My book title was Shoelaces, Perfect, Instantly.

 

However I must sconfess that about 40 years ago I was confusing the SPI with the SCI (Motorola speak) and could not figure out why I was getting garbage out of the RS232 port. blush

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dougp2 wrote:

js wrote: I think I will write that book about tying up shoelaces, I'm sure it will be a best seller somewhere.

Here's a site for some good material.

 

 

https://www.fieggen.com/shoelace/tying.htm

 

 

 

I use his "Ian Knot." Was 8 when I learned to tie, and only because somebody showed me this.

 

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I will write that book about tying up shoelaces

Please do, since I am planning on releasing the blockbuster sequel: How to untie your shoelaces without getting tired.    surprise

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

She's very analytical, spacial concepts are difficult for her to grasp.


https://www.animatedknots.com/

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]