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.

AM263P4-Q1: AM263P4-Q1

Part Number: AM263P4-Q1
Other Parts Discussed in Thread: AM2634, , SYSCONFIG

Tool/software:

I am trying to run the MCSPI loopback example provided in the SDK v10.02.15, which uses SPI0. I’ve initialized a TX buffer of size 128 with all values set to 0x01. However, I’m not observing expected behavior on the output pins.

I checked the voltage on pin J6.55 (SPI0 D0 on the LaunchPad) and it reads 0.45 V, which is not expected since the TX buffer contains all ones.

The example code does not include IO expander configuration to route SPI0 signals through the onboard multiplexer (U51). To address this, I configured using system configuration set these values in IO expander and enabled I2C1.

  • MUX_EN_GPIO58_INV = LOW

  • AM263_BP_MUX_SEL_GPIO63 = LOW

After this configuration, the measured voltages are:

  • AM263_SPI0_CLK = 0.722 V

  • AM263_SPI0_CS0 = 3.27 V (unexpected – should be LOW during transmission)

  • J6.55 (SPI0 D0) = 0.45 V (unexpected – should be HIGH for data = 0x01)

It appears that data is not getting transmitted properly using the example code.

How can I resolve this issue? Is there anything missing in the initialization or pin routing? Attached the pics of system config and code.

  • Hi Rapeti,

    Can you clarify which EVM you are using? The thread title says AM263P4-Q1, but the references in your post are for the AM2634 LaunchPad. What is the orderable part # of the EVM you are inquiring about?

    Regards,

    Brennan

  • Thanks for the reply Brennan,

    I am using AM263P4ACOMFZCZR.

    I checked the voltage on pin J6.55 (SPI0 D0 on the LaunchPad) and it reads 0.45 V, which is not expected since the TX buffer contains all ones.

    In Launchpad schematic SPI0 Do pin is mentioned as J2.15 and in user guide it is mentioned as J6.55 pin as SPI0 D0.

    I have measured voltage levels at both the pins And i got the following values:

    J2.15 = 0.7v

    J6.55 = 0.45v. 

  • Rapeti,

    SPI0_D0 is on pin J2-15. SPI1_D0 is on J6-55. The schematic should always be considered correct vs. the User Guide. Please Submit Document Feedback by clicking this link in the footnote of any page of the User Guide:

    SPI0_D0 and SPI0_D1 do not go through any multiplexing, but there are other muxes you need to set in order to route the full SPI0 interface to the BoosterPack header.

    • SPI0_CS0: J2-18, routed through mux U51
    • SPI0_CLK: J1-7, routed through mux U51 
      • SEL: AM263P_BP_MUX_SEL = LOW
      • OEn: PRU/BP_MUX_EN_INV = LOW

    Please ensure these mux configuration signals are set correctly in the IO expander, and probe the chip select / clock pins.

    Regards,

    Brennan

  • Thanks for the reply Brennan,

    The PRU/BP_MUX_EN_INV  is low by default and AM263P_BP_MUX_SEL is low by default. For the Mux U51 to route the SPI signals , the selection and enable signals should be low. So the SPI signals are routed.
    The data is captured on the J2.15 pin it is showing the voltage levels. But now now i want to receive it using SPI1 D1 pin. Enabled the SPI1 using Sys Config and enabled it for RX. Attached the pics. Conneted the SPI0 Clock pin to SPI1 Clock pin, SPI0 D0 pin to SPI1 D1 , SPI0 CS0 pin to SPI CS0 But the data is not being received in the RX0 buffer of SPI1.

    These are the snapshots of code. Enabled the RX0 buffer full interrupt to receive the data.

    These are the Configuration of MCSPI0 and MCSPI1

     Is there anything missing in the initialization. How to resolve this.

  • Rapeti, 

    It would be helpful if you paste your code into blocks - easier to read through than screen images Slight smile.

    The hardware/sysconfig looks correct. I am looping in a software expert to review your code.

    Regards,

    Brennan

  • would

    Actually we don't have access to the extranet. So that's why I have taken the screen images.

    The hardware/sysconfig looks correct. I am looping in a software expert to review your code.

    Thank you for your response and for involving the software expert. I would really appreciate it if the review could be done at the earliest possible convenience.

  • Rapeti,

    For McSPI0, since it's operating in TX only mode with D0 as TX Pin, we should configure "Input Select" as D1 in SysCfg. For McSPI1, since it's in RX only mode with D1 as RX pin, we should configure "D1 TX Enable" as "TX disabled". McSPI_Transfer API should be called for McSPI1 first since it's the receiver and then this should be called for McSPI1. Also, both the instances should be in callback mode or else the receive API will be stuck since the send API won't be invoked.

    Regards,

    Ashwin

  • Thanks for the reply Ashwin,

    I have made those all changes. Now a random data is being received on SPI1 D0 pin. These are the snapshots of the changes made in the code and Sysconfig.

    The Tx and Rx data are printed (included in call back functions) in console.Attached the pic

    Is there any thing missing? 

  • Can you move the prints to the application ? We should not print from callback since they are invoked from ISR context. Also, can you make txDone1 as 0 before calling transfer API ?

  • Hi Ashwin,

    Made the changes as suggested. But still receiving a random data.

    Regards

    Sravanthi R.

  • In line 140 and 144, some memory address is being read and printed out. What is this memory address ?

    The transfer is being done from gMcSPITxBuf to gMcSPIRXBuf1. These two should be printed out right ?

  • In line 140 and 144, some memory address is being read and printed out. What is this memory address ?

    These are the memory address of TX0 of MCSPI0 and RX0 of MCSPI1. I am trying to print the , actual values being loaded in TX0 register of MCSPI0 and RX0 register of  MCSPI1.

  • The register values will be emptied out once it is ready by the ISR. Can you print the values in gMcSPITxBuf to gMcSPIRXBuf1 ?

  • Hii Ashwin,

    1. These are the values being loaded in gMcSPIRXBuf1 and gMcSPITxBuf.
  • Hii Ashwin,

    These are the values being loaded in gMcSPIRXBuf1

  • The application code and SysCfg looks fine. Can you share the external connection details ?

  • I am connecting J1.7( SPI0 Clock) to J5.47( SPI1 Clock), J2.18(SPI0 CS0) to j6.58(SPI1 CS0), J2.15(SPI0 D0) to J6.54(SPI1 D1).

  • Just a reminder for the above query.

  • I have made some changes(attached the images of the configuration) and now i am receiving the data. But When I am trying to transmit a data of 16 bytes i.e an array consisting of 16 elements i am receiving only first two data elements. Attached the image of data being received in the buffer

    .IMG-20250708-WA0061 (8 files merged).pdf 

    Reagrds

    Sravanthi R.

  • Hi Team,

    Thanks for the support! 

    Can we share an example code to Sravanthi to test? If it's working from our end, we can share the same sysconfig and code snippets.

    Best,

    MK

  • Hi,

    In the TX configuration, the data size is set to 8 (Bits) and count is set to 2. This implies that only 2 bytes will be transferred. Please increase the count to 16 if 16 Bytes needs to be transferred.

    Regards,
    Ashwin