Example code for AVR151 (SPI Setup and use)?

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

I'm looking through the AVR151 app-note on how to setup and use the SPI interface and I'm not seeing any code examples/sample code anywhere even though it mentions it.  In fact at the bottom under revision history it mentions:

"Updated the firmware to the latest version of Atmel Studio (Atmel Studio 7) and made minor changes in the document. "

 

Am I missing something?

-Adam
"Please don't judge my God by my inability to follow him" - Chris Mollins
================
www.onecircuit.com
================

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

Go to any atmel avr device page that lists AVR151 under "Documents" and you will see TWO icons alongside. One leads to the PDF you already have while the one that looks like a file folder leads to the ZIP that you clearly don't have.
.
But SPI is so simple I doubt example code has much to show you that isn't already given in the SPI section of the datasheet.

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

Yeah I'm not finding it anywhere. Not sure if it got lost when Microchip took over?  

 

I'm using an ATMega16 and the 2 pages I found that show the PDF are these:

http://www.atmel.com/products/mi...

http://www.microchip.com//wwwApp...

 

But no sign of the zip.

-Adam
"Please don't judge my God by my inability to follow him" - Chris Mollins
================
www.onecircuit.com
================

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

Yeah I'm not finding it anywhere

Not looking very hard:

http://www.atmel.com/products/microcontrollers/avr/megaAVR.aspx?tab=documents

 

"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]

 

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

Ah it was under Application notes and not Documents.  Got it... Thanks.

-Adam
"Please don't judge my God by my inability to follow him" - Chris Mollins
================
www.onecircuit.com
================

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

Hello! Same problem. Old links don't work. Cannot find C-code examples on Microchip website, only AppNote AN_2585 (AVR151) exists.

Last Edited: Mon. Aug 3, 2020 - 09:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well it's in a different language but this site seems to have the contents of avr151.zip...

 

http://www.pudn.com/Download/item/id/785927.html

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

"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]

 

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

joeymorin Thank you very much! But your links don't open anything.... =(

I went to Wayback Machine and haven't find there AVR151 zip archive also.

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

clawson Thank you very much, seems to be that is what I need!

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

Seems to be accessible here, webpage in Chinese although the source files are untouched.

 

http://www.pudn.com/Download/ite...

 

On page 2 of a google search for "avr151.zip atmel"

 

Of course, being China, it could put a backdoor into your code and syphon off your design's IP to Beijing ;)

 

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

Here it is, I had it in my library of app notes:

 

See attached.

Jim

 

Attachment(s): 

 

FF = PI > S.E.T

 

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

Some AVR's can also do USART as master SPI:

 

Attachment(s): 

 

FF = PI > S.E.T

 

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

CatseyeN wrote:
joeymorin Thank you very much! But your links don't open anything.... =(
Then you have a problem on your end.  Links work fine.

 

The Internet Archive sometimes has connectivity issues.  In fact, I saw that earlier today.  Just keep hitting refresh until it works.

 

(maybe a DDOS is underway...?)

 

I've also attached the copy from the last Atmel Techlib DVD.

 

EDIT:  whoops, uploaded .pdf, now corrected with .zip.

Attachment(s): 

"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]