Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Wiki tutorial on SPI


  • Please log in to reply
7 replies to this topic

#1 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 01 September 2011 - 11:11 AM

Hello guys...
I improved the existing SPI Confiugration tutorial by MikeP.
I would ask to anyone of (US) English mother-language to check and edit for correctness.
Nothing versus the British English, but it seems to me that most of the tech-literature is offered in US English.
Thank you all.
Cheers
Biggest fault of Netduino? It runs by electricity.

#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 September 2011 - 11:39 AM

Interresting!
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 01 September 2011 - 12:16 PM

Stefan!...Were you on vacation? It's a been that I did not see any post from you...
Biggest fault of Netduino? It runs by electricity.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 September 2011 - 02:54 PM

Stefan!...Were you on vacation?
It's a been that I did not see any post from you...

Preparing for a vacation, but my postcount is a bit lower as usual indeed :D
Working on a few things, of which I will release one hopefully next week on the boards.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 01 September 2011 - 04:18 PM

If you have time, take a look and tell me whether something is wrong/unclear or else.
I would add a section for the HC165 as well.
Do you think would be better to move as a separate tutorial?
It seems to me that the users are asking always the same questions. For instance, they're asking about the UART, and there's no any tutorial on it.
Maybe I will do it.

Preparing for a vacation, but my postcount is a bit lower as usual indeed

Our prime minister (and the rest of gov) is specialized on economic sciences.
He has created the 'HC595-bank-account for the citizens. You put inside your Euro, on the (many) outputs there are a bunch of "smart" people pulling out many Euros. The main problem is that they're pulling out much more than you push inside...new kind of FIFO?
Have fun!
Cheers
Biggest fault of Netduino? It runs by electricity.

#6 Mike P

Mike P

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAuckland, New Zealand

Posted 04 September 2011 - 01:37 AM

Hi Mario, Thanks for adding the example. I think that a tutorial on using the 74HC595 is worthy of being a wiki topic in its own right. Can I suggest that you copy the tutorial to a new topic and link to that from the SPI configuration topic. This bit is not quite correct: "In the below picture there are the four possible combinations of Clock_Edge (NCPHA) and Clock_Idle (CPOL)" The NCPHA and CPOL bits used by the processor to control the SPI transfer do not map directly to the Clock_Edge and Clock_Idle parameters. It is not true to say that Clock_Edge==NCPHA. If CPOL==1 then Clock_Edge = !NCPHA It is correct that CPOL and NCPHA select 1 of four SPI modes and Clock_Edge and Clock_Idle have the same function. It would be better to show an excerpt from the 74HC595 datasheet and highlight what to look for.

#7 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 September 2011 - 06:25 AM

I think that a tutorial on using the 74HC595 is worthy of being a wiki topic in its own right.
Can I suggest that you copy the tutorial to a new topic and link to that from the SPI configuration topic.

Okay, I'll move it off.

This bit is not quite correct:
"In the below picture there are the four possible combinations of Clock_Edge (NCPHA) and Clock_Idle (CPOL)"
The NCPHA and CPOL bits used by the processor to control the SPI transfer do not map directly to the Clock_Edge and Clock_Idle parameters.
It is not true to say that Clock_Edge==NCPHA. If CPOL==1 then Clock_Edge = !NCPHA
It is correct that CPOL and NCPHA select 1 of four SPI modes and Clock_Edge and Clock_Idle have the same function.

That's right: there's a mistake.
Anyway, I'm not sure about what you mean. Clock_Edge and Clock_Idle are not the same.
I checked it as:
  • CPOL == Clock_Idle
  • NCPHA == Clock_Idle XOR Clock_Edge
Or:
  • Clock_Idle == CPOL
  • Clock_Edge == CPOL XOR NCPHA

It would be better to show an excerpt from the 74HC595 datasheet and highlight what to look for.

From my viewpoint, this tutorial wouldn't have sense if the people are able to understand the datasheet. What I have seen, it's just they are making confusion...and there's no any table showing how to relate the chip logic to the software flags.
For instance, your SPI config description is valuable, but it does not clarify how to set the flags upon a certain chip (e.g. 74HC595). The typical user does not want to squeeze its brain, but it prefers having some kind of walkthrough.
I'm not sure a datasheet excerpt would simplify the user's comprehension.
Anyway, the Wiki is free for anyone who likes to improve it.
Cheers
Biggest fault of Netduino? It runs by electricity.

#8 Mike P

Mike P

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAuckland, New Zealand

Posted 04 September 2011 - 12:31 PM

My English could be better and it is my firt language. What I meant to say was CPOL and NCPHA select 1 of four SPI modes and Clock_Edge and Clock_Idle also select one of 4 SPI modes.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.