How to add a 2nd hardware SPI port into project ?

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

How to add a 2nd hardware SPI port into project ?

791 Views
jameswhitney
Contributor II

Greetings,

After the necessity of requiring jumper JP6 to use PORT J4 was pointed out to me I am successfully able to read various stored parameters from the Microchip 25AA02UID EEPROM. Thanks !!

Currently, I am adding sections of that project to my SD card project. While defined in a different manner/location to the EEPROM project, on doing a 'search', both projects have defined 'EXAMPLE_SPI_MASTER' and its associated parameters, which creates several conflicts. The SD Card is using Flexcomm 5, while the EEPROM is using Flexcomm3. I do not want to attach both peripherals to i.e., Flexcomm 5.

To enable Flexcomm3, I modified all of the 'EXAMPLE_SPI_MASTER' related parameters in the combined project to 'EXAMPLE2........" Next I went into 'pin_mux.c' and *uncommented* all of the pin assignments for the Flexcomm 3 SPI signals, CS (SSEL), MOSI, MISO, and SCK. Problem is, seems only half of the signals are working: SCK and MOSI are working, but CS is not. I won't know whether MISO is working till CS works.

Anyone have an idea as to what I'm missing to get CS working.

Thanks,

Jim

P.S. I have attached 2 images: the first is for the correctly working SPI/EEPROM project, the second is for the partially working SPI 3 port.

Labels (3)
0 Kudos
3 Replies

691 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi James,

    That's very good to hear the JP6 make your EEPROM works OK, thank you for your effort all the time!

    About the CS pin, if you test one by one, it works OK or not?

   Or just when you combine Two SPI module together have the problems?

   About EXAMPLE_SPI_MASTER, you can just modify the name for two different SPI interface.

   From my own opinion, about the CS pin, normally, we will use the GPIO function to control the SPI_cs, then it will be more easily to control.

Wish it helps you!

  If you still have question about it, please kindly let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

691 Views
jameswhitney
Contributor II

Good morning, Kerry,

Thank you for your feedback on my question on adding a 2nd HW SPI port.

I agree in general that it would probably be easier to add -  and manually toggle - a 'CS' pin from another port. Before I went in that direction I decided to investigate a little more the contents of my project. When I merged the projects, in the *first project*  'EXAMPLE_SPI_MASTER' and its associated signal components and SPI signals were assigned to *Flexcomm5*. In the *second project* the SPI signals were assigned to *Flexcomm3*. I am using the Flexcomm5 project as the base/starting project. When I went into 'pin_mux.c' of the Flexcomm 5 project, Port 0, Pin 4 (coords: 38) was assigned as 'CLK'/FUNC1', whereas in the  in the original Flexcomm3 project, Port 0, Pin 4 (coords: 38) was assigned as a chip select, 'SSEL'/FUNC2. When I changed the Port 0, Pin 4 (coords: 38) pin configuration in the Flexcomm5 project to 'FUNC2' I was able to change the pin functioning to 'SSEL'. I could then also see the results of this change on the scope.

Thanks, and best regards,

Jim

0 Kudos

691 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jim,

   Thanks you for your updated information.

   So, if you have the new question in the future, welcome to create the new question post, thank you!


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos