This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can you have different clocking speeds for different slaves on the same SSI?

Currently I'm trying to run 2 different slaves on the same SSI (SSI2). The problem is that they require different clock speeds. I can not use different SSI because the slaves are on the same chip thus sharing the CLK, MISO, MOSI, DC.

I have used this function to set the clocks at 400kHz and 16MHz

ROM_SSIConfigSetExpClk (SSI2_BASE, ROM_SysCtlClockGet (),SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 400000, 8);

ROM_SSIConfigSetExpClk (SSI2_BASE, ROM_SysCtlClockGet (), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 16000000, 8);

Is there a function to switch between these two clocks?

As an added note, which I don't know whether it's relevant or not but will be embedded into a freeRtos program.

  • Matthew Chiang said:
    the (SSI) slaves are on the same chip

    That's a bit unusual - yet being on the (same) chip - and demanding different (assumed maximum) clock rates - seems extraordinary!

    Might you gift us w/a link or PDF - this "clock challenged" SPI device?

    To your issue - when we find ourselves tasked w/2 different SPI devices - and only one SPI port - we employ separate GPIO's as FSS - and employ the same clock control methods you illustrate - prior to the transmission to each device.   So long as you do not shift to the 2nd (other) SPI device - that's a single clock set.  

    Husbanding resources - as you're doing - usually but not always - adds (some) complications.    Welcome to the club...

  • I need clarification

    You have two slave devices on the same IC with different chip selects?

    One cannot run faster than 400kHz?

    One cannot run slower than 16MHz? Or maybe you are dealing with large amounts of data on this channel?

    That is a very odd IC. While I have seen multiple chip/function selects on a chip, I've never seen the shift registers for the different functions have different speed limitations. Are you sure you are reading the data sheet correctly?

    Robert
  • Robert Adsett said:
    Are you sure you are reading the data sheet correctly?

    Et tu, Brute?

    Me/Wethinks - unlikely!

  • That 400kHz is slightly odd too. More befitting IIC than SPI.

    Robert
  • Absolutement mon ami - absolutement.    Proper poster guidelines would enable our quick/eased review of (likely) misread/interpreted spec...   (we note those "guidelines" are "duly noted" yet data-short/soft postings echo endlessly...)

  • learn.adafruit.com/1-8-tft-display

    This is my 'IC'. The screen requires a clock of 16MHz while trying to write to the SD card only 400kHz can be used
  • So, not an IC. Still need clarification. Where are you getting those limits? Neither seem to be mentioned in your reference and I'm only willing to dig so far.

    As I recall, and others are more current with SD cards, the only time there is such a low speed limit on them is during the initial setup phase. Also my memory is that SPI become an optional part of the SD spec, but it's been years since I looked.

    Robert
  • Surely that good, "NYC lady" provides examples - have you (really) read/reviewed in detail?    Did not those directly address your issue.

    Your initial description caused much head-scratching (2 senior guys!)    Time/energy - which could have been (more profitably) spent in your behalf - down the rat-hole.   (again due to forum's "unguided postings.")    If you seriously read/review (as directed) - and can prove that - I'll assist further.

  • I'm doing this for a uni project which stated that we weren't allowed to use her library. The 16MHz clock was found from a similar example and it works well for updating the screen while the 400kHz clock was used for the microSD card because that was the value I found in one of the examples found in Code Composer Studio
  • Requirement by folk tale?

    Seriously, without a specification for the components you are communicating with it's not possible to answer this question. Although you can get a tentative set of answers by experimentation.

    Robert
  • Matthew,

    To do what you intend, you will need to re-configure the SPI clock with the function in your original post before you send/read SPI message to each slave.

    Thanks and regards,

    Zhaohong
  • cb1- said:
    ...when we find ourselves tasked w/2 different SPI devices - and only one SPI port - we employ separate GPIO's as FSS - and employ the same clock control methods you illustrate - prior to the transmission to each device.

    May we ask why vendor's (tad late) arriving post - essentially duplicating that (far earlier) here - is promoted as "suggested answer" - while the more detailed/earlier - near identical post - remains minus such anointing?

    Shouldn't the vendor's real response be to (really) push for posters to provide full & complete details - so that endless guessing and false trails are bypassed/avoided?     Is that not the BEST possible, "Suggested - Long Term - ANSWER?"    Everything else proves ineffectual - does it not?

  • cb1 - Maybe not enough of either the tutor's or trouble-shooter's inclination?

    The tutor will push towards deeper understanding and self reliance. The trouble-shooter will push towards determining the root cause. The approaches are not exclusive but given the purpose of the project the tutor's response does seem appropriate.

    Robert

    It does appear that the question asked and the actual problem are not strongly related.
  • Robert Adsett said:
    Requirement by folk tale?

    Robert - my young staff (et moi) are (still) laughing!    (and I note - their "requirements" today - bear (far more) detail/desciption/clean reference...)

    Vendor's rep - late to the party w/derivative/repetitive "suggestion" - "passes" upon the real need of the forum.    Never is a chance to "guide/correct/improve" ventured - that's no "Stellar" suggestion...    and that's a pity...