How to use SPI communication between Arduino (Controller) and TI F280039C (Slave)?

3 visualizaciones (últimos 30 días)
Hello,
I would like to establish a SPI communication between an Arduino Uno which acts as a controller and a TI F280039C which works as a periheral. For this I send a "15" (Dec) to the F280039C in an interval of 200ms. This should send back certain values after receiving the message. At the moment the following settings concerning the SPI are adjusted:
CPOL - Idle when high
CPHA - samples data on the leading edge of the clock
I have already tried all possible combinations of these settings. Now and then the communication works, but unfortunately not reliably.
Furthermore the communication should actually work with an interrupt routine. Unfortunately this has never worked. Where is the problem?

Respuestas (1)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU el 3 de Nov. de 2023
Dear Patrick,
I understand that you are trying to establish an SPI communication between an Arduino Uno (acting as a controller) and a “TI F280039C” (acting as a peripheral). SPI communication can be tricky due to its synchronous nature and the need for precise timing. Here are a few things you could check or try:
  1. Wiring: Ensure that the wiring between your Arduino and the “TI F280039C” is correct and secure. Loose or incorrect connections can cause intermittent communication issues.
  2. Baud Rate: Check if the baud rate of the Arduino and the “TI F280039C” match. Mismatched baud rates can cause communication issues.
  3. Data Type: Ensure that the data type of the value you are sending matches the data type that the “TI F280039C” is expecting.
  4. Interrupt Routine: If you are using an interrupt routine, make sure that it is set up correctly. Incorrectly set up interrupts can cause communication issues.
  5. Software Issues: There might be issues with the software or libraries you are using. Try updating your software or libraries to the latest version.
  6. Debugging with Serial Output: Use serial output on both the Arduino Uno and “TI F280039C” to debug and monitor the SPI communication. Print debug messages and received data to the serial monitor to help identify any issues or inconsistencies in the communication.
If you have checked all of these then you’ll be able to establish the accurate communication between master and slave.
I hope this helps!

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by