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

manual spi clock

spi dual use of pin spi clock

  • Please log in to reply
6 replies to this topic

#1 orenduino

orenduino

    Member

  • Members
  • PipPip
  • 26 posts

Posted 12 May 2014 - 06:41 AM

Hi.

I am using SPI to transfer data.

I need some SPI clock pulses before and after the transmission.

it looks like the MicroFrameWork does not allow to assign the PIN13 as GPIO and SPI at the same time.

 

I Have tried to define a second slave, but since I didn't found a way to keep the DATA value as  '0' all the way, it is interrupting the transmission. (The data always '1' before the SPI transmission begins, no matter what you send).

 

Anyone has any suggestions on how Can I Generate clock pulses on pin13, while using SPI ?

 

Thanks

Oren



#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 12 May 2014 - 06:54 AM

You actually can use both the SPI and the output. Have a look at my article:

http://tinyclr.it/su...r-netduino.aspx

Good luck!


Biggest fault of Netduino? It runs by electricity.

#3 orenduino

orenduino

    Member

  • Members
  • PipPip
  • 26 posts

Posted 12 May 2014 - 08:45 AM

Hi Mario.

I have read your article, Its great work...

You have found a bug which allow you to "Dual use" a certain pin, and thats great.

I have investigate the reason why I couldn't implement this in my code, And i Have reach to conclusion that I might haave a different  version of NETMF, that no longer contain that bug. (I Use .NETMF 4.2 QEF2 with Netduino 1)

(Assuming I did it the right way)

 

I have copy/paste your code from your post, please view snapshot, and let me know what you think.

 

Oren

 

p.s. I  get the same error when trying to implement that with SPI pins

Attached Files



#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 12 May 2014 - 11:45 AM

Hmm...as long I don't know whether the "sharing" of the SPI with another pin is actually a bug, the trick works with the SPI only, not with any I/O.

In the attached picture you are trying to share an output port and a tristate port: what's the meaning?


Biggest fault of Netduino? It runs by electricity.

#5 orenduino

orenduino

    Member

  • Members
  • PipPip
  • 26 posts

Posted 12 May 2014 - 11:54 AM

I tried to share the SPI CLOCK (Pin13) with TRISTATE, I got an error (As in the attached image)

so I tried to copy the exact code from the example within the link you post, just to see if it works.

It didn't work, so I Snapshot the error with this example.



#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 12 May 2014 - 12:27 PM

OH!...It's probably patched as an issue. I know that there was several problems related to the SPI in the Netduino (Plus) 2: some of them should be patched, but I'm not aware of what exactly they are.

At this point the only software way is pulsing the SPI as bitbang. Otherwise, the hardware way is the wired-AND (similar to the I2C, but it requires a bit of parts glued).

Cheers


Biggest fault of Netduino? It runs by electricity.

#7 orenduino

orenduino

    Member

  • Members
  • PipPip
  • 26 posts

Posted 12 May 2014 - 12:30 PM

If you say so....

Look at my other post.. maybe you can help me there with the SPI.

 

http://forums.netdui...d-a-bug-in-spi/







Also tagged with one or more of these keywords: spi, dual use of pin, spi clock

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.