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

Phantom SPI Clock Pulses


  • Please log in to reply
1 reply to this topic

#1 Sukasa

Sukasa

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationNanaimo, BC

Posted 31 May 2015 - 08:36 AM

I've cross-posted this on the Adafruit support forums as well, but I'll ask here in case it's something on the uC...

 

I have a Netduino Plus 2 with two MAX31855 thermocouple breakout boards and a 2.2" colour LCD breakout, all from Adafruit.  The LCD works just peachy on its own.  However, if the SClk pins for either of the Max31855 boards are connected, then it seems that one or two spurious clock pulses are generated when trying to read from the LCD, one extra clock pulse per SPI read/write call (I use 2 calls, as there is an 8-bit  'dummy' read needed), which seem to happen *before* data is read in from the LCD.

 

These extra clock pulses do not happen if the LCD is the only device connected to the SPI bus' SClk line.  Is there any reason the N+2 would/could produce extra clock pulses when additional devices are added on to the SPI bus, that I could look for in my circuit?



#2 Sukasa

Sukasa

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationNanaimo, BC

Posted 02 June 2015 - 03:04 AM

(copy-paste from the breakdown on the Adafruit forums)

 

I was able to figure it out!

The thermocouple modules you sell have 10k pullups on the inputs to their SClk lines... and the protection diodes are used to pull the clock line low. Of course, this means that at any given time these modules are backfeeding 3v3 onto the SPI Bus' SClk. Whoops!

The solution I had was to place a PNP transistor in, to make the High-Low signal from the Netduino into an Open-Drain signal from the PNP. When the Netduino pushed high, the PNP would stop conducting and the thermocouple modules would pull themselves high. When the netduino pulled low, the PNP would conduct and pull the thermocouples low. When the uC was floating, the PNP would prevent backfeeding pulses that messed up the clock signal to the LCD.

So, long story short: the Adafruit thermocouple breakouts like to pull up the SPI bus' clock line, and the Adafruit 2.2" Lcd is susceptible to that, leading to "phantom" clocks and a few nights of headaches.






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.