Use KW36 as SPI slave

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use KW36 as SPI slave

1,206 Views
123gmax
Contributor II

Hello, 

I have two questions related to FRDM-KW36 board

1. I see from user manual that Header is Arduino compatible, but when I see the schematic I got confused because SIN,SOUT,SCLK are from SPI group 0 and only chip select (PSC0) is from SPI group 1. How this combination can be used? In my opinion, if this is compatible to Arduino then at J2 Pin3, it should be the chip select (CS) from the same SPI group.

Below is the image for quick reference 

123gmax_0-1602599558673.png

 

2. Does KW36 need pull up resistor for SPI lines? I see that SPI interface to on board flash has no external pull resistors except for CLK and CS.

 

Thanks in advance.

Labels (1)
0 Kudos
2 Replies

1,199 Views
myke_predko
Senior Contributor III

Hey @123gmax 

I just took a look at the FRDM-KW36-RevB1 Schematic and I can see:

  • SPI0_SCK on D13
  • SPI0_SIN on D12 (it took a bit of work to find it as it's labeled "SPI0_IN" on the "Arduino" connectors)
  • SPI0_SOUT on D11
  • SPI0_PCS0 on D2 (although I'm not sure it can be used because the pin is also wired as "RF_EARLY_WARNING"
  • SPI0_PCS2 on D1

 

  • SPI1_SCK on D9
  • SPI1_SOUT on D8
  • SPI1_SIN on D3
  • SPI1_PCS0 on D5

And the SPI port pins match the Arudino Uno SPI Reference pinout which are:

  • SPI_SCK on D13
  • SPI_SOUT on D12 (in Slave Mode)
  • SPI_SIN on D11 (in Slave Mode)
  • SPI_PCS on D10

The Freedom boards pay lip service to being Arduino pin compatible and not much more.  In the case of SPI, maybe it's a good thing that the Freedom board designers don't try to be too pin compatible as they can lead to more difficult problems down the road if people assume that the Freedom boards are pin/signal equivalent to Arduino.  

I use the Arduino Uno prototyping shields all the time with Freedom boards.  Despite having to understand the pinouts really well when you wire up your prototypes, this approach works quite well (a lot better/easier than using Tower boards).  

But, there is an issue and that's if you want to use an pre-defined Arduino shield with a Freedom board - the short answer is that you can't.  Maybe there are some that will work with the various Freedom board pinouts (just using DI/DO and Analog pins) and maybe it's worth using them with the aformentioned bit-banging but I think it's best to recognize that you're going to be doing some custom wiring on a prototype shield.  

As for your second question, PCS should NOT have a pull up.  It's not an Open-Drain bus.  It should always be driven high by the master when data is not being sent.  

Good luck,

myke

0 Kudos

1,191 Views
123gmax
Contributor II

Hello @myke_predko ,

Thank you for your detailed explanation, it really helped. Looks like I have to tinker a bit to make board work for my application. 

Best regards,

123gmax

0 Kudos