Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Sn74hc125 tristate required for between each SPI device? And how do you check this?

  1. #1
    Senior Member
    Join Date
    Sep 2016
    Posts
    137

    Sn74hc125 tristate required for between each SPI device? And how do you check this?

    Hi guys,

    I still havenít solved the problem yet, and have been googling the problem with the max31855 and other devices on the same SPI.

    All show similar problems with clearly Mosi problems and hard CS pin select detection.
    Still I was wondering if something like this could be solved by software?

    I came accross: https://github.com/UnexpectedMaker/R...low_Master.ino
    He uses preprocessor statements and tells the void setup whoís first.

    So two questions: is it in gerneral advisable to use for every SPI device a tristate buffer?
    Second does it make any difference if preprocessing code is used instead of simple if statements?

    Sorry to bother you with more trivial questions.

    Best regards

    Bastiaan

  2. #2
    Since the MAX31855 has no data input I fail to see what a tristate buffer on MOSI will do for it.

    You can run into problems with devices that use the same pins to support either I2C or SPI. These commonly use the CS signal to select between them and also have the ability to disable I2C by writing to a device control register. So if you disable I2C early they usually get along well with others.

  3. #3
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    169
    @UhClem did you mean to say MAX31855 has no data out pin?

    On SPI only those devices that have output pins that don't properly tri-state would require the 74hc125 (or similar) buffer.

    @Bastiaan Do you also use 10K pull-ups on the CS lines so there is no (possible) bus contention when the Teensy is powering up and defining pin states. I don't know what devices are on your SPI bus, but I have found there is sometimes an order for device initialization such as SDcard before Ethernet to put the SDcard into SPI mode.

  4. #4
    Quote Originally Posted by grease_lighting View Post
    @UhClem did you mean to say MAX31855 has no data out pin?
    No. It has no input and only output. (A sensor that you can't read is a poor sort of sensor.) Since the data sheet shows CS to output enable and disable times, there should be no conflict with other devices so long as you manage the CS signals correctly.

    A pullup on the MISO pin can be helpful since it makes sure the bus doesn't float.

  5. #5
    Senior Member
    Join Date
    Sep 2016
    Posts
    137
    Quote Originally Posted by grease_lighting View Post
    @UhClem did you mean to say MAX31855 has no data out pin?

    On SPI only those devices that have output pins that don't properly tri-state would require the 74hc125 (or similar) buffer.

    @Bastiaan Do you also use 10K pull-ups on the CS lines so there is no (possible) bus contention when the Teensy is powering up and defining pin states. I don't know what devices are on your SPI bus, but I have found there is sometimes an order for device initialization such as SDcard before Ethernet to put the SDcard into SPI mode.
    Hi, I use 4.7 k resistors pull-ups on my CS pins of the max31855.
    I used on the hx8357 featherwing 3.5 inch also a 4.7k on the CS to vcc. I had to remove that, because the scope images show not a max pull to gnd if CS was pulled low.

    If I didnít use the serial monitor, I could check on the bus content With a voltage divider 10k to see it was floating without any actions( high or Low) I have an extensive post with Kurt E about this.
    Both libraries are set by the SPI.H, also written in the extensive post.

    Does the screen require a tristate?

    Best regards

    Bastiaan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •